aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/sun/opengl/impl/windows
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-08-02 14:00:51 -0700
committerSven Gothel <[email protected]>2009-08-02 14:00:51 -0700
commitbda9e3bc462e5489aa9bc168adda438864e89ed4 (patch)
tree6a103d4dce3fd4d9fb55734bcf2fefd68f11f04f /src/jogl/classes/com/sun/opengl/impl/windows
parentc20b0c0b0824d6554c6881c07799b6e05d5fc09d (diff)
Fix GLX/WGL GraphicsConfigurationFactory: Be more relaxed in error handling - keep going, even if underlying impl/modules cannot choose a config. Allows VBOX to run NEWT/JOGL
Diffstat (limited to 'src/jogl/classes/com/sun/opengl/impl/windows')
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
index 98ad83313..a7d7be349 100644
--- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -246,12 +246,21 @@ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfiguratio
try {
pixelFormat = chooser.chooseCapabilities(capabilities, availableCaps, recommendedPixelFormat) + 1;
} catch (NativeWindowException e) {
- throw new GLException(e);
+ if(DEBUG) {
+ e.printStackTrace();
+ }
+ pixelFormat = -1;
}
} else {
pixelFormat = recommendedPixelFormat;
}
- if ((pixelFormat <= 0) || (pixelFormat > numFormats)) {
+ if (pixelFormat <= 0) {
+ // keep on going ..
+ if(DEBUG) {
+ System.err.println("WindowsWGLGraphicsConfigurationFactory.updateGraphicsConfiguration .. unable to choose config, using first");
+ }
+ pixelFormat = 1; // default ..
+ } else if ( pixelFormat > numFormats ) {
throw new GLException("Invalid result " + pixelFormat +
" from GLCapabilitiesChooser (should be between 1 and " +
numFormats + ")");