[SDL] Why?

Neil Griffiths n.griffiths at virgin.net
Wed Sep 25 09:02:01 PDT 2002


AKK> SDL_Surface *SDL_SetVideoMode(640, 480, 24, SDL_FULLSCREEN|SDL_SURFACE);

You're trying to declare a function in main() which isn't a good idea.
I suspect what you want to do is:

SDL_Surface *screen = SDL_SetVideoMode(640, 480, 24, SDL_FULLSCREEN|SDL_SURFACE);

AKK> typedef struct SDL_Surface 
AKK> {
AKK>     Uint32 flags;
AKK>     SDL_PixelFormat *format;
AKK>     int w, h;
AKK>     Uint16 pitch;
AKK>     void *pixels;
AKK>     SDL_Rect clip_rect;
AKK>     int refcount;
AKK> } SDL_Surface;

If you're including the SDL header, you shouldn't need to do this.


More information about the SDL mailing list