From e7032ae9ca4b754bd9737f86d9496211e9155db4 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 31 Dec 2013 08:01:28 +0100 Subject: NEWT Cleanup - Remove Type Casts and OSX Newt/Fmod Workaround (Early WindowImpl initialization) --- src/newt/classes/com/jogamp/newt/Display.java | 2 +- src/newt/classes/com/jogamp/newt/NewtFactory.java | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) (limited to 'src/newt/classes/com/jogamp') diff --git a/src/newt/classes/com/jogamp/newt/Display.java b/src/newt/classes/com/jogamp/newt/Display.java index a0a098481..4469189a8 100644 --- a/src/newt/classes/com/jogamp/newt/Display.java +++ b/src/newt/classes/com/jogamp/newt/Display.java @@ -222,7 +222,7 @@ public abstract class Display { synchronized(displayList) { int i = fromIndex >= 0 ? fromIndex : displayList.size() - 1 ; while( ( incr > 0 ) ? i < displayList.size() : i >= 0 ) { - final Display display = (Display) displayList.get(i).get(); + final Display display = displayList.get(i).get(); if( null == display ) { // Clear GC'ed dead reference entry! displayList.remove(i); diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java index 5ae3f3692..157e2bb3c 100644 --- a/src/newt/classes/com/jogamp/newt/NewtFactory.java +++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java @@ -59,11 +59,6 @@ public class NewtFactory { @Override public Object run() { NativeWindowFactory.initSingleton(); // last resort .. - - // Work-around for initialization order problems on Mac OS X - // between native Newt and (apparently) Fmod - WindowImpl.init(NativeWindowFactory.getNativeWindowType(true)); - return null; } } ); } @@ -320,9 +315,9 @@ public class NewtFactory { public static boolean isScreenCompatible(NativeWindow parent, Screen childScreen) { // Get parent's NativeWindow details - AbstractGraphicsConfiguration parentConfig = (AbstractGraphicsConfiguration) parent.getGraphicsConfiguration(); - AbstractGraphicsScreen parentScreen = (AbstractGraphicsScreen) parentConfig.getScreen(); - AbstractGraphicsDevice parentDevice = (AbstractGraphicsDevice) parentScreen.getDevice(); + AbstractGraphicsConfiguration parentConfig = parent.getGraphicsConfiguration(); + AbstractGraphicsScreen parentScreen = parentConfig.getScreen(); + AbstractGraphicsDevice parentDevice = parentScreen.getDevice(); DisplayImpl childDisplay = (DisplayImpl) childScreen.getDisplay(); String parentDisplayName = childDisplay.validateDisplayName(null, parentDevice.getHandle()); @@ -343,9 +338,9 @@ public class NewtFactory { public static Screen createCompatibleScreen(NativeWindow parent, Screen childScreen) { // Get parent's NativeWindow details - AbstractGraphicsConfiguration parentConfig = (AbstractGraphicsConfiguration) parent.getGraphicsConfiguration(); - AbstractGraphicsScreen parentScreen = (AbstractGraphicsScreen) parentConfig.getScreen(); - AbstractGraphicsDevice parentDevice = (AbstractGraphicsDevice) parentScreen.getDevice(); + AbstractGraphicsConfiguration parentConfig = parent.getGraphicsConfiguration(); + AbstractGraphicsScreen parentScreen = parentConfig.getScreen(); + AbstractGraphicsDevice parentDevice = parentScreen.getDevice(); if(null != childScreen) { // check if child Display/Screen is compatible already -- cgit v1.2.3