comparison pytouhou/ui/renderer.pxd @ 449:d56536ef28e8

Improve render_elements’ speed a lot, and fix it in some corner cases. Thanks liori!
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 03 Aug 2013 15:49:11 +0200
parents d8630c086926
children cae1ae9de430
comparison
equal deleted inserted replaced
448:3bc37791f0a2 449:d56536ef28e8
1 from cpython cimport PyObject
2
1 cdef struct Vertex: 3 cdef struct Vertex:
2 int x, y, z 4 int x, y, z
3 float u, v 5 float u, v
4 unsigned char r, g, b, a 6 unsigned char r, g, b, a
5 7
7 cdef class Renderer: 9 cdef class Renderer:
8 cdef public texture_manager 10 cdef public texture_manager
9 cdef unsigned int vbo 11 cdef unsigned int vbo
10 cdef Vertex *vertex_buffer 12 cdef Vertex *vertex_buffer
11 13
14 cdef unsigned short *indices[2][MAX_TEXTURES]
15 cdef unsigned short last_indices[2 * MAX_TEXTURES]
16 cdef PyObject *elements[640*3]
17
12 cpdef render_elements(self, elements) 18 cpdef render_elements(self, elements)