From 2f5001e70f40356eb493fef17021ebeea3d74410 Mon Sep 17 00:00:00 2001 From: Nahuel Lofeudo Date: Sun, 18 Dec 2022 10:16:56 +0000 Subject: [PATCH] Fix display initialization --- main.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/main.py b/main.py index 0b09a83..b98fab8 100755 --- a/main.py +++ b/main.py @@ -99,18 +99,9 @@ def clear_screen() -> None: def init_screen(width: int, height: int) -> pygame.Surface: """ Create a Surface to draw on, with the given size, using either X11/Wayland (desktop) or directfb (no desktop) """ - drivers = ['x11', 'directfb'] - for driver in drivers: - print(f'Trying driver {driver}') - # Make sure that SDL_VIDEODRIVER is set - os.putenv('SDL_VIDEODRIVER', driver) - try: - pygame.display.init() - window = pygame.display.set_mode(size=(width, height), flags=DOUBLEBUF) - except pygame.error: - continue - return window - raise Exception('No suitable video driver found!') + pygame.display.init() + window = pygame.display.set_mode((0, 0)) + return window def main():