diff pytouhou/ui/sdl/backend.pyx @ 553:8f51e34d911c

Refactor graphics backend selection, to make them fallbackable and optional.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 29 May 2014 12:31:55 +0200
parents
children 0768122da817
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/pytouhou/ui/sdl/backend.pyx
@@ -0,0 +1,16 @@
+from pytouhou.lib cimport sdl
+from pytouhou.lib.sdl cimport Window
+
+
+GameRenderer = None
+
+
+def init(_):
+    global GameRenderer
+    from pytouhou.ui.sdl.gamerenderer import GameRenderer
+
+
+def create_window(title, x, y, width, height):
+    window = Window(title, x, y, width, height, sdl.WINDOW_SHOWN)
+    window.create_renderer(0)
+    return window