Mercurial > touhou
annotate pytouhou/ui/renderer.pxd @ 458:1b56d62250ab
Make pytouhou.ui.{window,shader,game{runner,renderer}} extension types.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 05 Sep 2013 23:11:54 +0200 |
parents | cae1ae9de430 |
children | a71b912b45b7 |
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: |
458
1b56d62250ab
Make pytouhou.ui.{window,shader,game{runner,renderer}} extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
10 cdef public texture_manager, font_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 |
458
1b56d62250ab
Make pytouhou.ui.{window,shader,game{runner,renderer}} extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
14 cdef bint use_fixed_pipeline #XXX |
1b56d62250ab
Make pytouhou.ui.{window,shader,game{runner,renderer}} extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
15 |
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
|
16 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
|
17 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
|
18 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
|
19 |
222
5cac48b328ad
Refactor rendering code a bit.
Thibaut Girka <thib@sitedethib.com>
parents:
diff
changeset
|
20 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
|
21 cpdef render_quads(self, rects, colors, texture) |