[SDL] SDL_DisplayFormat before SDL_VideoInit

Torsten Giebl wizard at syntheticsw.com
Thu Jan 4 05:26:40 PST 2007


Hello !


> SDL_Surface *surface = SDL_DisplayFormat (image)
> if (surface == NULL) exit() … … SDL_VideoInit(…)


What should these two lines of code do ?

If you want to have your surface pointer set to
NULL from the start do this :

SDL_Surface *surface = NULL;

After this you can then call SDL_Init (SDL_INIT_VIDEO)
then use SDL_SetVideoMode and so on.

For a better understanding what you need to do,
look at the examples that come with SDL, like the testsprite.


CU





More information about the SDL mailing list