[SDL] new empty surface

Jonathan Atkins jcatki at jcatki.no-ip.org
Tue Jul 9 02:38:00 PDT 2002


nwagenaar at digitaldynamics.nl wrote:

> Hi Mirko,
> 
> allthough SDL_CreateRGBSurface seems to be complicated, it's the
> function you require to make a new empty surface :
> 
> menu = SDL_CreateRGBSurface(
> 			SDL_SWSURFACE,
> 			100, 50, // Sizes
>  			16,      // BPP
> #if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
> 			0x000000FF, 
> 			0x0000FF00, 
> 			0x00FF0000, 
> 			0xFF000000);
> #else
> 			0xFF000000,
> 			0x00FF0000, 
> 			0x0000FF00, 
> 			0x000000FF);
> #endif
> 
> Voila! A new SDL_Surface named menu. This should do for you :)
> 
> Regards,
> 
> Niels Wagenaar

except that this is not the optimal solution, Chris Thielen had the optimal solution.
it's faster to blit a surface that is already in display format...of course.

-- 
              -=<Long Island Man>=-
                    Jon Atkins
              http://jonatkins.org/





More information about the SDL mailing list