Newer
Older
{
gGL.flush();
glDepthFunc(mPrevDepthFunc);
sDepthFunc = mPrevDepthFunc;
}
if (sWriteEnabled != mPrevWriteEnabled )
{
gGL.flush();
glDepthMask(mPrevWriteEnabled);
sWriteEnabled = mPrevWriteEnabled;
}
}
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
void LLGLDepthTest::checkState()
{
if (gDebugGL)
{
GLint func = 0;
GLboolean mask = FALSE;
glGetIntegerv(GL_DEPTH_FUNC, &func);
glGetBooleanv(GL_DEPTH_WRITEMASK, &mask);
if (glIsEnabled(GL_DEPTH_TEST) != sDepthEnabled ||
sWriteEnabled != mask ||
sDepthFunc != func)
{
if (gDebugSession)
{
gFailLog << "Unexpected depth testing state." << std::endl;
}
else
{
LL_GL_ERRS << "Unexpected depth testing state." << LL_ENDL;
}
}
}
}
LLGLClampToFarClip::LLGLClampToFarClip(glh::matrix4f P)
{
for (U32 i = 0; i < 4; i++)
{
P.element(2, i) = P.element(3, i) * 0.99999f;
}
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadMatrixf(P.m);
glMatrixMode(GL_MODELVIEW);
}
LLGLClampToFarClip::~LLGLClampToFarClip()
{
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
}