diff options
author | Sven Gothel <[email protected]> | 2011-11-30 13:13:27 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-11-30 13:13:27 +0100 |
commit | ad0ba11b0a1d6cb4a113e467420f2f797f1d26cb (patch) | |
tree | fc263a43ea92791d5cb6e5439fc3c3669d3770de /src/jogl/classes/jogamp/opengl/windows | |
parent | b72ac8efaca45241a44dd631acb20a8c23ea2a7b (diff) |
More Robust GLProfile Initialization ; Add NativeWindowFactory Shutdown
More Robust GLProfile Initialization
- Catch GLException in GLDrawableFactory getWasSharedContextCreated(device) impl.,
which may fail (See comment on Firefox/Chorme EGL deployed library for Windows).
- If getWasSharedContextCreated(devide) fails, set respective factory availability to false,
ie. hasDesktopGLFactory, hasEGLFactory, ..
Add NativeWindowFactory Shutdown
- Currenly a dummy entry, may evolve. X11Util shutdown is issued by respective GLDrawableFactory
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/windows')
3 files changed, 21 insertions, 9 deletions
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java index 9838ba156..6b75b6504 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java @@ -370,9 +370,16 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { final static String wglMakeContextCurrent = "wglMakeContextCurrent"; public final boolean getWasSharedContextCreated(AbstractGraphicsDevice device) { - SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device); - if(null!=sr) { - return null != sr.getContext(); + try { + SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device); + if(null!=sr) { + return null != sr.getContext(); + } + } catch (GLException gle) { + if(DEBUG) { + System.err.println("Catched Exception while WindowsWGL Shared Resource initialization"); + gle.printStackTrace(); + } } return false; } diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java index 2d1ecb57f..edcaa4a24 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java @@ -238,7 +238,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat } if(NativeSurface.LOCK_SURFACE_NOT_READY >= sharedDrawable.lockSurface()) { - throw new GLException("Surface not ready (lockSurface)"); + throw new GLException("Shared Surface not ready (lockSurface): "+device+" -> "+sharedDrawable); } try { long hdc = sharedDrawable.getHandle(); diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java index 08cd63c5e..0f9786f1d 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java @@ -124,12 +124,17 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu // otherwise no hardware accelerated PFD could be achieved. // - preselect with no constrains // - try to create dedicated GC - winConfig.preselectGraphicsConfiguration(drawableFactory, null); - if ( 1 <= winConfig.getPixelFormatID() ) { - chosenGC = Win32SunJDKReflection.graphicsConfigurationGet(device, winConfig.getPixelFormatID()); - if(DEBUG) { - System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: Found new AWT PFD ID "+winConfig.getPixelFormatID()+" -> "+winConfig); + try { + winConfig.preselectGraphicsConfiguration(drawableFactory, null); + if ( 1 <= winConfig.getPixelFormatID() ) { + chosenGC = Win32SunJDKReflection.graphicsConfigurationGet(device, winConfig.getPixelFormatID()); + if(DEBUG) { + System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: Found new AWT PFD ID "+winConfig.getPixelFormatID()+" -> "+winConfig); + } } + } catch (GLException gle0) { + gle0.printStackTrace(); + // go on .. } if( null == chosenGC ) { |