Mercurial > touhou
annotate pytouhou/ui/opengl/background.pxd @ 607:9dbc234ea087
Actually compile under 3.x feature level.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 26 Nov 2014 13:37:07 +0100 |
parents | 3c2f96f1d715 |
children | a6a191e371c7 |
rev | line source |
---|---|
519
b18f0bd30ad0
Optimise background rendering.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
515
diff
changeset
|
1 from pytouhou.lib.opengl cimport GLuint, GLushort, GLsizei |
426
5d7bb2fd74f7
Never keep texture on the host when it has been uploaded, and prevent them from being decoded again.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
2 |
423
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
3 cdef struct Vertex: |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
4 float x, y, z |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
5 float u, v |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
6 unsigned char r, g, b, a |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
7 |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
8 |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
9 cdef class BackgroundRenderer: |
426
5d7bb2fd74f7
Never keep texture on the host when it has been uploaded, and prevent them from being decoded again.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
10 cdef GLuint texture |
519
b18f0bd30ad0
Optimise background rendering.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
515
diff
changeset
|
11 cdef GLsizei nb_indices |
b18f0bd30ad0
Optimise background rendering.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
515
diff
changeset
|
12 |
b18f0bd30ad0
Optimise background rendering.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
515
diff
changeset
|
13 # For modern GL. |
b18f0bd30ad0
Optimise background rendering.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
515
diff
changeset
|
14 cdef GLuint vbo, ibo |
558
94725968dabb
Use vertex array objects, to be compatible with OpenGL 3.1+ core profile.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
519
diff
changeset
|
15 cdef GLuint vao |
519
b18f0bd30ad0
Optimise background rendering.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
515
diff
changeset
|
16 |
b18f0bd30ad0
Optimise background rendering.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
515
diff
changeset
|
17 # For fixed pipeline. |
423
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
18 cdef Vertex *vertex_buffer |
519
b18f0bd30ad0
Optimise background rendering.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
515
diff
changeset
|
19 cdef GLushort *indices |
423
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
20 |
558
94725968dabb
Use vertex array objects, to be compatible with OpenGL 3.1+ core profile.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
519
diff
changeset
|
21 cdef void set_state(self) nogil |
606
3c2f96f1d715
Fix compilation under Cython 0.22, by making the pyx and the pxd declarations’ except clause similar.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
586
diff
changeset
|
22 cdef void render_background(self) nogil |
586
4b0593da29d5
Simplify framebuffer rendering with glDrawArrays, and move it all to its own file.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
560
diff
changeset
|
23 cdef void load(self, background, GLuint[MAX_TEXTURES] textures) except * |