From 9ccaa0d9f573d7edc915d4074c73da3f475de903 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Mon, 25 Jun 2012 21:10:51 +0000 Subject: [PATCH] don't call releaseScreenFBO --- java/libraries/opengl/src/processing/opengl/PGL.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/java/libraries/opengl/src/processing/opengl/PGL.java b/java/libraries/opengl/src/processing/opengl/PGL.java index d50c418e5..1a36dc697 100644 --- a/java/libraries/opengl/src/processing/opengl/PGL.java +++ b/java/libraries/opengl/src/processing/opengl/PGL.java @@ -370,6 +370,7 @@ public class PGL { protected int[] multiFBO = { 0 }; protected int[] colorRenderBuffer = { 0 }; protected int[] packedDepthStencil = { 0 }; + protected int contextHashCode; /////////////////////////////////////////////////////////////////////////////////// @@ -502,10 +503,7 @@ public class PGL { public void initPrimarySurface(int antialias) { if (ENABLE_OSX_SCREEN_FBO) { needScreenFBO = false; - if (colorFBO[0] != 0) { - releaseScreenFBO(); - colorFBO[0] = 0; - } + colorFBO[0] = 0; String osName = System.getProperty("os.name"); if (osName.equals("Mac OS X")) { String version = System.getProperty("os.version"); @@ -621,6 +619,8 @@ public class PGL { throw new RuntimeException("Catastrophic error: cannot create multisampled surface for rendering... sorry!"); } + contextHashCode = context.hashCode(); + // Create the color texture... gl.glGenTextures(1, colorTex, 0); gl.glBindTexture(GL.GL_TEXTURE_2D, colorTex[0]); @@ -719,7 +719,7 @@ public class PGL { } - protected void releaseScreenFBO() { + protected void releaseScreenFBO() { gl.glDeleteTextures(1, colorTex, 0); gl.glDeleteFramebuffers(1, colorFBO, 0); gl.glDeleteFramebuffers(1, multiFBO, 0);