Mercurial > touhou
comparison pytouhou/lib/sdl.pyx @ 589:0768122da817
Add a frameskip option, and use swap interval to implement it.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 10 Oct 2014 15:59:11 +0200 |
parents | c34b23e29d16 |
children | e15672733c93 |
comparison
equal
deleted
inserted
replaced
588:7a82c4b52b16 | 589:0768122da817 |
---|---|
278 | 278 |
279 cdef void gl_set_attribute(SDL_GLattr attr, int value) except *: | 279 cdef void gl_set_attribute(SDL_GLattr attr, int value) except *: |
280 if SDL_GL_SetAttribute(attr, value) < 0: | 280 if SDL_GL_SetAttribute(attr, value) < 0: |
281 raise SDLError(SDL_GetError()) | 281 raise SDLError(SDL_GetError()) |
282 | 282 |
283 cdef int gl_set_swap_interval(int interval) except *: | |
284 if SDL_GL_SetSwapInterval(interval) < 0: | |
285 raise SDLError(SDL_GetError()) | |
286 | |
283 | 287 |
284 cdef list poll_events(): | 288 cdef list poll_events(): |
285 cdef SDL_Event event | 289 cdef SDL_Event event |
286 ret = [] | 290 ret = [] |
287 while SDL_PollEvent(&event): | 291 while SDL_PollEvent(&event): |