changeset 543:fb837b32c3dd

Automatically fallback on the SDL renderer if the OpenGL one can’t be imported.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 10 May 2014 23:40:13 +0200
parents a09f6990eab4
children b895ed2de71f
files eosd
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/eosd
+++ b/eosd
@@ -66,9 +66,13 @@ import sys
 import logging
 
 if args.backend == 'opengl':
-    from pytouhou.ui.opengl.gamerenderer import GameRenderer
-    opengl = True
-elif args.backend == 'sdl':
+    try:
+        from pytouhou.ui.opengl.gamerenderer import GameRenderer
+        opengl = True
+    except ImportError:
+        args.backend = 'sdl'
+
+if args.backend == 'sdl':
     from pytouhou.ui.sdl.gamerenderer import GameRenderer
     opengl = False