aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/macosx/cgl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-10-13 13:47:30 +0200
committerSven Gothel <[email protected]>2011-10-13 13:47:30 +0200
commit3fd89ccc138eddb915372cff4843f69f764048a7 (patch)
treee56ee402ffbec00220e4bead29b39a73b467f48e /src/jogl/classes/jogamp/opengl/macosx/cgl
parent5d33b0a3ef993ff2d257c90abc3d84bc93269cd0 (diff)
MacOSX: Always release ctx on main thread (offscreen was frozen as well); Cleanup Warnings and OSX ContextUpdater
-
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/macosx/cgl')
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java11
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLContext.java3
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java7
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXJava2DCGLContext.java4
4 files changed, 4 insertions, 21 deletions
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
index b35e38d02..383594d87 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -205,16 +205,9 @@ public abstract class MacOSXCGLContext extends GLContextImpl
if (CGL.kCGLNoError != CGL.CGLDestroyContext(contextHandle)) {
throw new GLException("Unable to delete OpenGL Context (CGL)");
}
- if (DEBUG) {
- System.err.println("!!! Destroyed OpenGL Context (CGL) " + toHexString(contextHandle));
- }
} else {
- final boolean isSharedContext = GLContextShareSet.isShared(this);
- if (!CGL.deleteContext(contextHandle, isSharedContext)) {
- throw new GLException("Unable to delete OpenGL Context (NS) "+toHexString(contextHandle)+", isShared "+isSharedContext);
- }
- if (DEBUG) {
- System.err.println("!!! Destroyed OpenGL Context (NS.s0) " + toHexString(contextHandle)+", isShared "+isSharedContext);
+ if (!CGL.deleteContext(contextHandle, true)) {
+ throw new GLException("Unable to delete OpenGL Context (NS) "+toHexString(contextHandle));
}
}
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLContext.java
index efc70e3dd..267578680 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLContext.java
@@ -343,9 +343,6 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext {
if (CGL.CGLDestroyContext(ctx) != CGL.kCGLNoError) {
throw new GLException("Unable to delete OpenGL context (cgl)");
}
- if (DEBUG) {
- System.err.println("!!! Destroyed OpenGL context (cgl)" + contextHandle);
- }
}
public boolean makeCurrent(long ctx) {
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
index ec9ff8dd2..2554b5f67 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
@@ -49,8 +49,8 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
private static final boolean DEBUG = Debug.debug("MacOSXPbufferCGLDrawable");
// State for render-to-texture and render-to-texture-rectangle support
- private int textureTarget; // e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV
- private int texture; // actual texture object
+ // private int textureTarget; // e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV
+ // private int texture; // actual texture object
// NSOpenGLPbuffer (for normal mode)
// CGLPbufferObj (for CGL_MODE situation, i.e., when Java2D/JOGL bridge is active)
@@ -91,9 +91,6 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
impl.destroy(pBuffer);
this.pBuffer = 0;
((SurfaceChangeable)ns).setSurfaceHandle(0);
- if (DEBUG) {
- System.err.println("Destroyed pbuffer: " + pBuffer);
- }
}
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXJava2DCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXJava2DCGLContext.java
index 8f64e0a28..5e661b321 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXJava2DCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXJava2DCGLContext.java
@@ -45,7 +45,6 @@ import java.awt.Graphics;
import javax.media.opengl.*;
import jogamp.opengl.*;
import jogamp.opengl.awt.*;
-import jogamp.opengl.macosx.cgl.*;
/** MacOSXCGLContext implementation supporting the Java2D/JOGL bridge
* on Mac OS X. The external GLDrawable mechanism does not work on Mac
@@ -119,9 +118,6 @@ public class MacOSXJava2DCGLContext extends MacOSXCGLContext implements Java2DGL
protected void destroyImpl() throws GLException {
Java2D.destroyOGLContext(contextHandle);
- if (DEBUG) {
- System.err.println("!!! Destroyed OpenGL context " + contextHandle);
- }
}
public void setOpenGLMode(int mode) {