diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-05-17 13:15:27 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-05-17 13:15:27 +0200 |
commit | ad7de669ca9c3f4c5b428fdbeb05245fc8758657 (patch) | |
tree | 4051ff500f982ad0409c3b2e70cffddd54c550a6 | |
parent | c40b10c9b1f216e75a153b37c7987268a1a66b1e (diff) |
Added toggle_fullscreen()
-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; } |