summaryrefslogtreecommitdiffstats
path: root/src/newt/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-11-02 00:12:28 +0100
committerSven Gothel <[email protected]>2010-11-02 00:12:28 +0100
commit09be7eb4e912749ccf84525bca87d9d70f1c2ed1 (patch)
tree93145e80f79ba0ea46c19b0b1ad1cda893223e1f /src/newt/classes
parent79d306f154351e9c61167292a4dfced4bc1309cd (diff)
ScreenMode: Ignore modes < 15bpp
Diffstat (limited to 'src/newt/classes')
-rw-r--r--src/newt/classes/com/jogamp/newt/impl/ScreenImpl.java11
1 files changed, 8 insertions, 3 deletions
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);