Don't exit if SDL_GetWindowWMInfo fails
This commit is contained in:
parent
e2a82b3c09
commit
d9fad6ab55
@ -127,9 +127,14 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
|||||||
{
|
{
|
||||||
SDL_VERSION(&Info.version);
|
SDL_VERSION(&Info.version);
|
||||||
|
|
||||||
|
#if (defined(IOS_STK) || defined(_IRR_COMPILE_WITH_DIRECT3D_9_)) && !defined(__SWITCH__)
|
||||||
|
// Only iOS or DirectX9 build uses the Info structure
|
||||||
// Switch doesn't support GetWindowWMInfo
|
// Switch doesn't support GetWindowWMInfo
|
||||||
#ifndef __SWITCH__
|
#ifdef IOS_STK
|
||||||
if (!SDL_GetWindowWMInfo(Window, &Info))
|
if (!SDL_GetWindowWMInfo(Window, &Info))
|
||||||
|
#else
|
||||||
|
if (CreationParams.DriverType == video::EDT_DIRECT3D9 && !SDL_GetWindowWMInfo(Window, &Info))
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
#ifdef IOS_STK
|
#ifdef IOS_STK
|
||||||
@ -138,7 +143,7 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
|||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
Android_initDisplayCutout(&TopPadding, &BottomPadding, &LeftPadding, &RightPadding, &InitialOrientation);
|
Android_initDisplayCutout(&TopPadding, &BottomPadding, &LeftPadding, &RightPadding, &InitialOrientation);
|
||||||
#endif
|
#endif
|
||||||
core::stringc sdlversion = "SDL Version ";
|
core::stringc sdlversion = "Compiled SDL Version ";
|
||||||
sdlversion += Info.version.major;
|
sdlversion += Info.version.major;
|
||||||
sdlversion += ".";
|
sdlversion += ".";
|
||||||
sdlversion += Info.version.minor;
|
sdlversion += Info.version.minor;
|
||||||
@ -147,6 +152,17 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
|||||||
|
|
||||||
Operator = new COSOperator(sdlversion);
|
Operator = new COSOperator(sdlversion);
|
||||||
os::Printer::log(sdlversion.c_str(), ELL_INFORMATION);
|
os::Printer::log(sdlversion.c_str(), ELL_INFORMATION);
|
||||||
|
|
||||||
|
core::stringc cur_sdlversion = "Current SDL Version ";
|
||||||
|
SDL_version version = {};
|
||||||
|
SDL_GetVersion(&version);
|
||||||
|
cur_sdlversion += version.major;
|
||||||
|
cur_sdlversion += ".";
|
||||||
|
cur_sdlversion += version.minor;
|
||||||
|
cur_sdlversion += ".";
|
||||||
|
cur_sdlversion += version.patch;
|
||||||
|
|
||||||
|
os::Printer::log(cur_sdlversion.c_str(), ELL_INFORMATION);
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 9)
|
#if SDL_VERSION_ATLEAST(2, 0, 9)
|
||||||
for (int i = 0; i < SDL_NumSensors(); i++)
|
for (int i = 0; i < SDL_NumSensors(); i++)
|
||||||
{
|
{
|
||||||
|
@ -114,7 +114,9 @@ class MoltenVK;
|
|||||||
|
|
||||||
SDL_Window* getWindow() const { return Window; }
|
SDL_Window* getWindow() const { return Window; }
|
||||||
|
|
||||||
|
#ifdef IOS_STK
|
||||||
const SDL_SysWMinfo& getWMInfo() const { return Info; }
|
const SDL_SysWMinfo& getWMInfo() const { return Info; }
|
||||||
|
#endif
|
||||||
|
|
||||||
virtual s32 getTopPadding();
|
virtual s32 getTopPadding();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user