Skip to content

Commit

Permalink
Use at least 16bit for Depth-Buffer (fixes #37)
Browse files Browse the repository at this point in the history
Seems like on Windows 0 bits is handled as "Let Windows/Driver decide",
so handle that case by setting a reasonable value of 16.
  • Loading branch information
DanielGibson committed May 9, 2016
1 parent 40213b3 commit 8106aed
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Sources/Engine/Graphics/SDL/SDLOpenGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8106aed

Please sign in to comment.