Mercurial > touhou
comparison pytouhou/ui/gamerunner.py @ 394:346614f788f1
Replace gl{Vertex,TexCoord,Color}Pointer with the more modern glVertexAttribPointer.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 06 Feb 2013 20:57:16 +0100 |
parents | e1f5dcd4b83e |
children | 34a91f918e7c |
comparison
equal
deleted
inserted
replaced
393:9e2cbb2c2c64 | 394:346614f788f1 |
---|---|
93 if (width, height) != (self.width, self.height): | 93 if (width, height) != (self.width, self.height): |
94 self.set_size(width, height) | 94 self.set_size(width, height) |
95 | 95 |
96 # Initialize OpenGL | 96 # Initialize OpenGL |
97 glEnable(GL_BLEND) | 97 glEnable(GL_BLEND) |
98 glEnable(GL_TEXTURE_2D) | 98 if self.use_fixed_pipeline: |
99 glHint(GL_FOG_HINT, GL_NICEST) | 99 glEnable(GL_TEXTURE_2D) |
100 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST) | 100 glHint(GL_FOG_HINT, GL_NICEST) |
101 glEnableClientState(GL_COLOR_ARRAY) | 101 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST) |
102 glEnableClientState(GL_VERTEX_ARRAY) | 102 glEnableClientState(GL_COLOR_ARRAY) |
103 glEnableClientState(GL_TEXTURE_COORD_ARRAY) | 103 glEnableClientState(GL_VERTEX_ARRAY) |
104 glEnableClientState(GL_TEXTURE_COORD_ARRAY) | |
104 | 105 |
105 self.proj = self.perspective(30, float(self.game.width) / float(self.game.height), | 106 self.proj = self.perspective(30, float(self.game.width) / float(self.game.height), |
106 101010101./2010101., 101010101./10101.) | 107 101010101./2010101., 101010101./10101.) |
107 game_view = self.setup_camera(0, 0, 1) | 108 game_view = self.setup_camera(0, 0, 1) |
108 self.game_mvp = game_view * self.proj | 109 self.game_mvp = game_view * self.proj |