diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -89,6 +89,12 @@ void create_bullets() { //create_pattern2_2(100); } +bool fullscreen = false; +void toggle_fullscreen() { + fullscreen = !fullscreen; + SDL_SetVideoMode(640, 480, 0, SDL_OPENGL | SDL_GL_DOUBLEBUFFER | SDL_HWPALETTE | SDL_HWSURFACE | (fullscreen ? SDL_FULLSCREEN : 0)); +} + int main(int, char**) { if(SDL_Init(SDL_INIT_VIDEO) < 0) { fprintf(stderr, "Failed to initialize SDL: %s\n", SDL_GetError()); @@ -162,6 +168,9 @@ int main(int, char**) { paused = !paused; lasttick = SDL_GetTicks(); break; + case 'f': + toggle_fullscreen(); + break; default: break; } |