mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +00:00
(Windows) Improved game launching with the AMD and Intel GPU workaround setting enabled.
This commit is contained in:
parent
9cb88e822f
commit
7e8d1f6434
|
@ -166,17 +166,30 @@ int launchGameWindows(const std::wstring& cmd_utf16, bool runInBackground, bool
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
if (!runInBackground) {
|
if (!runInBackground) {
|
||||||
|
int width{};
|
||||||
|
int height{};
|
||||||
|
|
||||||
if (Settings::getInstance()->getBool("LaunchWorkaround")) {
|
if (Settings::getInstance()->getBool("LaunchWorkaround")) {
|
||||||
// Ugly hack to make the emulator window render correctly with some graphics drivers
|
// Hack to make the emulator window render correctly with some graphics drivers
|
||||||
// (probably only those from AMD and Intel as Nvidia seems to work fine without this).
|
// when running at full screen resolution. This is probably only an issue with AMD
|
||||||
// Unfortunately this turns the screen white as the emulator is starting.
|
// and Intel drivers as Nvidia and software drivers like LLVMpipe work fine without
|
||||||
// This definitely needs a proper solution some time in the future.
|
// this workaround. If not used on affected drivers the emulator window will simply
|
||||||
SDL_HideWindow(Renderer::getSDLWindow());
|
// be black although the emulator actually works and outputs sounds, accepts input etc.
|
||||||
SDL_ShowWindow(Renderer::getSDLWindow());
|
// There is a white flash the first time an emulator is started during the program
|
||||||
|
// session and a white single-pixel line will be visible at the bottom of the screen
|
||||||
|
// when the emulator is loading but it's at least a tolerable workaround.
|
||||||
|
SDL_GetWindowSize(Renderer::getSDLWindow(), &width, &height);
|
||||||
|
SDL_SetWindowSize(Renderer::getSDLWindow(), width, height - 1);
|
||||||
|
SDL_Delay(100);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
Renderer::swapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
WaitForSingleObject(pi.hThread, INFINITE);
|
WaitForSingleObject(pi.hThread, INFINITE);
|
||||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||||
|
|
||||||
|
if (Settings::getInstance()->getBool("LaunchWorkaround"))
|
||||||
|
SDL_SetWindowSize(Renderer::getSDLWindow(), width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the return value is false, then something failed.
|
// If the return value is false, then something failed.
|
||||||
|
|
Loading…
Reference in a new issue