diff options
Diffstat (limited to 'src/jake2/render')
-rw-r--r-- | src/jake2/render/opengl/NEWTWin.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/jake2/render/opengl/NEWTWin.java b/src/jake2/render/opengl/NEWTWin.java index 078f97c..28a6019 100644 --- a/src/jake2/render/opengl/NEWTWin.java +++ b/src/jake2/render/opengl/NEWTWin.java @@ -48,7 +48,7 @@ public class NEWTWin { public ScreenMode findDisplayMode(DimensionImmutable dim) { final List<ScreenMode> sml = ScreenModeUtil.filterByResolution(screen.getScreenModes(), dim); - if(sml.size() == 0) { + if(null == sml || sml.size() == 0) { return oldDisplayMode; } return sml.get(0); @@ -96,6 +96,9 @@ public class NEWTWin { screen = NewtFactory.createScreen(NewtFactory.createDisplay(null), 0); screen.addReference(); // trigger native creation screenRemRef = true; + } else if( !screen.isNativeValid() ) { + screen.addReference(); // trigger native creation + screenRemRef = true; } else { screenRemRef = false; } |