From 047d771fb7e489d9be242730e6189e6c412907d5 Mon Sep 17 00:00:00 2001 From: Benjamin Maus Date: Sat, 5 Oct 2013 18:35:55 +0200 Subject: [PATCH] Added reinitSurface() method to PGL/PJOGL backend. Does not destroy the active canvas and keeps the current capabilities, but triggers a reset of the allocated FBOs. --- core/src/processing/opengl/PGL.java | 3 +++ core/src/processing/opengl/PJOGL.java | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index aad1a8aaf..3053e86cf 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -328,6 +328,9 @@ public abstract class PGL { protected abstract void initSurface(int antialias); + protected abstract void reinitSurface(); + + protected abstract void registerListeners(); diff --git a/core/src/processing/opengl/PJOGL.java b/core/src/processing/opengl/PJOGL.java index f70587ad6..6aac7975a 100644 --- a/core/src/processing/opengl/PJOGL.java +++ b/core/src/processing/opengl/PJOGL.java @@ -311,6 +311,15 @@ public class PJOGL extends PGL { } + @Override + protected void reinitSurface() { + sinkFBO = backFBO = frontFBO = null; + fboLayerCreated = false; + fboLayerInUse = false; + firstFrame = true; + } + + @Override protected void registerListeners() { if (WINDOW_TOOLKIT == AWT) {