mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-27 20:31:02 +00:00
Add glClearColor and glClearDepth
This commit is contained in:
@@ -117,6 +117,8 @@ enum GLChunkType
|
||||
ROTATEF,
|
||||
//
|
||||
|
||||
CLEAR_COLOR,
|
||||
CLEAR_DEPTH,
|
||||
CLEAR,
|
||||
CLEARBUFFERF,
|
||||
ENABLE,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user