aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/classes/com/sun/opengl/impl/windows')
-rwxr-xr-xsrc/classes/com/sun/opengl/impl/windows/WindowsExternalGLContext.java3
-rwxr-xr-xsrc/classes/com/sun/opengl/impl/windows/WindowsExternalGLDrawable.java3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/classes/com/sun/opengl/impl/windows/WindowsExternalGLContext.java b/src/classes/com/sun/opengl/impl/windows/WindowsExternalGLContext.java
index a12f156f5..c56614599 100755
--- a/src/classes/com/sun/opengl/impl/windows/WindowsExternalGLContext.java
+++ b/src/classes/com/sun/opengl/impl/windows/WindowsExternalGLContext.java
@@ -51,6 +51,9 @@ public class WindowsExternalGLContext extends WindowsGLContext {
public WindowsExternalGLContext() {
super(null, null);
hglrc = WGL.wglGetCurrentContext();
+ if (hglrc == 0) {
+ throw new GLException("Error: attempted to make an external GLContext without a drawable/context current");
+ }
if (DEBUG) {
System.err.println(getThreadName() + ": !!! Created external OpenGL context " + toHexString(hglrc) + " for " + this);
}
diff --git a/src/classes/com/sun/opengl/impl/windows/WindowsExternalGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/WindowsExternalGLDrawable.java
index 68ab83161..23ec0a1fc 100755
--- a/src/classes/com/sun/opengl/impl/windows/WindowsExternalGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/WindowsExternalGLDrawable.java
@@ -46,6 +46,9 @@ public class WindowsExternalGLDrawable extends WindowsGLDrawable {
public WindowsExternalGLDrawable() {
super(new GLCapabilities(), null);
hdc = WGL.wglGetCurrentDC();
+ if (hdc == 0) {
+ throw new GLException("Error: attempted to make an external GLDrawable without a drawable/context current");
+ }
}
public GLContext createContext(GLContext shareWith) {