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

Re: [pygame] BufferProxy (was Flood Filling Images)



On, Wed Apr 16, 2008, Greg Ewing wrote:

> René Dudfield wrote:
> 
>> BufferProxy is not only usable from C - but from python too.
> 
> That's good to hear -- it sounded from what others were
> saying that it was a C-only thing.
> 
>> Also getting a buffer proxy helps with surface locking semantics.
>> When you get a BufferProxy the surface is locked (which you need to do
>> when you are modifying Surface->pixels - when the BufferProxy is
>> destroyed, the surface lock is released.
> 
> That's a good reason. Although the new buffer protocol
> has locking facilities built in, so it wouldn't strictly
> be needed then.

It needs the locking due to the SDL limitations regarding the
availability of the surface pixels. This will keep it consistent with
the rest of the pygame/SDL code which locks the SDL surfaces whereever
the pixels are directly accessed.

Regards
Marcus

Attachment: pgpfXeKFTkfD5.pgp
Description: PGP signature