From 9b35c57425b0a5f6b789b9b43a62a8b64be51d86 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
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)
---
 .../jogamp/opengl/x11/glx/X11DummyGLXDrawable.java       | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/x11/glx/X11DummyGLXDrawable.java')

diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11DummyGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11DummyGLXDrawable.java
index 65f65a2ec..8914e2db9 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11DummyGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11DummyGLXDrawable.java
@@ -86,13 +86,17 @@ public class X11DummyGLXDrawable extends X11OnscreenGLXDrawable {
   public int getHeight() {
     return 1;
   }
-
+  
+  
   @Override
-  protected void destroyImpl() {
-    if(0!=dummyWindow) {
-        destroyHandle();
-        X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
-        X11Lib.DestroyDummyWindow(config.getScreen().getDevice().getHandle(), dummyWindow);
+  protected void setRealizedImpl() {
+    super.setRealizedImpl();
+    if(!realized) {
+        if(0!=dummyWindow) {
+            destroyHandle();
+            X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
+            X11Lib.DestroyDummyWindow(config.getScreen().getDevice().getHandle(), dummyWindow);
+        }
     }
   }
 }
-- 
cgit v1.2.3