Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Windows+SDL broken by #225 #246

Closed
grorp opened this issue Oct 4, 2023 · 0 comments · Fixed by #247
Closed

Windows+SDL broken by #225 #246

grorp opened this issue Oct 4, 2023 · 0 comments · Fixed by #247
Labels
bug Something isn't working

Comments

@grorp
Copy link
Member

grorp commented Oct 4, 2023

@nerzhul

#225 removed IRR_COMPILE_WITH_WINDOWS_DEVICE. Windows builds now always include the Windows Irrlicht device. However, SDL builds must only contain the SDL Irrlicht device. If both the Windows device and the SDL device exist, the Windows device takes precedence:

extern "C" IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDeviceEx(const SIrrlichtCreationParameters& params)
{
IrrlichtDevice* dev = 0;
#ifdef _IRR_WINDOWS_API_
if (params.DeviceType == EIDT_WIN32 || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceWin32(params);
#endif
#ifdef _IRR_COMPILE_WITH_OSX_DEVICE_
if (params.DeviceType == EIDT_OSX || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceMacOSX(params);
#endif
#ifdef _IRR_COMPILE_WITH_X11_DEVICE_
if (params.DeviceType == EIDT_X11 || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceLinux(params);
#endif
#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
if (params.DeviceType == EIDT_ANDROID || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceAndroid(params);
#endif
#ifdef _IRR_COMPILE_WITH_SDL_DEVICE_
if (params.DeviceType == EIDT_SDL || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceSDL(params);
#endif
if (dev && !dev->getVideoDriver() && params.DriverType != video::EDT_NULL)
{
dev->closeDevice(); // destroy window
dev->run(); // consume quit message
dev->drop();
dev = 0;
}
return dev;
}

As a result, USE_SDL2 has no effect anymore on Windows. I suggest reverting #225 for now to make these builds work again, the PR can always be redone correctly later.

How to reproduce

Compile Minetest with -DUSE_SDL2=TRUE on Windows. See that the "About" tab still shows "Irrlicht device: WIN32".


This doesn't seem to be the same issue as #239, the CI still fails after reverting #225.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant