comparison pytouhou/ui/renderer.pxd @ 462:a71b912b45b7

Render to framebuffers first, and reposition some interface elements in the game area.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 11 Sep 2013 00:36:50 +0200
parents 1b56d62250ab
children 36bc577b2392
comparison
equal deleted inserted replaced
461:6af3854ed826 462:a71b912b45b7
1 from cpython cimport PyObject 1 from cpython cimport PyObject
2 from pytouhou.lib.opengl cimport GLuint
2 3
3 cdef struct Vertex: 4 cdef struct Vertex:
4 int x, y, z 5 int x, y, z
5 float u, v 6 float u, v
6 unsigned char r, g, b, a 7 unsigned char r, g, b, a
7 8
8 9
10 cdef struct PassthroughVertex:
11 int x, y
12 float u, v
13
14
9 cdef class Renderer: 15 cdef class Renderer:
10 cdef public texture_manager, font_manager 16 cdef public texture_manager, font_manager
11 cdef unsigned int vbo 17 cdef GLuint vbo, framebuffer_vbo
12 cdef Vertex *vertex_buffer 18 cdef Vertex *vertex_buffer
13 19
14 cdef bint use_fixed_pipeline #XXX 20 cdef bint use_fixed_pipeline #XXX
15 21
16 cdef unsigned short *indices[2][MAX_TEXTURES] 22 cdef unsigned short *indices[2][MAX_TEXTURES]
17 cdef unsigned short last_indices[2 * MAX_TEXTURES] 23 cdef unsigned short last_indices[2 * MAX_TEXTURES]
18 cdef PyObject *elements[640*3] 24 cdef PyObject *elements[640*3]
19 25
20 cpdef render_elements(self, elements) 26 cpdef render_elements(self, elements)
21 cpdef render_quads(self, rects, colors, texture) 27 cpdef render_quads(self, rects, colors, texture)
28 cpdef render_framebuffer(self, Framebuffer fb)
29
30
31 cdef class Framebuffer:
32 cdef GLuint fbo, texture, rbo
33 cdef int x, y, width, height
34
35 cpdef bind(self)