[SDL] SDL_Flip()

Sam Lantinga slouken at devolution.com
Fri Aug 6 09:23:29 PDT 1999


> OK, I know that SDL_Flip shows the double buffer.  Could somebody tell
> me how to draw to the double buffer?

The same way you draw to any other surface...

if ( SDL_MUSTLOCK(screen) ) {
	if ( SDL_LockSurface(screen) < 0 ) {
		return;
	}
}

dst = (Uint8 *)screen->pixels + y*screen->pitch + x*screen->format->BytesPerPixel;

*dst = 0;

if ( SDL_MUSTLOCK(screen) ) {
	SDL_UnlockSurface(screen);
}


	-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software
--
"Any sufficiently advanced bug is indistinguishable from a feature"
						 -- Rich Kulawiec 



More information about the SDL mailing list