comparison pytouhou/lib/sdl.pxd @ 460:ec327e58b477

Add a context manager to initialize and shut down SDL outside of Window.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 06 Sep 2013 23:29:19 +0200
parents cae1ae9de430
children 36bc577b2392
comparison
equal deleted inserted replaced
459:6e733ed817bd 460:ec327e58b477
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 _sdl cimport *
16 16
17
18 cdef Uint32 INIT_VIDEO
19 cdef Uint32 INIT_PNG
20 17
21 cdef SDL_GLattr GL_CONTEXT_MAJOR_VERSION 18 cdef SDL_GLattr GL_CONTEXT_MAJOR_VERSION
22 cdef SDL_GLattr GL_CONTEXT_MINOR_VERSION 19 cdef SDL_GLattr GL_CONTEXT_MINOR_VERSION
23 cdef SDL_GLattr GL_DOUBLEBUFFER 20 cdef SDL_GLattr GL_DOUBLEBUFFER
24 cdef SDL_GLattr GL_DEPTH_SIZE 21 cdef SDL_GLattr GL_DEPTH_SIZE
38 cdef long SCANCODE_LCTRL 35 cdef long SCANCODE_LCTRL
39 cdef long SCANCODE_ESCAPE 36 cdef long SCANCODE_ESCAPE
40 37
41 cdef SDL_EventType KEYDOWN 38 cdef SDL_EventType KEYDOWN
42 cdef SDL_EventType QUIT 39 cdef SDL_EventType QUIT
43
44 cdef Uint16 DEFAULT_FORMAT
45 40
46 41
47 cdef class Window: 42 cdef class Window:
48 cdef SDL_Window *window 43 cdef SDL_Window *window
49 cdef SDL_GLContext context 44 cdef SDL_GLContext context
82 77
83 cdef void init(Uint32 flags) except * 78 cdef void init(Uint32 flags) except *
84 cdef void img_init(Uint32 flags) except * 79 cdef void img_init(Uint32 flags) except *
85 cdef void mix_init(int flags) except * 80 cdef void mix_init(int flags) except *
86 cdef void ttf_init() except * 81 cdef void ttf_init() except *
87
88 IF UNAME_SYSNAME == "Windows":
89 cdef void set_main_ready()
90
91 cdef void quit() nogil
92 cdef void img_quit() nogil
93 cdef void mix_quit() nogil
94 cdef void ttf_quit() nogil
95 cdef void gl_set_attribute(SDL_GLattr attr, int value) except * 82 cdef void gl_set_attribute(SDL_GLattr attr, int value) except *
96 cdef list poll_events() 83 cdef list poll_events()
97 cdef const Uint8* get_keyboard_state() nogil 84 cdef const Uint8* get_keyboard_state() nogil
98 cdef Surface load_png(file_) 85 cdef Surface load_png(file_)
99 cdef Surface create_rgb_surface(int width, int height, int depth, Uint32 rmask=*, Uint32 gmask=*, Uint32 bmask=*, Uint32 amask=*) 86 cdef Surface create_rgb_surface(int width, int height, int depth, Uint32 rmask=*, Uint32 gmask=*, Uint32 bmask=*, Uint32 amask=*)
100 cdef void mix_open_audio(int frequency, Uint16 format_, int channels, int chunksize) except * 87 cdef void mix_open_audio(int frequency, Uint16 format_, int channels, int chunksize) except *
101 cdef void mix_close_audio() nogil
102 cdef void mix_allocate_channels(int numchans) except * 88 cdef void mix_allocate_channels(int numchans) except *
103 cdef int mix_volume(int channel, float volume) nogil 89 cdef int mix_volume(int channel, float volume) nogil
104 cdef int mix_volume_music(float volume) nogil 90 cdef int mix_volume_music(float volume) nogil
105 cdef Music load_music(const char *filename) 91 cdef Music load_music(const char *filename)
106 cdef Chunk load_chunk(file_) 92 cdef Chunk load_chunk(file_)