comparison pytouhou/ui/gamerunner.pyx @ 455:6864a38b2413

Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 02 Sep 2013 22:16:38 +0200
parents 43a8fed9a8d8
children cae1ae9de430
comparison
equal deleted inserted replaced
454:a502887557ac 455:6864a38b2413
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of 10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
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 from pytouhou.lib import sdl 15 from pytouhou.lib cimport sdl
16 16
17 from pytouhou.lib.opengl cimport \ 17 from pytouhou.lib.opengl cimport \
18 (glMatrixMode, glEnable, glDisable, glViewport, glScissor, 18 (glMatrixMode, glEnable, glDisable, glViewport, glScissor,
19 glLoadMatrixf, glGenBuffers, glDeleteBuffers, GL_MODELVIEW, 19 glLoadMatrixf, glGenBuffers, glDeleteBuffers, GL_MODELVIEW,
20 GL_FOG, GL_SCISSOR_TEST, glClear, GL_DEPTH_BUFFER_BIT) 20 GL_FOG, GL_SCISSOR_TEST, glClear, GL_DEPTH_BUFFER_BIT)
177 177
178 178
179 def render_interface(self): 179 def render_interface(self):
180 elements = [] 180 elements = []
181 interface = self.game.interface 181 interface = self.game.interface
182 interface.labels['framerate'].set_text('%.2ffps' % self.window.clock.get_fps()) 182 interface.labels['framerate'].set_text('%.2ffps' % self.window.get_fps())
183 183
184 if self.use_fixed_pipeline: 184 if self.use_fixed_pipeline:
185 glMatrixMode(GL_MODELVIEW) 185 glMatrixMode(GL_MODELVIEW)
186 glLoadMatrixf((<Matrix>self.interface_mvp).data) 186 glLoadMatrixf((<Matrix>self.interface_mvp).data)
187 glDisable(GL_FOG) 187 glDisable(GL_FOG)