diff options
Diffstat (limited to 'src/jogl/classes')
2 files changed, 34 insertions, 8 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 + ")"); diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java index 9cb7eac08..49b56ea0e 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java @@ -215,11 +215,19 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac try { chosen = chooser.chooseCapabilities(capabilities, caps, recommendedIndex); } catch (NativeWindowException e) { - throw new GLException(e); + if(DEBUG) { + e.printStackTrace(); + } + chosen = -1; } } - - if (chosen < 0 || chosen >= caps.length) { + if (chosen < 0) { + // keep on going .. + if(DEBUG) { + System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig .. unable to choose config, using first"); + } + chosen = 0; // default .. + } else if (chosen >= caps.length) { throw new GLException("GLCapabilitiesChooser specified invalid index (expected 0.." + (caps.length - 1) + ")"); } @@ -255,7 +263,7 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac GLCapabilities[] caps = null; int recommendedIndex = -1; XVisualInfo retXVisualInfo = null; - int chosen; + int chosen=-1; NativeWindowFactory.getDefaultFactory().getToolkitLock().lock(); try { @@ -293,9 +301,18 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac try { chosen = chooser.chooseCapabilities(capabilities, caps, recommendedIndex); } catch (NativeWindowException e) { - throw new GLException(e); + if(DEBUG) { + e.printStackTrace(); + } + chosen = -1; } - if (chosen < 0 || chosen >= caps.length) { + if (chosen < 0) { + // keep on going .. + if(DEBUG) { + System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationXVisual .. unable to choose config, using first"); + } + chosen = 0; // default .. + } else if (chosen >= caps.length) { throw new GLException("GLCapabilitiesChooser specified invalid index (expected 0.." + (caps.length - 1) + ")"); } if (infos[chosen] == null) { |