From a94c1a2945a31aa5d93e354da3bc80f59f253ec4 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 25 Nov 2011 00:20:06 +0100 Subject: Nativewindow AWT Device/Screen: Cleanup construction [default, specific]; AWTDevice: Remove subtype --- src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java | 4 +++- src/newt/classes/jogamp/newt/driver/awt/AWTDisplay.java | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/newt/classes') diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java index 390d96fde..b63e433f6 100644 --- a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java +++ b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java @@ -246,7 +246,9 @@ public class AWTCanvas extends Canvas { CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, GraphicsDevice device) { - AbstractGraphicsScreen aScreen = AWTGraphicsScreen.createScreenDevice(device, AbstractGraphicsDevice.DEFAULT_UNIT); + final AbstractGraphicsScreen aScreen = null != device ? + AWTGraphicsScreen.createScreenDevice(device, AbstractGraphicsDevice.DEFAULT_UNIT): + AWTGraphicsScreen.createDefault(); AWTGraphicsConfiguration config = (AWTGraphicsConfiguration) GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(capsChosen, capsRequested, diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTDisplay.java b/src/newt/classes/jogamp/newt/driver/awt/AWTDisplay.java index 64c741464..f4ee5f2df 100644 --- a/src/newt/classes/jogamp/newt/driver/awt/AWTDisplay.java +++ b/src/newt/classes/jogamp/newt/driver/awt/AWTDisplay.java @@ -33,7 +33,6 @@ package jogamp.newt.driver.awt; -import javax.media.nativewindow.AbstractGraphicsDevice; import javax.media.nativewindow.awt.AWTGraphicsDevice; import com.jogamp.newt.NewtFactory; import jogamp.newt.DisplayImpl; @@ -43,7 +42,7 @@ public class AWTDisplay extends DisplayImpl { } protected void createNativeImpl() { - aDevice = (AWTGraphicsDevice) AWTGraphicsDevice.createDevice(null, AbstractGraphicsDevice.DEFAULT_UNIT); // default + aDevice = AWTGraphicsDevice.createDefault(); } protected void setAWTGraphicsDevice(AWTGraphicsDevice d) { -- cgit v1.2.3