diff options
author | Sven Gothel <[email protected]> | 2011-11-10 17:14:51 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-11-10 17:14:51 +0100 |
commit | 0120a81c36ffc7455d196960048fe935f82fc9a6 (patch) | |
tree | c7933d3df1a645b277de9fd73eafa31a0c737d8f /src/jogl/classes/jogamp/opengl/macosx | |
parent | af083029321b3ff57c37f9426ecf5eb526b5e7ae (diff) |
OS X Layered View: Part6 (native) Using a root CALayer where we attach/detach our GL one
- it seems to be more stable, having one root CALayer attached to the JAWT_SurfaceView forever
- tackles crach at GL layer destruction
- proper release of all GL layer resources
- now final [gl-layer dealloc] happens at very destruction of JAWT object,
even though it was removed from root-layer earlier (and all other references)
- see comment in MacOSXWindowSystemInterface-pbuffer.m :: createNSOpenGLLayer(..)
- at least no more crash .. and resource release ASAP, but the GL-layer itself (see above)
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/macosx')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java index 8e845e847..b75d2f927 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java @@ -477,11 +477,11 @@ public abstract class MacOSXCGLContext extends GLContextImpl } else { texWidth = drawable.getWidth(); texHeight = drawable.getHeight(); - } + } nsOpenGLLayer = CGL.createNSOpenGLLayer(ctx, nsOpenGLLayerPFmt, drawable.getHandle(), fixedCaps.isBackgroundOpaque(), texWidth, texHeight); if (DEBUG) { System.err.println("NS create nsOpenGLLayer "+toHexString(nsOpenGLLayer)); - } + } lsh.attachSurfaceLayer(nsOpenGLLayer); } } finally { @@ -499,8 +499,8 @@ public abstract class MacOSXCGLContext extends GLContextImpl if (DEBUG) { System.err.println("NS destroy nsOpenGLLayer "+toHexString(nsOpenGLLayer)); } - lsh.attachSurfaceLayer(0); CGL.releaseNSOpenGLLayer(nsOpenGLLayer); + lsh.detachSurfaceLayer(nsOpenGLLayer); CGL.deletePixelFormat(nsOpenGLLayerPFmt); nsOpenGLLayerPFmt = 0; nsOpenGLLayer = 0; |