Request 24-bit depth buffer from SDL

Should fix problems caused by 16-bit depth buffer usage
This commit is contained in:
Hannu Hanhi 2021-10-08 22:47:22 +03:00
parent 8b021ec16b
commit 91aeba6c66

View file

@ -1620,6 +1620,11 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
#ifdef HWRENDER
if (vid.glstate == VID_GL_LIBRARY_LOADED)
flags |= SDL_WINDOW_OPENGL;
// Without a 24-bit depth buffer many visuals are ruined by z-fighting.
// Some GPU drivers may give us a 16-bit depth buffer since the
// default value for SDL_GL_DEPTH_SIZE is 16.
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
#endif
// Create a window