Move framebuffer unbinding to GLState

This commit is contained in:
James Seibel
2023-09-09 18:26:00 -05:00
parent 2d1729d325
commit 7d84e05b1f
2 changed files with 3 additions and 3 deletions
@@ -120,6 +120,9 @@ public class GLState
public void RestoreFrameBuffer()
{
// explicitly unbinding the frame buffer is necessary to prevent GL_CLEAR calls from hitting the wrong buffer
GL32.glBindFramebuffer(GL32.GL_FRAMEBUFFER, 0);
for (int i = 0; i < FBO_MAX; i++)
{
int buffer = this.fbo[i];
@@ -116,9 +116,6 @@ public abstract class AbstractShaderRenderer
GL32.glBlendFunc(GL32.GL_SRC_ALPHA, GL32.GL_ONE_MINUS_SRC_ALPHA);
GL32.glDrawArrays(GL32.GL_TRIANGLES, 0, 6);
// explicitly unbinding the frame buffer is necessary to prevent GL_CLEAR calls from hitting the wrong buffer
GL32.glBindFramebuffer(GL32.GL_FRAMEBUFFER, 0);
state.restore();
}