diff pytouhou/lib/sdl.pyx @ 754:a6875f90c141

Python: Only init SDL2 video if using SDL2 frontend.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 04 Jan 2021 20:39:30 +0100
parents 80687f258001
children 468dab1dd683
line wrap: on
line diff
--- a/pytouhou/lib/sdl.pyx
+++ b/pytouhou/lib/sdl.pyx
@@ -62,7 +62,7 @@ class SDLError(gui.Error):
 
 
 class SDL:
-    def __init__(self, sound=True):
+    def __init__(self, *, video=True, sound=True):
         self.sound = sound
 
     def __enter__(self):
@@ -70,7 +70,7 @@ class SDL:
 
         IF UNAME_SYSNAME == "Windows":
             SDL_SetMainReady()
-        init(SDL_INIT_VIDEO)
+        init(SDL_INIT_VIDEO if video else 0)
         img_init(IMG_INIT_PNG)
         ttf_init()