comparison pytouhou/lib/sdl.pxd @ 617:a6af3ff86612

Change all “void except *” function into “bint except True”, to prevent PyErr_Occurred() from being called at each call.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 29 Mar 2015 00:08:20 +0100
parents 4ce3ef053a25
children 80687f258001
comparison
equal deleted inserted replaced
616:4ce3ef053a25 617:a6af3ff86612
91 91
92 92
93 cdef class Surface: 93 cdef class Surface:
94 cdef SDL_Surface *surface 94 cdef SDL_Surface *surface
95 95
96 cdef void blit(self, Surface other) except * 96 cdef bint blit(self, Surface other) except True
97 cdef void set_alpha(self, Surface alpha_surface) nogil 97 cdef void set_alpha(self, Surface alpha_surface) nogil
98 98
99 99
100 cdef class Music: 100 cdef class Music:
101 cdef Mix_Music *music 101 cdef Mix_Music *music
115 cdef TTF_Font *font 115 cdef TTF_Font *font
116 116
117 cdef Surface render(self, unicode text) 117 cdef Surface render(self, unicode text)
118 118
119 119
120 cdef void init(Uint32 flags) except * 120 cdef bint init(Uint32 flags) except True
121 cdef void img_init(int flags) except * 121 cdef bint img_init(int flags) except True
122 cdef void mix_init(int flags) except * 122 cdef bint mix_init(int flags) except True
123 cdef void ttf_init() except * 123 cdef bint ttf_init() except True
124 cdef void gl_set_attribute(SDL_GLattr attr, int value) except * 124 cdef bint gl_set_attribute(SDL_GLattr attr, int value) except True
125 cdef int gl_set_swap_interval(int interval) except * 125 cdef bint gl_set_swap_interval(int interval) except True
126 cdef list poll_events() 126 cdef list poll_events()
127 cdef Surface load_png(file_) 127 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=*) 128 cdef Surface create_rgb_surface(int width, int height, int depth, Uint32 rmask=*, Uint32 gmask=*, Uint32 bmask=*, Uint32 amask=*)
129 cdef void mix_open_audio(int frequency, Uint16 format_, int channels, int chunksize) except * 129 cdef bint mix_open_audio(int frequency, Uint16 format_, int channels, int chunksize) except True
130 cdef void mix_allocate_channels(int numchans) except * 130 cdef bint mix_allocate_channels(int numchans) except True
131 cdef int mix_volume(int channel, float volume) nogil 131 cdef int mix_volume(int channel, float volume) nogil
132 cdef int mix_volume_music(float volume) nogil 132 cdef int mix_volume_music(float volume) nogil
133 cdef Music load_music(str filename) 133 cdef Music load_music(str filename)
134 cdef Chunk load_chunk(file_) 134 cdef Chunk load_chunk(file_)
135 cdef Uint32 get_ticks() nogil 135 cdef Uint32 get_ticks() nogil