Mercurial > touhou
comparison pytouhou/lib/sdl.pyx @ 763:468dab1dd683
Python: Fix video argument (thanks Doomfan!)
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 09 Feb 2021 22:50:18 +0100 |
parents | a6875f90c141 |
children |
comparison
equal
deleted
inserted
replaced
762:cad9e422b18f | 763:468dab1dd683 |
---|---|
62 | 62 |
63 | 63 |
64 class SDL: | 64 class SDL: |
65 def __init__(self, *, video=True, sound=True): | 65 def __init__(self, *, video=True, sound=True): |
66 self.sound = sound | 66 self.sound = sound |
67 self.video = video | |
67 | 68 |
68 def __enter__(self): | 69 def __enter__(self): |
69 global keyboard_state | 70 global keyboard_state |
70 | 71 |
71 IF UNAME_SYSNAME == "Windows": | 72 IF UNAME_SYSNAME == "Windows": |
72 SDL_SetMainReady() | 73 SDL_SetMainReady() |
73 init(SDL_INIT_VIDEO if video else 0) | 74 init(SDL_INIT_VIDEO if self.video else 0) |
74 img_init(IMG_INIT_PNG) | 75 img_init(IMG_INIT_PNG) |
75 ttf_init() | 76 ttf_init() |
76 | 77 |
77 keyboard_state = SDL_GetKeyboardState(NULL) | 78 keyboard_state = SDL_GetKeyboardState(NULL) |
78 | 79 |