From 9b35c57425b0a5f6b789b9b43a62a8b64be51d86 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 4 Jul 2012 18:02:11 +0200 Subject: GLAutoDrawable* refinement of abstraction / generalization - API Change! - GLAutoDrawable (compat change - recompile): - 'void invoke(boolean wait, GLRunnable glRunnable)' -> 'boolean invoke(boolean wait, GLRunnable glRunnable)' Allows notifying caller whether the task has been executed or at least enqueued. - GLAutoDrawable add 'GLEventListener removeGLEventListener(int index)' - This allow one to remove a specific GLEventListener and reusing it (return value). - GLDrawableImpl remove 'destroy()' to favor 'setRealized(false)' - Using more common code of GLAutoDrawableBase, i.e. GLPbufferImpl can use defaultDestroyOp(). - Removes redundancy of methods - GLAutoDrawableBase/Delegate - better 'default' names to emphasize it's purpose, adding API doc - includes more generic functionality - defaultWindowDestroyNotify() - defaultDestroyOp() - TestGLAutoDrawableDelegateNEWT demonstrates a simple example w/ all window events handled. - Fix TestParenting01cSwingAWT's threading use (gl disturbance thread) --- src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java | 3 +-- .../classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java | 2 +- .../classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java | 5 ----- 3 files changed, 2 insertions(+), 8 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/macosx') diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java index cae60702b..257635b8c 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java @@ -151,8 +151,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl { if (haveSetOpenGLMode) { throw new GLException("Can't switch between using NSOpenGLPixelBuffer and CGLPBufferObj more than once"); } - - destroyImpl(); + setRealized(false); if (DEBUG) { System.err.println("MacOSXCGLDrawable: Switching context mode " + openGLMode + " -> " + mode); } diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java index 6bdabbf59..4e9d18fed 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java @@ -250,7 +250,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { } } } - drawable.destroy(); + drawable.setRealized(false); } } sr = new SharedResource(sharedDevice, madeCurrent, hasNPOTTextures, hasRECTTextures, hasAppleFloatPixels); diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java index 33021c521..242cea068 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java @@ -79,11 +79,6 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable { super(factory, target, false); } - @Override - protected void destroyImpl() { - setRealized(false); - } - @Override protected void setRealizedImpl() { if(realized) { -- cgit v1.2.3