Mercurial > touhou
annotate pytouhou/ui/sdl/backend.pyx @ 590:e15672733c93
Switch to Python 3.x instead of 2.7.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 30 Sep 2014 17:14:24 +0200 |
parents | 0768122da817 |
children | 80687f258001 |
rev | line source |
---|---|
553
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
1 from pytouhou.lib cimport sdl |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
2 from pytouhou.lib.sdl cimport Window |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
3 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
4 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
5 GameRenderer = None |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
6 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
7 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
8 def init(_): |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
9 global GameRenderer |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
10 from pytouhou.ui.sdl.gamerenderer import GameRenderer |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
11 |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
12 |
589
0768122da817
Add a frameskip option, and use swap interval to implement it.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
553
diff
changeset
|
13 def create_window(title, x, y, width, height, _): |
553
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
14 window = Window(title, x, y, width, height, sdl.WINDOW_SHOWN) |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
15 window.create_renderer(0) |
8f51e34d911c
Refactor graphics backend selection, to make them fallbackable and optional.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
16 return window |