diff options
author | Sven Gothel <[email protected]> | 2011-11-25 03:09:47 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-11-25 03:09:47 +0100 |
commit | c59ac4647b6084181ce17cc594e9343ebe8f6d56 (patch) | |
tree | 21fcec1507770a5dcc286a92e84a9d841d42c06a | |
parent | 0314be79a7a93931a74fe4322bc78e699d7741e9 (diff) |
Complete commit bafd9b99816f55c105230a59211caf13f0315910 (NEWT):
- WindowImpl exposes private non-delegated GraphicsConfiguration,
- which is being used by GLWindow's wrapped NativeWindow instantiation (eg: AWT driver)
- Fix NewtFactoryAWT.getNativeWindow() use AWTGraphicsConfiguration.create(..)
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 2 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 7 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java | 16 |
3 files changed, 16 insertions, 9 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index 5566837f0..b2a44dbf6 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -408,7 +408,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC if (null == context && visible && 0 != window.getWindowHandle() && 0<getWidth()*getHeight()) { NativeWindow nw; if (window.getWrappedWindow() != null) { - nw = NativeWindowFactory.getNativeWindow(window.getWrappedWindow(), window.getGraphicsConfiguration()); + nw = NativeWindowFactory.getNativeWindow(window.getWrappedWindow(), window.getPrivateGraphicsConfiguration()); } else { nw = window; } diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 5e211011c..83688ef3e 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -1497,6 +1497,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer // WindowImpl // + /** + * Returns the non delegated {@link AbstractGraphicsConfiguration}, + * see {@link #getGraphicsConfiguration()}. */ + public final AbstractGraphicsConfiguration getPrivateGraphicsConfiguration() { + return config; + } + protected final long getParentWindowHandle() { return isFullscreen() ? 0 : parentWindowHandle; } diff --git a/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java b/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java index a551ae689..ea4960053 100644 --- a/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java +++ b/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java @@ -26,19 +26,19 @@ * or implied, of JogAmp Community. */ - package jogamp.newt.awt; - -import javax.media.nativewindow.*; -import javax.media.nativewindow.awt.*; - -import com.jogamp.newt.NewtFactory; +import javax.media.nativewindow.CapabilitiesImmutable; +import javax.media.nativewindow.NativeWindow; +import javax.media.nativewindow.NativeWindowException; +import javax.media.nativewindow.NativeWindowFactory; +import javax.media.nativewindow.awt.AWTGraphicsConfiguration; import jogamp.nativewindow.jawt.JAWTWindow; -import jogamp.nativewindow.x11.awt.X11AWTGraphicsConfigurationFactory; import jogamp.newt.Debug; +import com.jogamp.newt.NewtFactory; + public class NewtFactoryAWT extends NewtFactory { public static final boolean DEBUG_IMPLEMENTATION = Debug.debug("Window"); @@ -65,7 +65,7 @@ public class NewtFactoryAWT extends NewtFactory { } public static JAWTWindow getNativeWindow(java.awt.Component awtComp, CapabilitiesImmutable capsRequested) { - AWTGraphicsConfiguration config = X11AWTGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(awtComp, null, capsRequested); + AWTGraphicsConfiguration config = AWTGraphicsConfiguration.create(awtComp, null, capsRequested); NativeWindow nw = NativeWindowFactory.getNativeWindow(awtComp, config); // a JAWTWindow if(! ( nw instanceof JAWTWindow ) ) { throw new NativeWindowException("Not an AWT NativeWindow: "+nw); |