Add glClearColor and glClearDepth

This commit is contained in:
baldurk
2014-05-30 22:54:19 +01:00
parent 05da325796
commit 8a4b32f2a3
3 changed files with 52 additions and 3 deletions
+2
View File
@@ -117,6 +117,8 @@ enum GLChunkType
ROTATEF,
//
CLEAR_COLOR,
CLEAR_DEPTH,
CLEAR,
CLEARBUFFERF,
ENABLE,
+41 -2
View File
@@ -193,18 +193,57 @@ void WrappedOpenGL::glBlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum
}
}
bool WrappedOpenGL::Serialise_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
SERIALISE_ELEMENT(float, r, red);
SERIALISE_ELEMENT(float, g, green);
SERIALISE_ELEMENT(float, b, blue);
SERIALISE_ELEMENT(float, a, alpha);
if(m_State <= EXECUTING)
{
m_Real.glClearColor(r, g, b, a);
}
return true;
}
void WrappedOpenGL::glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
m_Real.glClearColor(red, green, blue, alpha);
RDCUNIMPLEMENTED();
if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(CLEAR_COLOR);
Serialise_glClearColor(red, green, blue, alpha);
m_ContextRecord->AddChunk(scope.Get());
}
}
bool WrappedOpenGL::Serialise_glClearDepth(GLclampd depth)
{
SERIALISE_ELEMENT(double, d, depth);
if(m_State <= EXECUTING)
{
m_Real.glClearDepth(d);
}
return true;
}
void WrappedOpenGL::glClearDepth(GLclampd depth)
{
m_Real.glClearDepth(depth);
RDCUNIMPLEMENTED();
if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(CLEAR_DEPTH);
Serialise_glClearDepth(depth);
m_ContextRecord->AddChunk(scope.Get());
}
}
bool WrappedOpenGL::Serialise_glDepthFunc(GLenum func)
+9 -1
View File
@@ -74,6 +74,8 @@ const char *GLChunkNames[] =
"glRotatef",
//
"glClearColor",
"glClearDepth",
"glClear",
"glClearBufferfv",
"glEnable",
@@ -960,7 +962,13 @@ void WrappedOpenGL::ProcessChunk(uint64_t offset, GLChunkType context)
case BIND_SAMPLER:
Serialise_glBindSampler(0, 0);
break;
case CLEAR_COLOR:
Serialise_glClearColor(0, 0, 0, 0);
break;
case CLEAR_DEPTH:
Serialise_glClearDepth(0);
break;
case CLEAR:
Serialise_glClear(0);
break;