From e3d8f7832c5090463e1041920cc907af323b7ad4 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sun, 19 Mar 2006 02:25:03 +0000 Subject: Made MacOSXOnscreenGLContext obey disabling of optimized context handling git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@670 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/classes/com/sun/opengl/impl/macosx') diff --git a/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java b/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java index e011d271b..977e3315c 100644 --- a/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java +++ b/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java @@ -77,12 +77,24 @@ public class MacOSXOnscreenGLContext extends MacOSXGLContext { } return ret; } finally { - if (lockRes != MacOSXOnscreenGLDrawable.LOCK_SURFACE_NOT_READY) { - drawable.unlockSurface(); + if (optimizationEnabled) { + if (lockRes != MacOSXOnscreenGLDrawable.LOCK_SURFACE_NOT_READY) { + drawable.unlockSurface(); + } } } } + protected void releaseImpl() throws GLException { + if (!optimizationEnabled) { + try { + super.releaseImpl(); + } finally { + drawable.unlockSurface(); + } + } + } + public void swapBuffers() throws GLException { if (!CGL.flushBuffer(nsContext)) { throw new GLException("Error swapping buffers"); -- cgit v1.2.3