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

Re: [pygame] PixelArray question



Greg Ewing wrote:
Lenard Lindstrom wrote:
But for surface locking to work properly a PixelArray object must keep the surface locked while the object is alive.

I'm not sure what the problem is here. The new buffer
protocol allows for the object to lock itself when
a buffer is requested, and unlock itself when the
buffer is released. As long as the PixelArray follows
this procedure properly, it should work in fine with
surface locking, shouldn't it?

Note that the PixelArray should *not* be keeping the
surface locked all the time. It should be locking the
surface when someone requests a buffer interface from
it, and unlocking the surface when that buffer interface
is released. Users of the buffer protocol are not
supposed to hold onto their buffers for longer than
necessary.


New buffer protocol? How new? The buffer interface in the Pygame 2.5 documents is the same as 2.4. There is no buffer release mechanism that I can see. If there is then that is exactly what is needed.

--
Lenard Lindstrom
<len-l@xxxxxxxxx>