Lists/tuples are so convenient

As I've been working on the OpenGL presentation I've run into this issue a couple of times... much of the overhead in PyOpenGL 3.x's array-handling could be eliminated if we didn't allow for copying data at all when passing in array values.  That is, if we were to always require that the client-passed value be an array-compatible format that is contiguous and otherwise C-friendly then we could reduce many of the wrappers down to a simple 2 or 3 line function (many of which are available in the OpenGL_accelerate module).

I'm considering implementing a mode to enable such restrictions for 3.0.1, likely at the same time as providing the 3.1 deprecation warning functionality.  It would mean that lists and tuples would no longer be acceptable as array data-types, but it would mean we could drop all of the conversion code, the "store the pointer just in case" code, and basically everything but the "figure out the other parameters from the array dimensions" code for many of the wrapped functions.

Anyway, I'm almost done the OpenGL presentation for PyGTA tomorrow.  Realized this evening that the reason I've been blocking on it was simply that I was trying to write two different presentations at the same time, one for PyCon and one for PyGTA.  When I just took the simple step of renaming the file to "PyGTA Presentation" in my mind, I could see how to structure the presentation easily.  Until then I was stuck in the "gimbal lock" of trying to satisfy mutually exclusive (though only partially exclusive) design requirements.

Anyway, it's late and the puppy needs a walk, so I will have to take time off tomorrow again to finish the presentation.

Comments

Comments are closed.

Pingbacks

Pingbacks are closed.