mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +00:00
Properly fixed the white screen flash seen on application startup.
This commit is contained in:
parent
b5b999cc9e
commit
cd19ef7b16
|
@ -224,18 +224,6 @@ namespace Renderer
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TEMPORARY: This was an attempt to get rid of the annoying white screen flashing seen
|
|
||||||
// on some systems when starting the application. However it caused other adverse
|
|
||||||
// effects on Linux such as crashes if attempting to start the application with the
|
|
||||||
// --resolution flag in full screen mode and when attempting to launch games that changes
|
|
||||||
// the screen resolution. It may still be usable on other operating systems so I'm
|
|
||||||
// keeping the code for now.
|
|
||||||
// // Create a black surface which will avoid the white screen that would otherwise flash
|
|
||||||
// // by briefly before the splash screen is rendered when using some graphics drivers.
|
|
||||||
// SDL_Surface* blackSurface = SDL_GetWindowSurface(sdlWindow);
|
|
||||||
// SDL_FillRect(blackSurface, nullptr, SDL_MapRGB(blackSurface->format, 0x00, 0x00, 0x00));
|
|
||||||
// SDL_UpdateWindowSurface(sdlWindow);
|
|
||||||
|
|
||||||
LOG(LogInfo) << "Setting up OpenGL...";
|
LOG(LogInfo) << "Setting up OpenGL...";
|
||||||
|
|
||||||
if (!createContext())
|
if (!createContext())
|
||||||
|
@ -243,6 +231,7 @@ namespace Renderer
|
||||||
|
|
||||||
setIcon();
|
setIcon();
|
||||||
setSwapInterval();
|
setSwapInterval();
|
||||||
|
swapBuffers();
|
||||||
|
|
||||||
#if defined(USE_OPENGL_21)
|
#if defined(USE_OPENGL_21)
|
||||||
LOG(LogInfo) << "Loading shaders...";
|
LOG(LogInfo) << "Loading shaders...";
|
||||||
|
@ -349,6 +338,11 @@ namespace Renderer
|
||||||
setViewport(viewport);
|
setViewport(viewport);
|
||||||
setProjection(projection);
|
setProjection(projection);
|
||||||
|
|
||||||
|
// This is required to avoid a brief white screen flash seen on some systems.
|
||||||
|
Renderer::drawRect(0.0f, 0.0f, static_cast<float>(Renderer::getScreenWidth()),
|
||||||
|
static_cast<float>(Renderer::getScreenHeight()), 0x000000FF, 0x000000FF);
|
||||||
|
swapBuffers();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue