comparison eosd @ 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 346cbf266856
children
comparison
equal deleted inserted replaced
542:a09f6990eab4 543:fb837b32c3dd
64 64
65 import sys 65 import sys
66 import logging 66 import logging
67 67
68 if args.backend == 'opengl': 68 if args.backend == 'opengl':
69 from pytouhou.ui.opengl.gamerenderer import GameRenderer 69 try:
70 opengl = True 70 from pytouhou.ui.opengl.gamerenderer import GameRenderer
71 elif args.backend == 'sdl': 71 opengl = True
72 except ImportError:
73 args.backend = 'sdl'
74
75 if args.backend == 'sdl':
72 from pytouhou.ui.sdl.gamerenderer import GameRenderer 76 from pytouhou.ui.sdl.gamerenderer import GameRenderer
73 opengl = False 77 opengl = False
74 78
75 from pytouhou.lib.sdl import SDL, show_simple_message_box 79 from pytouhou.lib.sdl import SDL, show_simple_message_box
76 from pytouhou.ui.window import Window 80 from pytouhou.ui.window import Window