comparison pytouhou/ui/gamerenderer.py @ 393:9e2cbb2c2c64

Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 06 Feb 2013 19:55:54 +0100
parents 84b151962708
children 346614f788f1
comparison
equal deleted inserted replaced
392:45e1a9a37e66 393:9e2cbb2c2c64
100 self.background_shader.uniform_matrixf('projection', self.proj.get_c_data()) 100 self.background_shader.uniform_matrixf('projection', self.proj.get_c_data())
101 101
102 glEnable(GL_DEPTH_TEST) 102 glEnable(GL_DEPTH_TEST)
103 for (texture_key, blendfunc), (nb_vertices, vertices, uvs, colors) in get_background_rendering_data(back): 103 for (texture_key, blendfunc), (nb_vertices, vertices, uvs, colors) in get_background_rendering_data(back):
104 glBlendFunc(GL_SRC_ALPHA, (GL_ONE_MINUS_SRC_ALPHA, GL_ONE)[blendfunc]) 104 glBlendFunc(GL_SRC_ALPHA, (GL_ONE_MINUS_SRC_ALPHA, GL_ONE)[blendfunc])
105 glBindTexture(GL_TEXTURE_2D, texture_manager[texture_key].id) 105 glBindTexture(GL_TEXTURE_2D, texture_manager[texture_key])
106 glVertexPointer(3, GL_FLOAT, 0, vertices) 106 glVertexPointer(3, GL_FLOAT, 0, vertices)
107 glTexCoordPointer(2, GL_FLOAT, 0, uvs) 107 glTexCoordPointer(2, GL_FLOAT, 0, uvs)
108 glColorPointer(4, GL_UNSIGNED_BYTE, 0, colors) 108 glColorPointer(4, GL_UNSIGNED_BYTE, 0, colors)
109 glDrawArrays(GL_QUADS, 0, nb_vertices) 109 glDrawArrays(GL_QUADS, 0, nb_vertices)
110 glDisable(GL_DEPTH_TEST) 110 glDisable(GL_DEPTH_TEST)