diff options
Diffstat (limited to 'src/classes/com/sun/opengl/impl/x11')
-rwxr-xr-x | src/classes/com/sun/opengl/impl/x11/X11ExternalGLContext.java | 3 | ||||
-rwxr-xr-x | src/classes/com/sun/opengl/impl/x11/X11ExternalGLDrawable.java | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/classes/com/sun/opengl/impl/x11/X11ExternalGLContext.java b/src/classes/com/sun/opengl/impl/x11/X11ExternalGLContext.java index ae61c0063..e0446f4d6 100755 --- a/src/classes/com/sun/opengl/impl/x11/X11ExternalGLContext.java +++ b/src/classes/com/sun/opengl/impl/x11/X11ExternalGLContext.java @@ -51,6 +51,9 @@ public class X11ExternalGLContext extends X11GLContext { lockToolkit(); try { context = GLX.glXGetCurrentContext(); + if (context == 0) { + throw new GLException("Error: attempted to make an external GLContext without a drawable/context current"); + } drawable = new Drawable(GLX.glXGetCurrentDisplay()); } finally { unlockToolkit(); diff --git a/src/classes/com/sun/opengl/impl/x11/X11ExternalGLDrawable.java b/src/classes/com/sun/opengl/impl/x11/X11ExternalGLDrawable.java index e8fc069ba..10e58d3a0 100755 --- a/src/classes/com/sun/opengl/impl/x11/X11ExternalGLDrawable.java +++ b/src/classes/com/sun/opengl/impl/x11/X11ExternalGLDrawable.java @@ -55,6 +55,9 @@ public class X11ExternalGLDrawable extends X11GLDrawable { display = GLX.glXGetCurrentDisplay(); drawable = GLX.glXGetCurrentDrawable(); readDrawable = GLX.glXGetCurrentReadDrawable(); + if (drawable == 0) { + throw new GLException("Error: attempted to make an external GLDrawable without a drawable/context current"); + } // Need GLXFBConfig ID in order to properly create new contexts // on this drawable |