diff options
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java index 826523a5c..fd8c85398 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java @@ -275,6 +275,16 @@ public abstract class GLContextImpl extends GLContext { GLWorkerThread.invokeLater(new Runnable() { public void run() {} }); } + if (!isCreated()) { + // verify if the drawable if valid .. + if (0 == getGLDrawable().getNativeWindow().getSurfaceHandle()) { + throw new GLException("drawable has invalid surface handle: "+getGLDrawable()); + } + if (null == getGLDrawable().getChosenGLCapabilities()) { + throw new GLException("drawable has no chosen GLCapabilities: "+getGLDrawable()); + } + } + lock.lock(); int res = 0; try { |