mirror of
https://github.com/processing/processing4.git
synced 2026-06-04 06:31:38 +02:00
ported latest round of changes to android
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -1102,6 +1102,11 @@ public class PGL {
|
||||
}
|
||||
|
||||
|
||||
public void glColorMask(boolean wr, boolean wg, boolean wb, boolean wa) {
|
||||
GLES20.glColorMask(wr, wg, wb, wa);
|
||||
}
|
||||
|
||||
|
||||
public void glClearColor(float r, float g, float b, float a) {
|
||||
GLES20.glClearColor(r, g, b, a);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import processing.core.PMatrix2D;
|
||||
import processing.core.PMatrix3D;
|
||||
import processing.core.PShape;
|
||||
import processing.core.PVector;
|
||||
import processing.opengl.PGraphicsOpenGL.Tessellator.TessellatorCallback;
|
||||
|
||||
import java.net.URL;
|
||||
import java.nio.*;
|
||||
@@ -1564,9 +1565,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);
|
||||
@@ -1646,7 +1646,21 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
}
|
||||
|
||||
popFramebuffer();
|
||||
|
||||
|
||||
// Make the offscreen color buffer opaque so it doesn't show
|
||||
// the background when drawn on the main surface.
|
||||
if (offscreenMultisample) {
|
||||
pushFramebuffer();
|
||||
setFramebuffer(offscreenFramebuffer);
|
||||
}
|
||||
pgl.glColorMask(false, false, false, true);
|
||||
pgl.glClearColor(0, 0, 0, 1);
|
||||
pgl.glClear(PGL.GL_COLOR_BUFFER_BIT);
|
||||
pgl.glColorMask(true, true, true, true);
|
||||
if (offscreenMultisample) {
|
||||
popFramebuffer();
|
||||
}
|
||||
|
||||
pgl.endOffscreenDraw(pgPrimary.clearColorBuffer0);
|
||||
|
||||
pgPrimary.restoreGL();
|
||||
@@ -4692,9 +4706,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);
|
||||
|
||||
Reference in New Issue
Block a user