now grouping glClear calls

This commit is contained in:
codeanticode
2012-06-20 20:47:27 +00:00
parent 95a09b83a8
commit d1fceedd9d
3 changed files with 7 additions and 16 deletions

View File

@@ -167,11 +167,9 @@ public class FrameBuffer implements PConstants {
pg.pushFramebuffer();
pg.setFramebuffer(this);
pgl.glClearDepth(1);
pgl.glClear(PGL.GL_DEPTH_BUFFER_BIT);
pgl.glClearStencil(0);
pgl.glClear(PGL.GL_STENCIL_BUFFER_BIT);
pgl.glClearColor(0, 0, 0, 0);
pgl.glClear(PGL.GL_COLOR_BUFFER_BIT);
pgl.glClear(PGL.GL_DEPTH_BUFFER_BIT | PGL.GL_STENCIL_BUFFER_BIT | PGL.GL_COLOR_BUFFER_BIT);
pg.popFramebuffer();
}

View File

@@ -709,12 +709,9 @@ public class PGL {
gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0);
// And finally write the color texture to the screen.
glClearDepth(1);
glClear(GL_DEPTH_BUFFER_BIT);
glClearStencil(0);
glClear(GL_STENCIL_BUFFER_BIT);
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
gl.glClearDepth(1);
gl.glClearColor(0, 0, 0, 0);
gl.glClear(GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT);
drawTexture(GL.GL_TEXTURE_2D, colorTex[0], fboWidth, fboHeight, 0, 0, pg.width, pg.height, 0, 0, pg.width, pg.height);
PGraphicsOpenGL.screenFramebuffer.glFboID = colorFBO[0];
@@ -1290,8 +1287,8 @@ public class PGL {
public void glClearStencil(int s) {
gl.glClearStencil(s);
}
public void glClearColor(float r, float g, float b, float a) {
gl.glClearColor(r, g, b, a);
}

View File

@@ -1564,9 +1564,8 @@ public class PGraphicsOpenGL extends PGraphics {
// Clear depth and stencil buffers.
pgl.glDepthMask(true);
pgl.glClearDepth(1);
pgl.glClear(PGL.GL_DEPTH_BUFFER_BIT);
pgl.glClearStencil(0);
pgl.glClear(PGL.GL_STENCIL_BUFFER_BIT);
pgl.glClear(PGL.GL_DEPTH_BUFFER_BIT | PGL.GL_STENCIL_BUFFER_BIT);
if (primarySurface) {
pgl.beginOnscreenDraw(clearColorBuffer);
@@ -4692,9 +4691,6 @@ public class PGraphicsOpenGL extends PGraphics {
} else {
pgl.glDepthMask(true);
}
pgl.glClearStencil(0);
pgl.glClear(PGL.GL_STENCIL_BUFFER_BIT);
pgl.glClearColor(backgroundR, backgroundG, backgroundB, backgroundA);
pgl.glClear(PGL.GL_COLOR_BUFFER_BIT);