comparison pytouhou/ui/renderer.pyx @ 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 690b5faaa0e6
children 346614f788f1
comparison
equal deleted inserted replaced
392:45e1a9a37e66 393:9e2cbb2c2c64
87 glColorPointer(4, GL_UNSIGNED_BYTE, 24, <long> &self.vertex_buffer[0].r) 87 glColorPointer(4, GL_UNSIGNED_BYTE, 24, <long> &self.vertex_buffer[0].r)
88 88
89 nb_indices = len(indices) 89 nb_indices = len(indices)
90 indices = pack(str(nb_indices) + 'H', *indices) 90 indices = pack(str(nb_indices) + 'H', *indices)
91 glBlendFunc(GL_SRC_ALPHA, (GL_ONE_MINUS_SRC_ALPHA, GL_ONE)[blendfunc]) 91 glBlendFunc(GL_SRC_ALPHA, (GL_ONE_MINUS_SRC_ALPHA, GL_ONE)[blendfunc])
92 glBindTexture(GL_TEXTURE_2D, self.texture_manager[texture_key].id) 92 glBindTexture(GL_TEXTURE_2D, self.texture_manager[texture_key])
93 glDrawElements(GL_TRIANGLES, nb_indices, GL_UNSIGNED_SHORT, indices) 93 glDrawElements(GL_TRIANGLES, nb_indices, GL_UNSIGNED_SHORT, indices)
94 94
95 95
96 cpdef ortho_2d(self, left, right, bottom, top): 96 cpdef ortho_2d(self, left, right, bottom, top):
97 mat = Matrix() 97 mat = Matrix()