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

Re: [pygame] Fullscreen + Hardware surface causes crash



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.