From 2709c937d9ae8c1f1359a90d2112e985cafb2503 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 15 Oct 2022 11:12:54 +0200 Subject: [PATCH] Fix SDL device to work with null driver --- source/Irrlicht/CIrrDeviceSDL.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/Irrlicht/CIrrDeviceSDL.cpp b/source/Irrlicht/CIrrDeviceSDL.cpp index 331c8e59..ea309688 100644 --- a/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/source/Irrlicht/CIrrDeviceSDL.cpp @@ -119,13 +119,13 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param) if ( ++SDLDeviceInstances == 1 ) { - // Initialize SDL... Timer for sleep, video for the obvious, and - // noparachute prevents SDL from catching fatal errors. - if (SDL_Init( SDL_INIT_TIMER|SDL_INIT_VIDEO| + u32 flags = SDL_INIT_TIMER | SDL_INIT_EVENTS; + if (CreationParams.DriverType != video::EDT_NULL) + flags |= SDL_INIT_VIDEO; #if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) - SDL_INIT_JOYSTICK| + flags |= SDL_INIT_JOYSTICK; #endif - SDL_INIT_NOPARACHUTE ) < 0) + if (SDL_Init(flags) < 0) { os::Printer::log( "Unable to initialize SDL!", SDL_GetError()); Close = true;