comparison pytouhou/ui/gamerunner.pyx @ 427:0604f4fbbe3c

Move the depth buffer clear outside of scissor, as per apitrace’s advice.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 03 Aug 2013 15:48:51 +0200
parents 5d7bb2fd74f7
children f41a26971a19
comparison
equal deleted inserted replaced
426:5d7bb2fd74f7 427:0604f4fbbe3c
15 from pytouhou.lib import sdl 15 from pytouhou.lib import 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) 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_to_floats
25 25
160 def render_game(self): 160 def render_game(self):
161 # Switch to game projection 161 # Switch to game projection
162 #TODO: move that to GameRenderer? 162 #TODO: move that to GameRenderer?
163 x, y = self.game.interface.game_pos 163 x, y = self.game.interface.game_pos
164 glViewport(x, y, self.game.width, self.game.height) 164 glViewport(x, y, self.game.width, self.game.height)
165 glClear(GL_DEPTH_BUFFER_BIT)
165 glScissor(x, y, self.game.width, self.game.height) 166 glScissor(x, y, self.game.width, self.game.height)
166 glEnable(GL_SCISSOR_TEST) 167 glEnable(GL_SCISSOR_TEST)
167 168
168 GameRenderer.render(self) 169 GameRenderer.render(self)
169 170