PDGL_API void pdglDepthFunc(int func) { if(pglDepthFunc) { pglDepthFunc(func); return; } pglDepthFunc=pdglGetProcAddress("glDepthFunc"); pglDepthFunc(func); }
/* ============= R_Clear ============= */ static void R_Clear( int bitMask ) { int bits; if( gl_overview->integer ) pglClearColor( 0.0f, 1.0f, 0.0f, 1.0f ); // green background (Valve rules) else pglClearColor( 0.5f, 0.5f, 0.5f, 1.0f ); bits = GL_DEPTH_BUFFER_BIT; if( RI.drawWorld && r_fastsky->integer ) bits |= GL_COLOR_BUFFER_BIT; if( glState.stencilEnabled ) bits |= GL_STENCIL_BUFFER_BIT; bits &= bitMask; pglClear( bits ); // change ordering for overview if( RI.drawOrtho ) { gldepthmin = 1.0f; gldepthmax = 0.0f; } else { gldepthmin = 0.0f; gldepthmax = 1.0f; } pglDepthFunc( GL_LEQUAL ); pglDepthRange( gldepthmin, gldepthmax ); }
// set depth buffer compare mode static void ogl_DepthFunc( GfxComp eFunc) { // check consistency ASSERT( _pGfx->gl_eCurrentAPI==GAT_OGL); GLenum gleFunc; #ifndef NDEBUG GfxComp gfxFunc; pglGetIntegerv( GL_DEPTH_FUNC, (GLint*)&gleFunc); OGL_CHECKERROR; gfxFunc = CompFromOGL( gleFunc); ASSERT( gfxFunc==GFX_eDepthFunc); #endif // cached? if( eFunc==GFX_eDepthFunc && gap_bOptimizeStateChanges) return; _sfStats.StartTimer(CStatForm::STI_GFXAPI); gleFunc = CompToOGL(eFunc); pglDepthFunc(gleFunc); OGL_CHECKERROR; GFX_eDepthFunc = eFunc; _sfStats.StopTimer(CStatForm::STI_GFXAPI); }