From 4cb44499b27cd8fe4955a16a9af46cf97ecf06e3 Mon Sep 17 00:00:00 2001 From: realtradam Date: Fri, 16 Jun 2023 02:17:51 -0400 Subject: switch SDL_Init to use SDL_InitSubSystem and move to where relevant --- src/window/rodeo_window.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'src/window') diff --git a/src/window/rodeo_window.c b/src/window/rodeo_window.c index 40c1ccf..0c7899e 100644 --- a/src/window/rodeo_window.c +++ b/src/window/rodeo_window.c @@ -26,29 +26,22 @@ rodeo_window_init( rodeo_log( rodeo_logLevel_info, - "Initializing SDL..." + "Initializing SDL Video..." ); + if(SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) { - uint32_t init_flags_sdl = 0; - init_flags_sdl = init_flags_sdl | SDL_INIT_VIDEO; - init_flags_sdl = init_flags_sdl | SDL_INIT_AUDIO; - init_flags_sdl = init_flags_sdl | SDL_INIT_GAMECONTROLLER; - - if(SDL_Init(init_flags_sdl) < 0) - { - rodeo_log( - rodeo_logLevel_error, - "Failed to initialize SDL. SDL_Error: %s", - SDL_GetError() - ); - exit(EXIT_FAILURE); - } rodeo_log( - rodeo_logLevel_info, - "Success initializing SDL" + rodeo_logLevel_error, + "Failed to initialize SDL Video. SDL_Error: %s", + SDL_GetError() ); + exit(EXIT_FAILURE); } + rodeo_log( + rodeo_logLevel_info, + "Success initializing SDL Video" + ); rodeo_log( rodeo_logLevel_info, -- cgit v1.2.3