comparison pytouhou/ui/opengl/background.pxd @ 519:b18f0bd30ad0

Optimise background rendering.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 07 Dec 2013 22:16:38 +0100
parents b3193b43a86c
children 94725968dabb
comparison
equal deleted inserted replaced
518:75ae628522c9 519:b18f0bd30ad0
1 from pytouhou.lib.opengl cimport GLuint 1 from pytouhou.lib.opengl cimport GLuint, GLushort, GLsizei
2 from .renderer cimport Renderer 2 from .renderer cimport Renderer
3 3
4 cdef struct Vertex: 4 cdef struct Vertex:
5 float x, y, z 5 float x, y, z
6 float u, v 6 float u, v
7 unsigned char r, g, b, a 7 unsigned char r, g, b, a
8 8
9 9
10 cdef class BackgroundRenderer: 10 cdef class BackgroundRenderer:
11 cdef GLuint texture 11 cdef GLuint texture
12 cdef unsigned short blendfunc, nb_vertices 12 cdef GLsizei nb_indices
13 cdef unsigned int use_fixed_pipeline
14
15 # For modern GL.
16 cdef GLuint vbo, ibo
17
18 # For fixed pipeline.
13 cdef Vertex *vertex_buffer 19 cdef Vertex *vertex_buffer
14 cdef unsigned int use_fixed_pipeline, vbo 20 cdef GLushort *indices
15 cdef object background
16 21
17 cdef void render_background(self) except * 22 cdef void render_background(self) except *
18 cdef void load(self, background, Renderer renderer) except * 23 cdef void load(self, background, Renderer renderer) except *