From ef060165a91f3764bcb77e9873d6f7a6a3df42cf Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Mon, 3 Aug 2015 11:46:35 -0400 Subject: [PATCH] PGL: Separate multisampled buffers --- core/src/processing/opengl/PGL.java | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 39b209426..2e4d77ee3 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -142,13 +142,16 @@ public abstract class PGL { protected boolean firstFrame = true; public int reqNumSamples; protected int numSamples; + protected IntBuffer glColorFbo; - protected IntBuffer glMultiFbo; - protected IntBuffer glColorBuf; protected IntBuffer glColorTex; protected IntBuffer glDepthStencil; protected IntBuffer glDepth; protected IntBuffer glStencil; + + protected IntBuffer glMultiFbo; + protected IntBuffer glColorBuf; + protected int fboWidth, fboHeight; protected int backTex, frontTex; @@ -333,14 +336,15 @@ public abstract class PGL { public PGL(PGraphicsOpenGL pg) { this.pg = pg; if (glColorTex == null) { - glColorTex = allocateIntBuffer(2); glColorFbo = allocateIntBuffer(1); - glMultiFbo = allocateIntBuffer(1); - glColorBuf = allocateIntBuffer(1); + glColorTex = allocateIntBuffer(2); glDepthStencil = allocateIntBuffer(1); glDepth = allocateIntBuffer(1); glStencil = allocateIntBuffer(1); + glMultiFbo = allocateIntBuffer(1); + glColorBuf = allocateIntBuffer(1); + fboLayerCreated = false; fboLayerInUse = false; firstFrame = false; @@ -387,13 +391,14 @@ public abstract class PGL { protected void deleteSurface() { if (threadIsCurrent() && fboLayerCreated) { - deleteTextures(2, glColorTex); deleteFramebuffers(1, glColorFbo); - deleteFramebuffers(1, glMultiFbo); - deleteRenderbuffers(1, glColorBuf); + deleteTextures(2, glColorTex); deleteRenderbuffers(1, glDepthStencil); deleteRenderbuffers(1, glDepth); deleteRenderbuffers(1, glStencil); + + deleteFramebuffers(1, glMultiFbo); + deleteRenderbuffers(1, glColorBuf); } fboLayerCreated = false;