diff options
author | Sven Gothel <[email protected]> | 2011-03-20 05:12:18 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-03-20 05:12:18 +0100 |
commit | b7f148db1a2775ee9ea6af3e057995a9185d311e (patch) | |
tree | 2ee8168ebd76503ac87552c0146c8e2ecf58cb0a /src/jogl | |
parent | 3df74690ffd910314364566a8fd6eb2c8242f96a (diff) |
Refine getAvailableGLCapabilitiesImpl (XGL, WGL and EGL): Sort only if size > 1
Diffstat (limited to 'src/jogl')
4 files changed, 5 insertions, 7 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java index 78c0da6a5..bcaabfc48 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java @@ -125,7 +125,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact if (numConfigs[0] > 0) { GLProfile glp = GLProfile.getDefault(device); availableCaps = eglConfigs2GLCaps(glp, eglDisplay, configs, numConfigs[0], GLGraphicsConfigurationUtil.ALL_BITS); - if( null != availableCaps ) { + if( null != availableCaps && availableCaps.size() > 1) { Collections.sort(availableCaps, EglCfgIDComparator); } } diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java index d9f9dccfe..c5e1eac0b 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java @@ -65,7 +65,6 @@ import javax.media.opengl.GLProfile; import com.jogamp.common.JogampRuntimeException; import com.jogamp.common.nio.PointerBuffer; import com.jogamp.common.util.ReflectionUtil; -import javax.media.opengl.GLCapabilities; import jogamp.nativewindow.WrappedSurface; import jogamp.nativewindow.windows.GDI; import jogamp.nativewindow.windows.GDISurface; diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java index fdf10a5ef..f74c2e90d 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java @@ -52,7 +52,6 @@ import jogamp.nativewindow.windows.GDI; import jogamp.nativewindow.windows.PIXELFORMATDESCRIPTOR; import jogamp.opengl.GLGraphicsConfigurationFactory; import jogamp.opengl.GLGraphicsConfigurationUtil; -import jogamp.opengl.SharedResourceRunner; import java.util.ArrayList; import java.util.Collections; @@ -123,14 +122,14 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat if (sharedResource.hasARBPixelFormat()) { availableCaps = getAvailableGLCapabilitiesARB(hdc, sharedResource, capsChosen.getGLProfile()); } - if( null == availableCaps || 0 == availableCaps.size() ) { + if( null == availableCaps || availableCaps.isEmpty() ) { availableCaps = getAvailableGLCapabilitiesGDI(hdc, capsChosen.getGLProfile()); } } finally { sharedDrawable.unlockSurface(); } - if( null != availableCaps ) { + if( null != availableCaps && availableCaps.size() > 1 ) { Collections.sort(availableCaps, PfdIDComparator); } return availableCaps; diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java index 319a52c07..b984f1633 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java @@ -111,10 +111,10 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF if( sharedResource.isGLXVersionGreaterEqualOneThree() ) { availableCaps = getAvailableGLCapabilitiesFBConfig(sharedScreen, glp); } - if( null == availableCaps || 0 == availableCaps.size() ) { + if( null == availableCaps || availableCaps.isEmpty() ) { availableCaps = getAvailableGLCapabilitiesXVisual(sharedScreen, glp); } - if( null != availableCaps ) { + if( null != availableCaps && availableCaps.size() > 1 ) { Collections.sort(availableCaps, XVisualIDComparator); } return availableCaps; |