foxygit / doom Log in
commit d0d6c7293373af193bc99989e64f1d5eadba4f31
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Mon Nov 6 18:04:26 2006 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Mon Nov 6 18:04:26 2006 +0000

    Use DirectX by default on Windows.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 747
---
 src/i_video.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/i_video.c b/src/i_video.c
index 469b113d..fe3ab980 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1046,6 +1046,23 @@ void I_InitGraphics(void)
     SDL_Event dummy;
     int flags = 0;

+#ifdef _WIN32
+
+    // 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 (SDL_getenv("SDL_VIDEODRIVER") == NULL)
+    {
+        SDL_putenv("SDL_VIDEODRIVER=directx");
+    }
+
+#endif
+
     if (SDL_Init(SDL_INIT_VIDEO) < 0)
     {
         I_Error("Failed to initialise video: %s", SDL_GetError());