mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Fixed the annoying white screen flashing when starting the application.
This commit is contained in:
parent
7bb89693f3
commit
ec5f1c1b5f
|
@ -212,6 +212,12 @@ namespace Renderer
|
|||
return false;
|
||||
}
|
||||
|
||||
// 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...";
|
||||
|
||||
if (!createContext())
|
||||
|
@ -324,7 +330,6 @@ namespace Renderer
|
|||
|
||||
setViewport(viewport);
|
||||
setProjection(projection);
|
||||
swapBuffers();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -426,7 +431,7 @@ namespace Renderer
|
|||
vertices[3] = { { _x + _wL, _y + _hL }, { 0.0f, 0.0f }, colorEnd };
|
||||
|
||||
// Round vertices.
|
||||
for (int i = 0; i < 4; ++i)
|
||||
for (int i = 0; i < 4; i++)
|
||||
vertices[i].pos.round();
|
||||
|
||||
if (_opacity < 1.0) {
|
||||
|
|
Loading…
Reference in a new issue