Skip to content

Commit

Permalink
Added a -fullscreen flag
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 25, 2002
1 parent 0b231da commit 2ee0a67
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/checkkeys.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ int main(int argc, char *argv[])
{ {
SDL_Event event; SDL_Event event;
int done; int done;
Uint32 videoflags;


/* Initialize SDL */ /* Initialize SDL */
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
Expand All @@ -85,8 +86,13 @@ int main(int argc, char *argv[])
} }
atexit(SDL_Quit); atexit(SDL_Quit);


videoflags = SDL_SWSURFACE;
if ( strcmp(argv[1], "-fullscreen") == 0 ) {
videoflags |= SDL_FULLSCREEN;
}

/* Set 640x480 video mode */ /* Set 640x480 video mode */
if ( SDL_SetVideoMode(640, 480, 0, SDL_SWSURFACE) == NULL ) { if ( SDL_SetVideoMode(640, 480, 0, videoflags) == NULL ) {
fprintf(stderr, "Couldn't set 640x480 video mode: %s\n", fprintf(stderr, "Couldn't set 640x480 video mode: %s\n",
SDL_GetError()); SDL_GetError());
exit(2); exit(2);
Expand Down

0 comments on commit 2ee0a67

Please sign in to comment.