SDL_LockSurface needed for SDL_BlitSurface

Hi!

I’m new to SDL and have a newbie question: The manual tells me that I have
to call SDL_LockSurface() before accessing Surface->pixels. Checked.

But do I have to call SDL_LockSurface() before calling SDL_BlitSurface() or
SDL_FillRect() ??

thx
Andreas

Hi!

I’m new to SDL and have a newbie question: The manual tells me that I have
to call SDL_LockSurface() before accessing Surface->pixels. Checked.

But do I have to call SDL_LockSurface() before calling SDL_BlitSurface() or
SDL_FillRect() ??

The reverse is true, you are not allowed to blit to a locked surface.

JamesOn Tue, 06 Apr 2004 21:44:43 +0200, Andreas Hammerschmidt wrote:

“Andreas Hammerschmidt” <Online.Player at gmx.net> wrote:

But do I have to call SDL_LockSurface() before calling
SDL_BlitSurface() or SDL_FillRect() ??

no. just when directly writing to the pixel data within the surface
struct.

clemens