aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-12-17 21:53:48 +0100
committerSven Gothel <[email protected]>2011-12-17 21:53:48 +0100
commit8e0f3ad54b5aa8ef4d71e0b85f84a34be4987b5e (patch)
tree5ac1839053c5d5458e48d4646f1b19499fd752ec /src/newt/classes/jogamp
parent47dc069104723f3d2e8d9ebdd700182e067163d0 (diff)
New Interface 'OffscreenLayerOption', impl. by JAWTWindow (impl) and NewtCanvasAWT/GLCanvas (delegation) ; Fix GLCanvas OffscreenLayerSurface usage.
JAWTWindow.destroy(): - No more getGraphicsConfiguration().getScreen().getDevice().close() call, since the configuration (hence the device) is passed @ creation and owned by the caller. New Interface 'OffscreenLayerOption', impl. by JAWTWindow (impl) and NewtCanvasAWT/GLCanvas (delegation) - Abstract offscreenLayer option to be delegated by using classes - Allow offscreen testing of GLCanvas as well (like NewtCanvasAWT) Fix GLCanvas OffscreenLayerSurface usage - common 'createDrawableAndContext()' for context and drawable instance creation - addNotify() calls createDrawableAndContext() after super.addNotify() to be able to lock the surface (JAWTWindow) and hence to determine offscreen usage. - reshape(...) issues recreation 'dispose(true)' in case of using an offscreen layer - dispose() explicitly destroys the JAWTWindow NewtCanvasAWT: - explicitly close the device of the JAWTWindow (as GLCanvas does) Tests: com.jogamp.opengl.test.junit.newt.parenting.TestParentingOffscreenLayer01GLCanvasAWT com.jogamp.opengl.test.junit.newt.parenting.TestParentingOffscreenLayer02NewtCanvasAWT
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r--src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java b/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
index ea4960053..2ca3d2cfd 100644
--- a/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
+++ b/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
@@ -28,6 +28,7 @@
package jogamp.newt.awt;
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
import javax.media.nativewindow.CapabilitiesImmutable;
import javax.media.nativewindow.NativeWindow;
import javax.media.nativewindow.NativeWindowException;
@@ -74,6 +75,13 @@ public class NewtFactoryAWT extends NewtFactory {
System.err.println("NewtFactoryAWT.getNativeWindow: "+awtComp+" -> "+nw);
}
return (JAWTWindow)nw;
- }
+ }
+
+ public static void destroyNativeWindow(JAWTWindow jawtWindow) {
+ final AbstractGraphicsConfiguration config = jawtWindow.getGraphicsConfiguration();
+ jawtWindow.destroy();
+ config.getScreen().getDevice().close();
+ }
+
}