On 13-08-17 12:28 AM, Marcus von Appen wrote:
On, Sat Aug 17, 2013, Lenard Lindstrom wrote:Ctypes may be the way to go on PyPy, but it is slow in CPython. It lacks new buffer support. Well, ctype types have buffers, but they don't work with NumPy.Take a look at https://bitbucket.org/marcusva/py-sdl2/src/963b26e2110449a453efa7fa45328c0062c72697/sdl2/ext/pixelaccess.py?at=default Accessing ctypes buffers or exposing ctypes buffers to Numpy is not a problem. Cheers Marcus
Hi Marcus,Is there a way to create a custom bf_releasebuffer function for a ctype object? When exporting an SDL_Surface pixel buffer using the 3118 (new) buffer interface, I would like the release callback to unlock the surface, rather than use a NumPy array's __del__ method.
Lenard