Mercurial > touhou
comparison pytouhou/ui/gamerunner.pyx @ 435:878273a984c4
Improve Matrix representation, using float[16] instead of imbricated python lists.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 07 Aug 2013 11:34:40 +0200 |
parents | f41a26971a19 |
children | 43a8fed9a8d8 |
comparison
equal
deleted
inserted
replaced
434:18e4b121646b | 435:878273a984c4 |
---|---|
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) |
21 | 21 |
22 from pytouhou.utils.helpers import get_logger | 22 from pytouhou.utils.helpers import get_logger |
23 from pytouhou.utils.maths cimport perspective, setup_camera, ortho_2d | 23 from pytouhou.utils.maths cimport perspective, setup_camera, ortho_2d |
24 from pytouhou.utils.matrix cimport matrix_to_floats | 24 from pytouhou.utils.matrix cimport Matrix |
25 | 25 |
26 from .gamerenderer import GameRenderer | 26 from .gamerenderer import GameRenderer |
27 from .background import BackgroundRenderer | 27 from .background import BackgroundRenderer |
28 from .music import MusicPlayer, SFXPlayer, NullPlayer | 28 from .music import MusicPlayer, SFXPlayer, NullPlayer |
29 from .shaders.eosd import GameShader, BackgroundShader | 29 from .shaders.eosd import GameShader, BackgroundShader |
180 interface = self.game.interface | 180 interface = self.game.interface |
181 interface.labels['framerate'].set_text('%.2ffps' % self.window.clock.get_fps()) | 181 interface.labels['framerate'].set_text('%.2ffps' % self.window.clock.get_fps()) |
182 | 182 |
183 if self.use_fixed_pipeline: | 183 if self.use_fixed_pipeline: |
184 glMatrixMode(GL_MODELVIEW) | 184 glMatrixMode(GL_MODELVIEW) |
185 glLoadMatrixf(matrix_to_floats(self.interface_mvp)) | 185 glLoadMatrixf((<Matrix>self.interface_mvp).data) |
186 glDisable(GL_FOG) | 186 glDisable(GL_FOG) |
187 else: | 187 else: |
188 self.interface_shader.bind() | 188 self.interface_shader.bind() |
189 self.interface_shader.uniform_matrix('mvp', self.interface_mvp) | 189 self.interface_shader.uniform_matrix('mvp', self.interface_mvp) |
190 glViewport(0, 0, self.width, self.height) | 190 glViewport(0, 0, self.width, self.height) |