mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-25 07:44:38 +01:00
Extract RequireNewWindow to Platform
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "../interface/Screenshot.h"
|
||||
#include "../localisation/StringIds.h"
|
||||
#include "../paint/Painter.h"
|
||||
#include "../platform/Platform2.h"
|
||||
#include "../ui/UiContext.h"
|
||||
#include "../world/Location.hpp"
|
||||
#include "IDrawingContext.h"
|
||||
@@ -52,16 +53,8 @@ static IDrawingEngine* GetDrawingEngine()
|
||||
|
||||
bool drawing_engine_requires_new_window(DrawingEngine srcEngine, DrawingEngine dstEngine)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (srcEngine != DrawingEngine::OpenGL && dstEngine != DrawingEngine::OpenGL)
|
||||
{
|
||||
// Windows is apparently able to switch to hardware rendering on the fly although
|
||||
// using the same window in an unaccelerated and accelerated context is unsupported by SDL2
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
bool openGL = srcEngine == DrawingEngine::OpenGL || dstEngine == DrawingEngine::OpenGL;
|
||||
return Platform::RequireNewWindow(openGL);
|
||||
}
|
||||
|
||||
void drawing_engine_init()
|
||||
|
||||
@@ -240,6 +240,11 @@ namespace Platform
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool RequireNewWindow(bool openGL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} // namespace Platform
|
||||
|
||||
#endif
|
||||
|
||||
@@ -593,6 +593,13 @@ namespace Platform
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool RequireNewWindow(bool openGL)
|
||||
{
|
||||
// Windows is apparently able to switch to hardware rendering on the fly although
|
||||
// using the same window in an unaccelerated and accelerated context is unsupported by SDL2
|
||||
return openGL;
|
||||
}
|
||||
} // namespace Platform
|
||||
|
||||
#endif
|
||||
|
||||
@@ -66,4 +66,5 @@ namespace Platform
|
||||
bool IsColourTerminalSupported();
|
||||
bool HandleSpecialCommandLineArgument(const char* argument);
|
||||
utf8* StrDecompToPrecomp(utf8* input);
|
||||
bool RequireNewWindow(bool openGL);
|
||||
} // namespace Platform
|
||||
|
||||
Reference in New Issue
Block a user