mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-26 22:01:26 +00:00
Fix clear warning
This commit is contained in:
parent
18ff65fb0e
commit
01f9a2d27a
2 changed files with 11 additions and 6 deletions
|
@ -335,7 +335,7 @@ GLuint FGLRenderBuffers::CreateFrameBuffer(const FString &name, GLuint colorbuff
|
||||||
FGLDebug::LabelObject(GL_FRAMEBUFFER, handle, name);
|
FGLDebug::LabelObject(GL_FRAMEBUFFER, handle, name);
|
||||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorbuffer, 0);
|
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorbuffer, 0);
|
||||||
CheckFrameBufferCompleteness();
|
CheckFrameBufferCompleteness();
|
||||||
ClearFrameBuffer();
|
ClearFrameBuffer(false, false);
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,7 +351,7 @@ GLuint FGLRenderBuffers::CreateFrameBuffer(const FString &name, GLuint colorbuff
|
||||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorbuffer, 0);
|
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorbuffer, 0);
|
||||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, depthstencil);
|
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, depthstencil);
|
||||||
CheckFrameBufferCompleteness();
|
CheckFrameBufferCompleteness();
|
||||||
ClearFrameBuffer();
|
ClearFrameBuffer(true, true);
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ GLuint FGLRenderBuffers::CreateFrameBuffer(const FString &name, GLuint colorbuff
|
||||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depth);
|
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depth);
|
||||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, stencil);
|
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, stencil);
|
||||||
CheckFrameBufferCompleteness();
|
CheckFrameBufferCompleteness();
|
||||||
ClearFrameBuffer();
|
ClearFrameBuffer(true, true);
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,7 +406,7 @@ void FGLRenderBuffers::CheckFrameBufferCompleteness()
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void FGLRenderBuffers::ClearFrameBuffer()
|
void FGLRenderBuffers::ClearFrameBuffer(bool stencil, bool depth)
|
||||||
{
|
{
|
||||||
GLboolean scissorEnabled;
|
GLboolean scissorEnabled;
|
||||||
GLint stencilValue;
|
GLint stencilValue;
|
||||||
|
@ -418,7 +418,12 @@ void FGLRenderBuffers::ClearFrameBuffer()
|
||||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||||
glClearDepth(0.0);
|
glClearDepth(0.0);
|
||||||
glClearStencil(0);
|
glClearStencil(0);
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
GLenum flags = GL_COLOR_BUFFER_BIT;
|
||||||
|
if (stencil)
|
||||||
|
flags |= GL_STENCIL_BUFFER_BIT;
|
||||||
|
if (depth)
|
||||||
|
flags |= GL_DEPTH_BUFFER_BIT;
|
||||||
|
glClear(flags);
|
||||||
glClearStencil(stencilValue);
|
glClearStencil(stencilValue);
|
||||||
glClearDepth(depthValue);
|
glClearDepth(depthValue);
|
||||||
if (scissorEnabled)
|
if (scissorEnabled)
|
||||||
|
|
|
@ -54,7 +54,7 @@ private:
|
||||||
GLuint CreateFrameBuffer(const FString &name, GLuint colorbuffer, GLuint depthstencil, bool colorIsARenderBuffer);
|
GLuint CreateFrameBuffer(const FString &name, GLuint colorbuffer, GLuint depthstencil, bool colorIsARenderBuffer);
|
||||||
GLuint CreateFrameBuffer(const FString &name, GLuint colorbuffer, GLuint depth, GLuint stencil, bool colorIsARenderBuffer);
|
GLuint CreateFrameBuffer(const FString &name, GLuint colorbuffer, GLuint depth, GLuint stencil, bool colorIsARenderBuffer);
|
||||||
void CheckFrameBufferCompleteness();
|
void CheckFrameBufferCompleteness();
|
||||||
void ClearFrameBuffer();
|
void ClearFrameBuffer(bool stencil, bool depth);
|
||||||
void DeleteTexture(GLuint &handle);
|
void DeleteTexture(GLuint &handle);
|
||||||
void DeleteRenderBuffer(GLuint &handle);
|
void DeleteRenderBuffer(GLuint &handle);
|
||||||
void DeleteFrameBuffer(GLuint &handle);
|
void DeleteFrameBuffer(GLuint &handle);
|
||||||
|
|
Loading…
Reference in a new issue