summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-05-17 13:15:27 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-05-17 13:15:27 +0200
commitad7de669ca9c3f4c5b428fdbeb05245fc8758657 (patch)
tree4051ff500f982ad0409c3b2e70cffddd54c550a6 /main.cpp
parentc40b10c9b1f216e75a153b37c7987268a1a66b1e (diff)
Added toggle_fullscreen()
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 7cba083..eb1cd92 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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;
}