Commit 9d73bba0 authored by nadro's avatar nadro

- Moved DepthTest from COpenGLCacheHandler to COGLCoreCacheHandler.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5178 dfc29bdd-3216-0410-991c-e03cc46cb475
parent c6fd504c
......@@ -157,7 +157,7 @@ public:
Driver(driver), TextureCache(STextureCache(this, Driver->getFeature().TextureUnit)), FrameBufferCount(0),
BlendEquation(0), BlendSourceRGB(0), BlendDestinationRGB(0), BlendSourceAlpha(0), BlendDestinationAlpha(0),
Blend(0), ColorMask(0), CullFaceMode(GL_BACK), CullFace(false), DepthFunc(GL_LESS), DepthMask(true),
FrameBufferID(0), ProgramID(0), ActiveTexture(GL_TEXTURE0), ViewportX(0), ViewportY(0)
DepthTest(false), FrameBufferID(0), ProgramID(0), ActiveTexture(GL_TEXTURE0), ViewportX(0), ViewportY(0)
{
const COGLCoreFeature& feature = Driver->getFeature();
......@@ -204,6 +204,7 @@ public:
glDepthFunc(DepthFunc);
glDepthMask(GL_TRUE);
glDisable(GL_DEPTH_TEST);
Driver->irrGlActiveTexture(ActiveTexture);
......@@ -442,6 +443,18 @@ public:
}
}
void setDepthTest(bool enable)
{
if (DepthTest != enable)
{
if (enable)
glEnable(GL_DEPTH_TEST);
else
glDisable(GL_DEPTH_TEST);
DepthTest = enable;
}
}
// FBO calls.
void getFBO(GLuint& frameBufferID) const
......@@ -533,6 +546,7 @@ protected:
GLenum DepthFunc;
bool DepthMask;
bool DepthTest;
GLuint FrameBufferID;
......
......@@ -17,7 +17,7 @@ namespace video
COpenGLCacheHandler::COpenGLCacheHandler(COpenGLDriver* driver) :
COGLCoreCacheHandler<COpenGLDriver, COpenGLTexture>(driver), AlphaMode(GL_ALWAYS), AlphaRef(0.f), AlphaTest(false),
DepthTest(false), MatrixMode(GL_MODELVIEW), ClientActiveTexture(GL_TEXTURE0), ClientStateVertex(false),
MatrixMode(GL_MODELVIEW), ClientActiveTexture(GL_TEXTURE0), ClientStateVertex(false),
ClientStateNormal(false), ClientStateColor(false), ClientStateTexCoord0(false)
{
// Initial OpenGL values from specification.
......@@ -25,7 +25,7 @@ COpenGLCacheHandler::COpenGLCacheHandler(COpenGLDriver* driver) :
glAlphaFunc(AlphaMode, AlphaRef);
glDisable(GL_ALPHA_TEST);
glDisable(GL_DEPTH_TEST);
glMatrixMode(MatrixMode);
......@@ -109,18 +109,6 @@ void COpenGLCacheHandler::setClientState(bool vertex, bool normal, bool color, b
}
}
void COpenGLCacheHandler::setDepthTest(bool enable)
{
if (DepthTest != enable)
{
if (enable)
glEnable(GL_DEPTH_TEST);
else
glDisable(GL_DEPTH_TEST);
DepthTest = enable;
}
}
void COpenGLCacheHandler::setMatrixMode(GLenum mode)
{
if (MatrixMode != mode)
......
......@@ -35,10 +35,6 @@ namespace video
void setClientState(bool vertex, bool normal, bool color, bool texCoord0);
// Depth calls.
void setDepthTest(bool enable);
// Matrix calls.
void setMatrixMode(GLenum mode);
......@@ -52,8 +48,6 @@ namespace video
GLclampf AlphaRef;
bool AlphaTest;
bool DepthTest;
GLenum MatrixMode;
GLenum ClientActiveTexture;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment