share/video: move buffer setup from video_init to video_mode
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Tue, 19 May 2009 23:42:57 +0000 (23:42 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Tue, 19 May 2009 23:42:57 +0000 (23:42 +0000)
git-svn-id: https://s.snth.net/svn/neverball/trunk@2858 78b8d119-cf0a-0410-b17c-f493084dd1d7

share/video.c

index 01fac31..ac48dad 100644 (file)
 
 int video_init(const char *title, const char *icon)
 {
-    /* Require 16-bit double buffer with 16-bit depth buffer. */
-
-    SDL_GL_SetAttribute(SDL_GL_RED_SIZE,     5);
-    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,   5);
-    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE,    5);
-    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE,  16);
-    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
-
     /* This has to happen before mode setting... */
 
     set_SDL_icon(icon);
@@ -88,6 +80,14 @@ int video_mode(int f, int w, int h)
     SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, samples);
     SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL,       vsync);
 
+    /* Require 16-bit double buffer with 16-bit depth buffer. */
+
+    SDL_GL_SetAttribute(SDL_GL_RED_SIZE,     5);
+    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,   5);
+    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE,    5);
+    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE,  16);
+    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+
     /* Try to set the currently specified mode. */
 
     if (SDL_SetVideoMode(w, h, 0, SDL_OPENGL | (f ? SDL_FULLSCREEN : 0)))