diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 40f5d69b5..ac429025d 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -295,6 +295,7 @@ public class PGL { /////////////////////////////////////////////////////////// // FBO layer + protected static boolean fboLayerRequested = false; protected static boolean fboLayerCreated = false; protected static boolean fboLayerInUse = false; @@ -588,19 +589,6 @@ public class PGL { } - protected void update() { - if (!setFps) setFps(targetFps); - - if (fboLayerRequested && !fboLayerCreated && !USE_JOGL_FBOLAYER) { - createFBOLayer(); - } -// if (USE_JOGL_FBOLAYER) return; -// if (!fboLayerCreated) { -// createFBOLayer(); -// } - } - - protected int getReadFramebuffer() { if (fboLayerInUse) { return glColorFbo.get(0); @@ -993,9 +981,13 @@ public class PGL { protected void beginDraw(boolean clear0) { + if (!setFps) setFps(targetFps); + if (USE_JOGL_FBOLAYER) return; if (needFBOLayer(clear0)) { + if (!fboLayerCreated) createFBOLayer(); + bindFramebuffer(FRAMEBUFFER, glColorFbo.get(0)); framebufferTexture2D(FRAMEBUFFER, COLOR_ATTACHMENT0, TEXTURE_2D, glColorTex.get(backTex), 0); diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 314e1d4cf..8512aab4e 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -5852,13 +5852,7 @@ public class PGraphicsOpenGL extends PGraphics { } - protected void updatePrimary() { - pgl.update(); - } - - protected void beginOnscreenDraw() { - updatePrimary(); pgl.beginDraw(clearColorBuffer); if (drawFramebuffer == null) { @@ -5939,7 +5933,7 @@ public class PGraphicsOpenGL extends PGraphics { } - protected void updateOffscreen() { + protected void beginOffscreenDraw() { if (!initialized) { initOffscreen(); } else { @@ -5964,11 +5958,7 @@ public class PGraphicsOpenGL extends PGraphics { } else { setFramebuffer(offscreenFramebuffer); } - } - - protected void beginOffscreenDraw() { - updateOffscreen(); // Render previous back texture (now is the front) as background drawPTexture();