[Cogl] Does anyone have any good resources to learn Cogl?

Robert Bragg robert at sixbynine.org
Mon Jul 7 08:59:42 PDT 2014


Hi Barry,

Since the more complete gobject introspection support was only landed
quite recently I'm afraid that means you are one of the first to be
playing around with Cogl from a language other than C.

Other points of reference for using the Cogl api could be the
examples/ directory and the conformance tests (tests/conform/)
although these are also mostly written in C, except for
examples/cogl-gjs.js. cogl-gjs.js could be helpful for you, though as
far as demonstrating the cogl api it only shows drawing a rectangle
which isn't super exciting.

One thing I'm not sure about is how well gobject instrospection lets
you manage buffers of data and pass those into Cogl. In programming a
GPU you will typically create buffers that represent the triangles you
want to draw, e.g. describing the positions and colors of those
triangles. As far as I understanding it, gjs doesn't currently support
things like Typed Arrays so we don't have a very good way of
submitting geometry to Cogl from JavaScript a.t.m. I don't really know
if that's just a limitation of gjs, or if this problem will also
affect the Vala bindings. Lionel Landwerlin who worked on the gobject
introspection patches probably knows best.

Do you know for example if apis like cogl_primitive_new_p2t2() are
exposed in the vala bindings? or cogl_attribute_buffer_new()?

B.t.w when it comes to the reference manual, I'd suggest that you look
at the 2.0 manual here: http://cogl3d.org/cogl-reference/ as opposed
to the 1.x api here https://developer.gnome.org/cogl/stable/. Even
though you are no doubt using a cogl 1.x release, I think the 2.x docs
better hide the older, deprecated apis that should probably be avoided
in any new code.

You can also try prodding Neil Roberts and myself on Freenode IRC in
#cogl (bpeel and rib) though sorry if we sometimes aren't very
responsive there.

Kind Regards,
Robert

On Mon, Jul 7, 2014 at 2:03 PM, Barry Smith <barry.of.smith at gmail.com> wrote:
> Hi,
>
> I've started developing software with Vala, and have got fairly good with
> the language. I'm looking to write 3D simulation software, so I found the
> Cogl library. It looks like just the thing I need. Unfortunately, after a
> few hours trawling the web, I have found only this website below with any
> meaningful information on learning about the library:
>
> http://cogl3d.org/hello.html
>
> Although this website is helpful, it's in C (not something I'm brilliant at)
> and as a newcomer to 3D graphics, it's not very friendly so I'm finding it
> hard to extract any meaningful information from it.
>
> I know that there is documentation for the library - even with Vala - but it
> is not very helpful when trying to learn the library well. Does anyone know
> a good way of learning? How did you learn how to use it?
>
> Thanks,
>
> Barry Smith
>
> _______________________________________________
> Cogl mailing list
> Cogl at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/cogl
>


More information about the Cogl mailing list