Numeric (legacy) support now working in OpenGL-ctypes (Well, cvs version...)


Finally got some time for OpenGL-ctypes. Decided to work on the module to support using Numeric 24.x as a data format. Thanks to a thread on ctypes-users it turned out to be a trivially simple module.

It turns out that the "object" type has a __basicsize__ attribute which tells you the size in bytes of the PyObject HEAD. Numeric arrays' first member is their data-pointer, so the pointer stored at object-pointer + the size of the head is the data-pointer of the Numeric array. Sure it's a bit of a hack, but it's a neat hack.

That seems to work fine on my machine. I've only tested a couple of dozen demos so far, but they all have worked (even problematic ones). Think I'm going to call it a night while I'm ahead.

Comments

Comments are closed.

Pingbacks

Pingbacks are closed.