[Cogl] Cogl in Python

Martin Owens doctormo at gmail.com
Sat Apr 7 19:33:03 PDT 2012


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.

Best Regards, Martin Owens



More information about the Cogl mailing list