Mercurial > touhou
comparison pytouhou/lib/sdl.pxd @ 635:80687f258001
Make sdl.Window inherit from gui.Window, so we can swap implementations.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 14 Apr 2016 21:18:03 +0100 |
parents | a6af3ff86612 |
children |
comparison
equal
deleted
inserted
replaced
634:5270c34b4c00 | 635:80687f258001 |
---|---|
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 ## GNU General Public License for more details. | 12 ## GNU General Public License for more details. |
13 ## | 13 ## |
14 | 14 |
15 from ._sdl cimport * | 15 from pytouhou.lib._sdl cimport * |
16 cimport pytouhou.lib.gui as gui | |
16 | 17 |
17 | 18 |
18 cdef SDL_GLattr GL_CONTEXT_MAJOR_VERSION | 19 cdef SDL_GLattr GL_CONTEXT_MAJOR_VERSION |
19 cdef SDL_GLattr GL_CONTEXT_MINOR_VERSION | 20 cdef SDL_GLattr GL_CONTEXT_MINOR_VERSION |
20 cdef SDL_GLattr GL_CONTEXT_PROFILE_MASK | 21 cdef SDL_GLattr GL_CONTEXT_PROFILE_MASK |
53 cdef SDL_EventType WINDOWEVENT | 54 cdef SDL_EventType WINDOWEVENT |
54 | 55 |
55 cdef const Uint8 *keyboard_state | 56 cdef const Uint8 *keyboard_state |
56 | 57 |
57 | 58 |
58 cdef class Window: | 59 cdef class Window(gui.Window): |
59 cdef SDL_Window *window | 60 cdef SDL_Window *window |
60 cdef SDL_GLContext context | 61 cdef SDL_GLContext context |
61 cdef SDL_Renderer *renderer | 62 cdef SDL_Renderer *renderer |
62 | 63 cdef bint is_fullscreen |
63 cdef bint gl_create_context(self) except True | |
64 cdef void present(self) nogil | |
65 cdef void set_window_size(self, int width, int height) nogil | |
66 | 64 |
67 # The following functions are there for the pure SDL backend. | 65 # The following functions are there for the pure SDL backend. |
68 cdef bint create_renderer(self, Uint32 flags) except True | 66 cdef bint create_renderer(self, Uint32 flags) except True |
69 cdef bint render_clear(self) except True | 67 cdef bint render_clear(self) except True |
70 cdef bint render_copy(self, Texture texture, Rect srcrect, Rect dstrect) except True | 68 cdef bint render_copy(self, Texture texture, Rect srcrect, Rect dstrect) except True |
120 cdef bint init(Uint32 flags) except True | 118 cdef bint init(Uint32 flags) except True |
121 cdef bint img_init(int flags) except True | 119 cdef bint img_init(int flags) except True |
122 cdef bint mix_init(int flags) except True | 120 cdef bint mix_init(int flags) except True |
123 cdef bint ttf_init() except True | 121 cdef bint ttf_init() except True |
124 cdef bint gl_set_attribute(SDL_GLattr attr, int value) except True | 122 cdef bint gl_set_attribute(SDL_GLattr attr, int value) except True |
125 cdef bint gl_set_swap_interval(int interval) except True | |
126 cdef list poll_events() | |
127 cdef Surface load_png(file_) | 123 cdef Surface load_png(file_) |
128 cdef Surface create_rgb_surface(int width, int height, int depth, Uint32 rmask=*, Uint32 gmask=*, Uint32 bmask=*, Uint32 amask=*) | 124 cdef Surface create_rgb_surface(int width, int height, int depth, Uint32 rmask=*, Uint32 gmask=*, Uint32 bmask=*, Uint32 amask=*) |
129 cdef bint mix_open_audio(int frequency, Uint16 format_, int channels, int chunksize) except True | 125 cdef bint mix_open_audio(int frequency, Uint16 format_, int channels, int chunksize) except True |
130 cdef bint mix_allocate_channels(int numchans) except True | 126 cdef bint mix_allocate_channels(int numchans) except True |
131 cdef int mix_volume(int channel, float volume) nogil | 127 cdef int mix_volume(int channel, float volume) nogil |