ctypes-ing the night away (Shake-shake-shake your bootie... though that doesn't move one forward very far...)

Although it was tempting to try to rewrite the whole VOIP billing front-end in Django this evening as a test, I decided that getting OpenGL-ctypes moved forward would be a bigger net win for the world. So, sat down and wrapped the GLUT font pointers and the GLU tessellation structure/functions.

I've got to find a better way to do that. I wind up pretty much writing custom code for the whole GLU library... the auto-generated wrappers help somewhat, but the callback-using code just winds up with all sorts of specialised code because it has to deal with original-object-return, with turning incoming pointers into arrays for use in the Python code, and for retaining pointers to the cCallback objects.

Problem is, it's always going to be messy dealing with the low-level guts like this. An automated wrapper generator can't tell whether a GLdouble * is an array or an output variable. That information has to be added to the system by a human being who reads the documentation. SWIG handles it with the .i file... maybe we could write something similar for ctypes, but do it in such a way that it generates a second document to feed into the wrapper-generator. Reminds me, I need to go back and un-hack parts of the openglgenerator module, it currently makes all of the structure-accepting arguments look like matrix/array arguments, which means they need to be hacked back to make them work.

There's still a crash in the GLUT font rendering, and the GLUT context in general is non-functional. I seem to be going rather slowly on all this.


Comments are closed.


Pingbacks are closed.