shithub: choc

Download patch

ref: 710e6b12d1b1bf11b2edd09100a964b7ca9dd053
parent: 5e8e8170e74fe7476cf65316ef4006011fbf7ad1
author: Simon Howard <fraggle@gmail.com>
date: Tue Oct 15 00:01:46 EDT 2013

Rip out special casing on Windows that defaults to the SDL directx
driver over the Windows GDI one. This causes far too many problems.

Subversion-branch: /branches/v2-branch
Subversion-revision: 2710

--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1851,36 +1851,6 @@
         putenv(env_string);
         free(env_string);
     }
-
-#if defined(_WIN32) && !defined(_WIN32_WCE)
-
-    // Allow -gdi as a shortcut for using the windib driver.
-
-    //!
-    // @category video 
-    // @platform windows
-    //
-    // Use the Windows GDI driver instead of DirectX.
-    //
-
-    if (M_CheckParm("-gdi") > 0)
-    {
-        putenv("SDL_VIDEODRIVER=windib");
-    }
-
-    // From the SDL 1.2.10 release notes: 
-    //
-    // > The "windib" video driver is the default now, to prevent 
-    // > problems with certain laptops, 64-bit Windows, and Windows 
-    // > Vista. 
-    //
-    // The hell with that.
-
-    if (getenv("SDL_VIDEODRIVER") == NULL)
-    {
-        putenv("SDL_VIDEODRIVER=directx");
-    }
-#endif
 }
 
 static void SetWindowPositionVars(void)
--- a/src/setup/display.c
+++ b/src/setup/display.c
@@ -155,14 +155,6 @@
         putenv(env_string);
         free(env_string);
     }
-    else
-    {
-#if defined(_WIN32) && !defined(_WIN32_WCE)
-        // On Windows, use DirectX over windib by default.
-
-        putenv("SDL_VIDEODRIVER=directx");
-#endif
-    }
 }
 
 // Query SDL as to whether any fullscreen modes are available for the
@@ -540,54 +532,6 @@
     }
 }
 
-#if defined(_WIN32) && !defined(_WIN32_WCE)
-
-static int use_directx = 1;
-
-static void SetWin32VideoDriver(void)
-{
-    if (!strcmp(video_driver, "windib"))
-    {
-        use_directx = 0;
-    }
-    else
-    {
-        use_directx = 1;
-    }
-}
-
-static void UpdateVideoDriver(TXT_UNCAST_ARG(widget), 
-                              TXT_UNCAST_ARG(modes_table))
-{
-    TXT_CAST_ARG(txt_table_t, modes_table);
-
-    if (use_directx)
-    {
-        video_driver = "";
-    }
-    else
-    {
-        video_driver = "windib";
-    }
-
-    // When the video driver is changed, we need to restart the textscreen 
-    // library.
-
-    RestartTextscreen();
-
-    // Rebuild the list of supported pixel depths.
-
-    IdentifyPixelDepths();
-    SetSelectedBPP();
-
-    // Rebuild the video modes list
-
-    BuildFullscreenModesList();
-    GenerateModesTable(NULL, modes_table);
-}
-
-#endif
-
 static void AdvancedDisplayConfig(TXT_UNCAST_ARG(widget),
                                   TXT_UNCAST_ARG(modes_table))
 {
@@ -618,29 +562,6 @@
     }
 
     TXT_SignalConnect(ar_checkbox, "changed", GenerateModesTable, modes_table);
-
-    // On Windows, there is an extra control to change between 
-    // the Windows GDI and DirectX video drivers.
-
-#if defined(_WIN32) && !defined(_WIN32_WCE)
-    {
-        txt_radiobutton_t *dx_button, *gdi_button;
-
-        TXT_AddWidgets(window,
-                       TXT_NewSeparator("Windows video driver"),
-                       dx_button = TXT_NewRadioButton("DirectX",
-                                                      &use_directx, 1),
-                       gdi_button = TXT_NewRadioButton("Windows GDI",
-                                                       &use_directx, 0),
-                       NULL);
-
-        TXT_SignalConnect(dx_button, "selected",
-                          UpdateVideoDriver, modes_table);
-        TXT_SignalConnect(gdi_button, "selected",
-                          UpdateVideoDriver, modes_table);
-        SetWin32VideoDriver();
-    }
-#endif
 }
 
 void ConfigDisplay(void)