Fixed two regressions that could lead to crashes.

This commit is contained in:
Leon Styhre 2021-03-17 20:16:22 +01:00
parent 84ecb7489e
commit f08b434bc6

View file

@ -224,11 +224,17 @@ 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);
// 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...";