Init SDL video subsystem separately, as part of video_init
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Tue, 19 May 2009 23:43:06 +0000 (23:43 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Tue, 19 May 2009 23:43:06 +0000 (23:43 +0000)
git-svn-id: https://s.snth.net/svn/neverball/trunk@2859 78b8d119-cf0a-0410-b17c-f493084dd1d7

ball/main.c
putt/main.c
share/video.c

index 4712400..d630b8d 100644 (file)
@@ -365,7 +365,7 @@ int main(int argc, char *argv[])
 
     /* Initialize SDL system and subsystems */
 
-    if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK) == -1)
+    if (SDL_Init(SDL_INIT_AUDIO | SDL_INIT_JOYSTICK) == -1)
     {
         fprintf(stderr, "%s\n", SDL_GetError());
         return 1;
index 6a7dbba..6c0c415 100644 (file)
@@ -202,7 +202,7 @@ int main(int argc, char *argv[])
     {
         if (config_user_path(NULL))
         {
-            if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK) == 0)
+            if (SDL_Init(SDL_INIT_AUDIO | SDL_INIT_JOYSTICK) == 0)
             {
                 config_init();
                 config_load();
index ac48dad..b382585 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);