summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java6
-rw-r--r--src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
index 2a152ff35..7e3d30a47 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
@@ -74,8 +74,9 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
/**
* @param capsChosen if null, <code>capsRequested</code> is copied and aligned
- * with the graphics Capabilities of the AWT Component to produce the chosen Capabilities.
+ * with the graphics {@link Capabilities} of the AWT Component to produce the chosen {@link Capabilities}.
* Otherwise the <code>capsChosen</code> is used.
+ * @param capsRequested if null, default {@link Capabilities} are used, otherwise the given values.
*/
public static AWTGraphicsConfiguration create(Component awtComp, CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) {
final GraphicsConfiguration awtGfxConfig = awtComp.getGraphicsConfiguration();
@@ -91,6 +92,9 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
final AWTGraphicsDevice awtDevice = new AWTGraphicsDevice(awtGraphicsDevice, AbstractGraphicsDevice.DEFAULT_UNIT);
final AWTGraphicsScreen awtScreen = new AWTGraphicsScreen(awtDevice);
+ if(null==capsRequested) {
+ capsRequested = new Capabilities();
+ }
if(null==capsChosen) {
GraphicsConfiguration gc = awtGraphicsDevice.getDefaultConfiguration();
capsChosen = AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capsRequested, gc);
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
index d0a4b7e98..32a92ec8b 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
@@ -355,8 +355,8 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
// after native peer is valid: Windows
disableBackgroundErase();
-
- jawtWindow = NewtFactoryAWT.getNativeWindow(this, newtChild.getRequestedCapabilities());
+
+ jawtWindow = NewtFactoryAWT.getNativeWindow(this, null != newtChild ? newtChild.getRequestedCapabilities() : null);
jawtWindow.setShallUseOffscreenLayer(shallUseOffscreenLayer);
if(DEBUG) {