Mercurial > touhou
comparison pytouhou/ui/window.pyx @ 635:80687f258001
Make sdl.Window inherit from gui.Window, so we can swap implementations.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 14 Apr 2016 21:18:03 +0100 |
parents | a6af3ff86612 |
children |
comparison
equal
deleted
inserted
replaced
634:5270c34b4c00 | 635:80687f258001 |
---|---|
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 ## GNU General Public License for more details. | 12 ## GNU General Public License for more details. |
13 ## | 13 ## |
14 | 14 |
15 cimport cython | 15 cimport cython |
16 | |
17 cimport pytouhou.lib.sdl as sdl | |
16 | 18 |
17 | 19 |
18 cdef class Clock: | 20 cdef class Clock: |
19 def __init__(self, long fps=-1): | 21 def __init__(self, long fps=-1): |
20 self._target_fps = 0 | 22 self._target_fps = 0 |
128 return running | 130 return running |
129 | 131 |
130 | 132 |
131 cdef double get_fps(self) nogil: | 133 cdef double get_fps(self) nogil: |
132 return self.clock.fps | 134 return self.clock.fps |
135 | |
136 | |
137 cdef list get_events(self): | |
138 return self.win.get_events() | |
139 | |
140 | |
141 cdef int get_keystate(self) nogil: | |
142 return self.win.get_keystate() | |
143 | |
144 | |
145 cdef void toggle_fullscreen(self) nogil: | |
146 self.win.toggle_fullscreen() |