diff options
author | Sven Gothel <[email protected]> | 2010-04-27 19:45:43 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-04-27 19:45:43 +0200 |
commit | 897c7248f9895d828542d524b211b74efcc715d2 (patch) | |
tree | 2b6ddc670320f5372b9d4a1a686d9e453e63ce82 /src/jogl/classes/com/jogamp/opengl/impl/windows | |
parent | b5fc2499749d9c180d3e5a0e04a939bd78017068 (diff) |
JOGL Error Handling
- Catch invalid drawable for all impl. at GLContextImpl if !created yet
- GLDrawableFactoryImpl (X11/WGL) catch and fwd Throwable properly
- GLProfile catch LinkageError and handle it
In case of nothing is available, a final ExceptionInInitializer will be thrown,
with the produced GLException that no GLProfile is available.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/windows')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java | 3 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java | 18 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java index 360bddd74..ad38f26c9 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java @@ -203,9 +203,6 @@ public class WindowsWGLContext extends GLContextImpl { WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory)drawable.getFactoryImpl(); GLCapabilities glCaps = drawable.getChosenGLCapabilities(); - if (drawable.getNativeWindow().getSurfaceHandle() == 0) { - throw new GLException("Internal error: attempted to create OpenGL context without an associated drawable"); - } // Windows can set up sharing of display lists after creation time WindowsWGLContext other = (WindowsWGLContext) GLContextShareSet.getShareContext(this); long share = 0; diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java index ee4592adf..70513f82d 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java @@ -73,14 +73,18 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl implements loadOpenGL32Library(); - sharedDrawable = new WindowsDummyWGLDrawable(this, null); - WindowsWGLContext ctx = (WindowsWGLContext) sharedDrawable.createContext(null); - ctx.makeCurrent(); - canCreateGLPbuffer = ctx.getGL().isExtensionAvailable("GL_ARB_pbuffer"); - ctx.release(); - sharedContext = ctx; + try { + sharedDrawable = new WindowsDummyWGLDrawable(this, null); + WindowsWGLContext ctx = (WindowsWGLContext) sharedDrawable.createContext(null); + ctx.makeCurrent(); + canCreateGLPbuffer = ctx.getGL().isExtensionAvailable("GL_ARB_pbuffer"); + ctx.release(); + sharedContext = ctx; + } catch (Throwable t) { + throw new GLException("WindowsWGLDrawableFactory - Could not initialize shared resources", t); + } if(null==sharedContext) { - throw new GLException("Couldn't init shared resources"); + throw new GLException("WindowsWGLDrawableFactory - Shared Context is null"); } if (DEBUG) { System.err.println("!!! SharedContext: "+sharedContext+", pbuffer supported "+canCreateGLPbuffer); |