comparison pytouhou/ui/opengl/renderer.pxd @ 513:5e3e0b09a531

Move the OpenGL backend to its own package.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 05 Dec 2013 02:16:31 +0100
parents pytouhou/ui/renderer.pxd@bfea9e9a6845
children b3193b43a86c
comparison
equal deleted inserted replaced
512:b39ad30c6620 513:5e3e0b09a531
1 from cpython cimport PyObject
2 from pytouhou.lib.opengl cimport GLuint
3 from .texture cimport TextureManager, FontManager
4
5 cdef struct Vertex:
6 int x, y, z
7 float u, v
8 unsigned char r, g, b, a
9
10
11 cdef struct PassthroughVertex:
12 int x, y
13 float u, v
14
15
16 cdef class Texture:
17 cdef GLuint texture
18 cdef unsigned short indices[2][65536]
19
20
21 cdef class Renderer:
22 cdef TextureManager texture_manager
23 cdef FontManager font_manager
24 cdef GLuint vbo, framebuffer_vbo
25 cdef Vertex vertex_buffer[MAX_ELEMENTS]
26 cdef long x, y, width, height
27
28 cdef bint use_fixed_pipeline #XXX
29
30 cdef unsigned short *indices[MAX_TEXTURES][2]
31 cdef unsigned short last_indices[2 * MAX_TEXTURES]
32 cdef PyObject *elements[640*3]
33
34 cdef void render_elements(self, elements) except *
35 cdef void render_quads(self, rects, colors, GLuint texture) except *
36 cdef void render_framebuffer(self, Framebuffer fb) except *
37
38
39 cdef class Framebuffer:
40 cdef GLuint fbo, texture, rbo
41 cdef int x, y, width, height
42
43 cpdef bind(self)