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

Re: [pygame] Fullscreen + Hardware surface causes crash



just another note... there was a bug(fixed in cvs) with the surfarray
functions to do with locking.  As a work around, unlock the surface
when you have cleaned up any references to it as well.  It is ok to
unlock a surface multiple times, even if unlocked already.



On 2/9/06, Peter Shinners <pete@xxxxxxxxxxxx> wrote:
> On Wed, 2006-02-08 at 08:56 +0100, Andreas Røsdal wrote:
> > What is the proper way to blit to a locked hardware display surface?
>
> Ah, well that is what locked means, it disables all hardware access to
> the Surface. What you need to do is unlock the surface before blitting.
>
> I assume you are not calling Surface.lock() anywhere yourself. If so it
> must be paired with a Surface.unlock() when you are finished with your
> access.
>
> The only other likely suspect would be the use of the 'pixels' functions
> in surfarray. These arrays directly reference the Surface pixel data,
> and keep the Surface locked during the lifetime of the array. Make sure
> these pixel arraysare getting cleaned up when you are done with them. If
> you want to keep long term arrays switch to using the 'array' versions
> of the functions, which make independent copies of the data.
>
>
>