comparison pytouhou/ui/renderer.pxd @ 505:bfea9e9a6845

Manage the texture-specific indices in the Texture, and some more renderer optimisations.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 01 Nov 2013 14:45:53 +0100
parents c622eaf64428
children
comparison
equal deleted inserted replaced
504:69c73023f7a0 505:bfea9e9a6845
1 from cpython cimport PyObject 1 from cpython cimport PyObject
2 from pytouhou.lib.opengl cimport GLuint 2 from pytouhou.lib.opengl cimport GLuint
3 from .texture cimport TextureManager, FontManager
3 4
4 cdef struct Vertex: 5 cdef struct Vertex:
5 int x, y, z 6 int x, y, z
6 float u, v 7 float u, v
7 unsigned char r, g, b, a 8 unsigned char r, g, b, a
10 cdef struct PassthroughVertex: 11 cdef struct PassthroughVertex:
11 int x, y 12 int x, y
12 float u, v 13 float u, v
13 14
14 15
16 cdef class Texture:
17 cdef GLuint texture
18 cdef unsigned short indices[2][65536]
19
20
15 cdef class Renderer: 21 cdef class Renderer:
16 cdef public texture_manager, font_manager 22 cdef TextureManager texture_manager
23 cdef FontManager font_manager
17 cdef GLuint vbo, framebuffer_vbo 24 cdef GLuint vbo, framebuffer_vbo
18 cdef Vertex *vertex_buffer 25 cdef Vertex vertex_buffer[MAX_ELEMENTS]
19 cdef long x, y, width, height 26 cdef long x, y, width, height
20 27
21 cdef bint use_fixed_pipeline #XXX 28 cdef bint use_fixed_pipeline #XXX
22 29
23 cdef unsigned short *indices[2][MAX_TEXTURES] 30 cdef unsigned short *indices[MAX_TEXTURES][2]
24 cdef unsigned short last_indices[2 * MAX_TEXTURES] 31 cdef unsigned short last_indices[2 * MAX_TEXTURES]
25 cdef PyObject *elements[640*3] 32 cdef PyObject *elements[640*3]
26 33
27 cdef void render_elements(self, elements) except * 34 cdef void render_elements(self, elements) except *
28 cdef void render_quads(self, rects, colors, texture) except * 35 cdef void render_quads(self, rects, colors, GLuint texture) except *
29 cdef void render_framebuffer(self, Framebuffer fb) except * 36 cdef void render_framebuffer(self, Framebuffer fb) except *
30 37
31 38
32 cdef class Framebuffer: 39 cdef class Framebuffer:
33 cdef GLuint fbo, texture, rbo 40 cdef GLuint fbo, texture, rbo