diff options
author | Sven Gothel <[email protected]> | 2011-02-25 04:37:58 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-02-25 04:37:58 +0100 |
commit | 6188d6a385056adade49fcb6d8247f94f96d402e (patch) | |
tree | 7c1b29904fa11fad792f99ea66cfdeb6fb434d5a /src/newt/classes | |
parent | 60bef22a93d3406b960f059299bd31c72dcad959 (diff) |
Avoid NPE, incr. test poll, ..
Diffstat (limited to 'src/newt/classes')
-rw-r--r-- | src/newt/classes/jogamp/newt/awt/AWTScreen.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/newt/classes/jogamp/newt/awt/AWTScreen.java b/src/newt/classes/jogamp/newt/awt/AWTScreen.java index 83d7be57c..d05933321 100644 --- a/src/newt/classes/jogamp/newt/awt/AWTScreen.java +++ b/src/newt/classes/jogamp/newt/awt/AWTScreen.java @@ -33,11 +33,11 @@ package jogamp.newt.awt; -import com.jogamp.newt.*; -import jogamp.newt.ScreenImpl; import java.awt.DisplayMode; -import javax.media.nativewindow.*; -import javax.media.nativewindow.awt.*; + +import jogamp.newt.ScreenImpl; +import javax.media.nativewindow.awt.AWTGraphicsDevice; +import javax.media.nativewindow.awt.AWTGraphicsScreen; public class AWTScreen extends ScreenImpl { public AWTScreen() { @@ -46,10 +46,10 @@ public class AWTScreen extends ScreenImpl { protected void createNativeImpl() { aScreen = new AWTGraphicsScreen((AWTGraphicsDevice)display.getGraphicsDevice()); - DisplayMode mode = ((AWTGraphicsDevice)getDisplay().getGraphicsDevice()).getGraphicsDevice().getDisplayMode(); - int w = mode.getWidth(); - int h = mode.getHeight(); - setScreenSize(w, h); + final DisplayMode mode = ((AWTGraphicsDevice)getDisplay().getGraphicsDevice()).getGraphicsDevice().getDisplayMode(); + if(null != mode) { + setScreenSize(mode.getWidth(), mode.getHeight()); + } } protected void setAWTGraphicsScreen(AWTGraphicsScreen s) { |