summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}