Hope they aren't all this slow (First extension for testing goes very poorly...)

Decided to test the wrapper for one of the few PyOpenGL extensions to which I actually have access, ARB vertex object buffer. Unfortunately, so far 2 out of 3 functions have required completely custom wrappers. This is going to be a very slow process if all 180+ new wrappers need this kind of attention.

The problem is basically that SWIG doesn't readily support taking multiple arguments and converting them into single-arguments and/or using them to modify other arguments.

Consider a function like this:
glGenBuffersARB(GLsizei n, GLuint * buffers);

What you want to do for that is to simply pass in an unsigned integer and have the wrapper allocate a new GLuint array of length n call the underlying method, then convert the temporary buffer into an array to be returned.

That's a fairly simple function to write, but having to write it for every single method of the hundreds and hundreds defined is not going to work. Even having to go through and modify the declarations to match those SWIG typemaps that exist is going to take a very long time.

Almost enough to make me want to use ctypes.


Comments are closed.


Pingbacks are closed.