Array handling moves forward in OpenGL-ctypes (The goal is flexibility...)
Written by
on
in
Snaking.
Doing a bit more work with OpenGL-ctypes this evening. Mostly focusing on the array datatype handling. Basically what I want to allow is that any number of array-like datatypes can be registered with the system so that they can be passed to (and potentially returned from) functions expecting POINTER( basetype ) arguments.
Also tweaked the code-generator so that it only declares a pointer an array type if the base data-type is something we know how to handle as an array (i.e. a float, int, uint, short, etceteras, not a structure or a void).
Comments
Comments are closed.
Pingbacks
Pingbacks are closed.
Robert Kern on 08/21/2005 6:18 p.m. #
The Numeric community is converging on an array interface. We would be delighted if OpenGL-ctypes would support it.<br />
<br />
<a href="http://numeric.scipy.org/array_interface.html">http://numeric.scipy.org/array_interface.html</a>
Mike Fletcher on 08/21/2005 10:01 p.m. #
You kow, I've seen that page before, but AFAICS it's not available on Numpy arrays (at least with version 23.8). Anyway, part of the new design is that multiple array types can be handled via pluggable handlers, so an array type that *did* implement the interface could simply have a handler registered to make it interact with OpenGL-ctypes.<br />
<br />
However, OpenGL-ctypes only really deals with arrays of floats, doubles, ints, uints, bytes etceteras. It doesn't have particularly funky compound structure requirements (for 99% of the interface, anyway).