1. pygame
  2. pygame
  3. pygame

Commits

illume  committed 6a14b31

set directx as default driver for old versions of windows.

  • Participants
  • Parent commits 8764b9c
  • Branches default

Comments (0)

Files changed (1)

File lib/__init__.py

View file
  • Ignore whitespace
 if sys.platform == 'darwin':
     _check_darwin()
 
+
+# check if is old windows... if so use directx video driver by default.
+try:
+    import platform
+except:
+    platform = None
+
+# see if we can set directx as default video for older versions of windows.
+if platform and platform.system() in ["Windows"]:
+    # if someone sets this respect their setting...
+    if not os.environ.get('SDL_VIDEODRIVER', ''):
+        # http://docs.python.org/lib/module-sys.html
+        # 0 (VER_PLATFORM_WIN32s) 	Win32s on Windows 3.1
+        # 1 (VER_PLATFORM_WIN32_WINDOWS) 	Windows 95/98/ME
+        # 2 (VER_PLATFORM_WIN32_NT) 	Windows NT/2000/XP
+        # 3 (VER_PLATFORM_WIN32_CE) 	Windows CE
+        if sys.getwindowsversion()[3] in [1,2]:
+            os.environ['SDL_VIDEODRIVER'] = 'directx'
+
+
+
 class MissingModule:
     def __init__(self, name, info='', urgent=0):
         self.name = name