[Cogl] Cogl in Python

Tomeu Vizoso tomeu at tomeuvizoso.net
Tue Apr 10 08:20:09 PDT 2012


On Sun, Apr 8, 2012 at 04:33, Martin Owens <doctormo at gmail.com> wrote:
> Hey Cogl Devs, (Just Robert and Neil?)
>
> Version: libcogl9 1.10.0 / gir1.2-cogl-1.0
>
> I'm using Cogl using gobject introspection, in conjunction with Clutter.
> But I'm having a problem using materials. Trying to do anything with
> Cogl objects causes a segfault, anything at all. Which means things
> like:
>
> m = ClutterTexture.get_cogl_material()
> Cogl.set_source(m)
>
> works ok, but:
>
> m.set_color4ub(255, 255, 255, 128)
> Cogl.Material.set_color4ub(m, 255, 255, 255, 128)
> print m
>
> Cause SEGFAULTS in Py_GetAttr, recursive_isinstance,  PyFile_WriteObject
> respectively.
>
> I did manage to workaround the SEGFAULT caused by cogl trying to unref
> the material after it had existed in python. Using the `del m` to remove
> it completely from the python namespace stops the odd duality.
>
> Literally looking at cogl-material in the wrong way causes it to blow up
> in ones face. I wonder what Clutter does that Cogl needs, maybe some
> sort of cooling rod ;-). Any ideas either working around these issues or
> trying to debug them using gdb, I'd be open to tracking through them.

It's probably missing annotations, or perhaps PyGObject needs to be
taught a couple new tricks in order to use low-level APIs such as
Cogl.

I would only discard g-i once we find that the Cogl developers
strongly want to use something that won't work with g-i in the near
future.

Regards,

Tomeu


More information about the Cogl mailing list