[Pyrex] Function Pointer

Jiba jiba at tuxfamily.org
Sat Mar 6 11:27:11 CET 2004


On Fri, 05 Mar 2004 14:47:24 +1300 (NZDT)
Greg Ewing <greg at cosc.canterbury.ac.nz> wrote:

> Ok, the prototype is tesselator_vertex(void* vertex, void* tesselator)
> but I thought that it shloud be possible to pass python objects.
> 
> It should be, but it's a bit tricky casting between Python
> objects and other pointer types, since it's not always
> obvious what Pyrex will do with the refcounts.

I use GLU tesselator callbacks with Python object without problem (but i
don't use "object" but a specific cdef'ed class ("MyCdefClass")).

I define the tesselator structure as following :

ctypedef struct GLUtesselator:
  int _dummy

since empty structures doesn't compile for me.

Jiba




More information about the Pyrex mailing list