diff --git a/src/sdl/i_video.cpp b/src/sdl/i_video.cpp index 3b7caafa4..ede7db5a6 100644 --- a/src/sdl/i_video.cpp +++ b/src/sdl/i_video.cpp @@ -1573,6 +1573,11 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) #ifdef HWRENDER 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