Mercurial > touhou
annotate pytouhou/ui/sdl/gamerenderer.pxd @ 612:73f134f84c7f
Request a RGB888 context, since SDL2’s default of RGB332 sucks.
On X11/GLX, it will select the first config available, that is the best
one, while on EGL it will iterate over them to select the one closest
to what the application requested.
Of course, anything lower than RGB888 looks bad and we really don’t
want that.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 26 Mar 2015 20:20:37 +0100 |
parents | b895ed2de71f |
children | a6af3ff86612 |
rev | line source |
---|---|
512
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
1 from pytouhou.game.game cimport Game |
544
b895ed2de71f
Implement text rendering for the SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
532
diff
changeset
|
2 from .texture cimport TextureManager, FontManager |
532
dacdcca59b66
Don’t put back the rendering data into a tuple, use a specialised struct inside Sprite to pass it to the renderer.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
512
diff
changeset
|
3 from .sprite cimport get_sprite_rendering_data |
512
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
4 from pytouhou.ui.window cimport Window |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
5 |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
6 cdef class GameRenderer: |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
7 cdef Window window |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
8 cdef TextureManager texture_manager |
544
b895ed2de71f
Implement text rendering for the SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
532
diff
changeset
|
9 cdef FontManager font_manager |
512
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
10 cdef long x, y, width, height |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
11 |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
12 cdef public size #XXX |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
13 |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
14 cdef void render_game(self, Game game) except * |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
15 cdef void render_text(self, texts) except * |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
16 cdef void render_interface(self, interface, game_boss) except * |