equal
deleted
inserted
replaced
75 |
75 |
76 int main(int argc, char *argv[]) |
76 int main(int argc, char *argv[]) |
77 { |
77 { |
78 SDL_Event event; |
78 SDL_Event event; |
79 int done; |
79 int done; |
|
80 Uint32 videoflags; |
80 |
81 |
81 /* Initialize SDL */ |
82 /* Initialize SDL */ |
82 if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { |
83 if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { |
83 fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError()); |
84 fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError()); |
84 exit(1); |
85 exit(1); |
85 } |
86 } |
86 atexit(SDL_Quit); |
87 atexit(SDL_Quit); |
87 |
88 |
|
89 videoflags = SDL_SWSURFACE; |
|
90 if ( strcmp(argv[1], "-fullscreen") == 0 ) { |
|
91 videoflags |= SDL_FULLSCREEN; |
|
92 } |
|
93 |
88 /* Set 640x480 video mode */ |
94 /* Set 640x480 video mode */ |
89 if ( SDL_SetVideoMode(640, 480, 0, SDL_SWSURFACE) == NULL ) { |
95 if ( SDL_SetVideoMode(640, 480, 0, videoflags) == NULL ) { |
90 fprintf(stderr, "Couldn't set 640x480 video mode: %s\n", |
96 fprintf(stderr, "Couldn't set 640x480 video mode: %s\n", |
91 SDL_GetError()); |
97 SDL_GetError()); |
92 exit(2); |
98 exit(2); |
93 } |
99 } |
94 |
100 |