share/gui: don't use less of widget width for truncation than available
[neverball] / share / video.c
index ac48dad..0e970d7 100644 (file)
 
 int video_init(const char *title, const char *icon)
 {
+    SDL_QuitSubSystem(SDL_INIT_VIDEO);
+
+    if (SDL_InitSubSystem(SDL_INIT_VIDEO) == -1)
+    {
+        fprintf(stderr, "%s\n", SDL_GetError());
+        return 0;
+    }
+
     /* This has to happen before mode setting... */
 
     set_SDL_icon(icon);
@@ -113,14 +121,6 @@ int video_mode(int f, int w, int h)
         glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
         glDepthFunc(GL_LEQUAL);
 
-        /*
-         * Mac OS X might still need this, because apparently SDL doesn't do
-         * SDL_GL_SWAP_CONTROL on OS X.  TODO: investigate.
-         */
-#if 0
-        if (vsync) sync_init();
-#endif
-
         /* If GL supports multisample, and SDL got a multisample buffer... */
 
 #ifdef GL_ARB_multisample
@@ -132,6 +132,8 @@ int video_mode(int f, int w, int h)
         }
 #endif
 
+        glReadBuffer(GL_FRONT);
+
         return 1;
     }