[Pyrex] Function Pointer

Greg Ewing greg at cosc.canterbury.ac.nz
Fri Mar 5 02:47:24 CET 2004


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.

> Its not called. If the pointer is NULL there will be no call
> too. Maybe thats the problem. If I look at the C-Code the pointer cast
> looks like (void((*) ())).

It looks right. The C compiler would be complaining if it
weren't, anyway.

Whatever the problem is, I think it's outside of the code
you posted. Maybe there's something about the way you're
calling GLU that's preventing the callbacks being called.
I'm not familiar with GLU in particular, but I know there
are various places in OpenGL where you have to turn on
certain options before other calls will have an effect.

Can you write a pure C program that does the equivalent
things and make it call a callback?

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+




More information about the Pyrex mailing list