修正在某些情况下OpenGL矩形裁剪闪屏的bug

This commit is contained in:
u0u0
2022-06-17 15:40:14 +08:00
parent 6913389f55
commit c3c97846d6

View File

@@ -374,6 +374,7 @@ void CommandBufferGL::drawElements(PrimitiveType primitiveType, IndexFormat inde
void CommandBufferGL::endRenderPass()
{
glDisable(GL_SCISSOR_TEST);
}
void CommandBufferGL::endFrame()
@@ -599,21 +600,14 @@ void CommandBufferGL::setLineWidth(float lineWidth)
glLineWidth(lineWidth);
else
glLineWidth(1.0f);
}
void CommandBufferGL::setScissorRect(bool isEnabled, float x, float y, float width, float height)
{
if(isEnabled)
{
if (isEnabled) {
glEnable(GL_SCISSOR_TEST);
glScissor(x, y, width, height);
}
else
{
glDisable(GL_SCISSOR_TEST);
}
}
void CommandBufferGL::captureScreen(std::function<void(const unsigned char*, int, int)> callback)