Mercurial > touhou
annotate pytouhou/ui/renderer.pxd @ 456:cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 16 Jul 2013 21:11:40 +0200 |
parents | d56536ef28e8 |
children | 1b56d62250ab |
rev | line source |
---|---|
449
d56536ef28e8
Improve render_elements’ speed a lot, and fix it in some corner cases. Thanks liori!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
1 from cpython cimport PyObject |
d56536ef28e8
Improve render_elements’ speed a lot, and fix it in some corner cases. Thanks liori!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
2 |
222
5cac48b328ad
Refactor rendering code a bit.
Thibaut Girka <thib@sitedethib.com>
parents:
diff
changeset
|
3 cdef struct Vertex: |
5cac48b328ad
Refactor rendering code a bit.
Thibaut Girka <thib@sitedethib.com>
parents:
diff
changeset
|
4 int x, y, z |
5cac48b328ad
Refactor rendering code a bit.
Thibaut Girka <thib@sitedethib.com>
parents:
diff
changeset
|
5 float u, v |
5cac48b328ad
Refactor rendering code a bit.
Thibaut Girka <thib@sitedethib.com>
parents:
diff
changeset
|
6 unsigned char r, g, b, a |
5cac48b328ad
Refactor rendering code a bit.
Thibaut Girka <thib@sitedethib.com>
parents:
diff
changeset
|
7 |
5cac48b328ad
Refactor rendering code a bit.
Thibaut Girka <thib@sitedethib.com>
parents:
diff
changeset
|
8 |
5cac48b328ad
Refactor rendering code a bit.
Thibaut Girka <thib@sitedethib.com>
parents:
diff
changeset
|
9 cdef class Renderer: |
5cac48b328ad
Refactor rendering code a bit.
Thibaut Girka <thib@sitedethib.com>
parents:
diff
changeset
|
10 cdef public texture_manager |
423
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
412
diff
changeset
|
11 cdef unsigned int vbo |
222
5cac48b328ad
Refactor rendering code a bit.
Thibaut Girka <thib@sitedethib.com>
parents:
diff
changeset
|
12 cdef Vertex *vertex_buffer |
5cac48b328ad
Refactor rendering code a bit.
Thibaut Girka <thib@sitedethib.com>
parents:
diff
changeset
|
13 |
449
d56536ef28e8
Improve render_elements’ speed a lot, and fix it in some corner cases. Thanks liori!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
14 cdef unsigned short *indices[2][MAX_TEXTURES] |
d56536ef28e8
Improve render_elements’ speed a lot, and fix it in some corner cases. Thanks liori!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
15 cdef unsigned short last_indices[2 * MAX_TEXTURES] |
d56536ef28e8
Improve render_elements’ speed a lot, and fix it in some corner cases. Thanks liori!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
16 cdef PyObject *elements[640*3] |
d56536ef28e8
Improve render_elements’ speed a lot, and fix it in some corner cases. Thanks liori!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
17 |
222
5cac48b328ad
Refactor rendering code a bit.
Thibaut Girka <thib@sitedethib.com>
parents:
diff
changeset
|
18 cpdef render_elements(self, elements) |
456
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
449
diff
changeset
|
19 cpdef render_quads(self, rects, colors, texture) |