[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] new buffer code from Lenard



Hi,

I've been wanting to add new buffer protocol support to Pygame for awhile now. It includes a release mechanism which is needed for unlocking a surface when a buffer view is no longer needed. Previously, the surface lock could only be released when its BufferProxy view was garbage collected. It relied on the prompt object reclamation possible with CPython's reference counting memory management. It is unworkable with garbage collection based interpreters, such as PyPy. With the introduction of Python 3.3, the new buffer protocol finally became stable, and usable. Hopefully the new protocol will let Pygame interact more cleanly with other Python packages.

The array interface -- http://http://docs.scipy.org/doc/numpy/reference/arrays.interface.html -- remains for legacy reasons: Python 2.5 lacks new buffer support. I find no reason to deprecate it, but also no need to maintain it beyond bug fixes.

Since I only make 32bit builds on an Intel based machine, the code badly needs testing in 64bit mode and with big-endian processors. So any help in this area is appreciated. For anyone maintaining an existing Pygame build, a complete rebuild from the config.py stage is necessary. The code changes basically affect anything using NumPy.

Thanks, and enjoy,

Lenard Lindstrom

On 13-06-19 01:04 AM, René Dudfield wrote:
Hellos,

Lenard made some new buffer improvements to pygame. If anyone has time to test it with their apps that would be cool. Just installing it from source, and seeing if your app still works ok. Especially if you use any of the buffer related code directly.

https://bitbucket.org/pygame/pygame/