From 6fef7353c9b3a45c0e520f1db26e5b346d90a4af Mon Sep 17 00:00:00 2001 From: Thomas Pietrzak Date: Thu, 5 May 2011 19:36:30 +0000 Subject: [PATCH] full screen git-svn-id: svn+ssh://thomaspietrzak.com/var/svn/rep@11 47cf9a05-e0a8-4ed5-9e9b-101a649bc004 --- src/PaintGame.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/PaintGame.cpp b/src/PaintGame.cpp index a64f167..8e89292 100644 --- a/src/PaintGame.cpp +++ b/src/PaintGame.cpp @@ -65,7 +65,7 @@ void init() int searchflags = SDL_HWSURFACE;// | SDL_FULLSCREEN; SDL_Rect **modes = SDL_ListModes(NULL, searchflags); if (modes == NULL) - throw "Impossible to get the screen resolution !"; + throw "Impossible to get the screen resolution !"; else if (modes == (SDL_Rect **)-1) { resolution_x = 1280; @@ -74,22 +74,24 @@ void init() else { int i; + resolution_x = 1024; + resolution_y = 768; for (i=0 ; modes[i] ; i++) { cout << "Resolution available: " << modes[i]->w << "x" << modes[i]->h << endl; - if (modes[i]->w == 1280 && modes[i]->h == 1024) + if (modes[i]->w > resolution_x)//== 1280 && modes[i]->h == 1024) { - resolution_x = modes[i]->w; - resolution_y = modes[i]->h; - break; + resolution_x = modes[i]->w; + resolution_y = modes[i]->h; + //break; } } - if (!modes[i]) +/* if (!modes[i]) { cout << "Resolution wanted not available" << endl; resolution_x = 1024; resolution_y = 768; - } + }*/ } #if 0//SDL_VERSION_ATLEAST(1,3,0) @@ -129,7 +131,7 @@ void init() SDL_GL_SetAttribute(SDL_GL_ACCUM_BLUE_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_ACCUM_ALPHA_SIZE, 8); - int flags = SDL_OPENGL | SDL_OPENGL | SDL_HWSURFACE;// | SDL_FULLSCREEN; + int flags = SDL_OPENGL | SDL_OPENGL | SDL_HWSURFACE | SDL_FULLSCREEN; glEnable(GL_MULTISAMPLE); -- 2.30.2