Fix SDL device to work with null driver

This commit is contained in:
sfan5 2022-10-15 11:12:54 +02:00
parent 59fc4401f1
commit 2709c937d9
1 changed files with 5 additions and 5 deletions

View File

@ -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;