diff options
author | Sven Gothel <[email protected]> | 2010-11-02 00:12:28 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-11-02 00:12:28 +0100 |
commit | 09be7eb4e912749ccf84525bca87d9d70f1c2ed1 (patch) | |
tree | 93145e80f79ba0ea46c19b0b1ad1cda893223e1f | |
parent | 79d306f154351e9c61167292a4dfced4bc1309cd (diff) |
ScreenMode: Ignore modes < 15bpp
-rw-r--r-- | make/scripts/tests2.sh | 4 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/impl/ScreenImpl.java | 11 | ||||
-rw-r--r-- | src/newt/native/WindowsWindow.c | 1 |
3 files changed, 10 insertions, 6 deletions
diff --git a/make/scripts/tests2.sh b/make/scripts/tests2.sh index 50ab8ec33..cf0b38705 100644 --- a/make/scripts/tests2.sh +++ b/make/scripts/tests2.sh @@ -61,9 +61,9 @@ function testawt() { #testawt com.jogamp.test.junit.newt.parenting.TestParenting01NEWT #testawt com.jogamp.test.junit.newt.parenting.TestParenting02NEWT -#testawt com.jogamp.test.junit.newt.TestScreenMode00NEWT +testawt com.jogamp.test.junit.newt.TestScreenMode00NEWT #testawt com.jogamp.test.junit.newt.TestScreenMode01NEWT -testawt com.jogamp.test.junit.newt.TestScreenMode02NEWT +#testawt com.jogamp.test.junit.newt.TestScreenMode02NEWT #testawt com.jogamp.test.junit.newt.TestGLWindows01NEWT #testawt -Djava.awt.headless=true com.jogamp.test.junit.newt.TestGLWindows01NEWT diff --git a/src/newt/classes/com/jogamp/newt/impl/ScreenImpl.java b/src/newt/classes/com/jogamp/newt/impl/ScreenImpl.java index 9ab9e794a..474eac31d 100644 --- a/src/newt/classes/com/jogamp/newt/impl/ScreenImpl.java +++ b/src/newt/classes/com/jogamp/newt/impl/ScreenImpl.java @@ -40,7 +40,6 @@ import com.jogamp.newt.Display; import com.jogamp.newt.NewtFactory; import com.jogamp.newt.Screen; import com.jogamp.newt.ScreenMode; -import com.jogamp.newt.Window; import com.jogamp.newt.event.ScreenModeListener; import com.jogamp.newt.util.ScreenModeUtil; @@ -431,6 +430,7 @@ public abstract class ScreenImpl extends Screen implements ScreenModeListener { } } + /** ignores bpp < 15 */ private ArrayHashSet collectNativeScreenModes(IntIntHashMap screenModesIdx2NativeId) { ArrayHashSet resolutionPool = new ArrayHashSet(); ArrayHashSet surfaceSizePool = new ArrayHashSet(); @@ -442,6 +442,11 @@ public abstract class ScreenImpl extends Screen implements ScreenModeListener { int[] smProps = null; int num = 0; + final int idxBpp = 1 // native mode + + 1 // count + + ScreenModeUtil.NUM_RESOLUTION_PROPERTIES + + ScreenModeUtil.NUM_SURFACE_SIZE_PROPERTIES + - 1 ; // index 0 based do { if(DisableScreenModeImpl) { smProps = null; @@ -450,15 +455,15 @@ public abstract class ScreenImpl extends Screen implements ScreenModeListener { } else { smProps = getScreenModeNextImpl(); } - if(null != smProps && 0 < smProps.length) { + if(null != smProps && 0 < smProps.length && smProps[idxBpp] >= 15) { int nativeId = smProps[0]; int screenModeIdx = ScreenModeUtil.streamIn(resolutionPool, surfaceSizePool, screenSizeMMPool, monitorModePool, screenModePool, smProps, 1); if(screenModeIdx >= 0) { screenModesIdx2NativeId.put(screenModeIdx, nativeId); } - num++; } + num++; } while ( null != smProps && 0 < smProps.length ); ScreenModeUtil.validate(screenModePool, true); diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c index 536a706ac..b2f96a03b 100644 --- a/src/newt/native/WindowsWindow.c +++ b/src/newt/native/WindowsWindow.c @@ -1454,7 +1454,6 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_CreateWi (*env)->ReleaseStringUTFChars(env, jWndName, wndName); #endif - return (jlong) (intptr_t) window; } |