From 8106aedd9f4eb81c104ca8a78a0646a702610640 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sun, 24 Apr 2016 16:06:57 +0200 Subject: [PATCH] Use at least 16bit for Depth-Buffer (fixes #37) Seems like on Windows 0 bits is handled as "Let Windows/Driver decide", so handle that case by setting a reasonable value of 16. --- Sources/Engine/Graphics/SDL/SDLOpenGL.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Sources/Engine/Graphics/SDL/SDLOpenGL.cpp b/Sources/Engine/Graphics/SDL/SDLOpenGL.cpp index 4bf398f..fa75240 100644 --- a/Sources/Engine/Graphics/SDL/SDLOpenGL.cpp +++ b/Sources/Engine/Graphics/SDL/SDLOpenGL.cpp @@ -95,11 +95,7 @@ BOOL CGfxLibrary::SetupPixelFormat_OGL( HDC hdc, BOOL bReport/*=FALSE*/) // clamp depth/stencil values extern INDEX gap_iDepthBits; extern INDEX gap_iStencilBits; - if( gap_iDepthBits <12) { - ASSERT(gap_iDepthBits >= 12 && "Using gap_iDepthBits=0, that's probably bad?!"); - gap_iDepthBits = 0; - } - else if( gap_iDepthBits <22) gap_iDepthBits = 16; + if( gap_iDepthBits <22) gap_iDepthBits = 16; // this includes 0; 16 is a safe default else if( gap_iDepthBits <28) gap_iDepthBits = 24; else gap_iDepthBits = 32; if( gap_iStencilBits<3) gap_iStencilBits = 0;