full screen
authorThomas Pietrzak <thomas.pietrzak@gmail.com>
Thu, 5 May 2011 19:36:30 +0000 (19:36 +0000)
committerThomas Pietrzak <thomas.pietrzak@gmail.com>
Thu, 5 May 2011 19:36:30 +0000 (19:36 +0000)
git-svn-id: svn+ssh://thomaspietrzak.com/var/svn/rep@11 47cf9a05-e0a8-4ed5-9e9b-101a649bc004

src/PaintGame.cpp

index a64f16758b9ec839218b4b3a13d723e9251ac55d..8e89292bf085be4c9d447232df29303c8cb74b3a 100644 (file)
@@ -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;
-               }
+               }*/
        }
   \r
 #if 0//SDL_VERSION_ATLEAST(1,3,0)\r
@@ -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);