From 8ebdef6860e34bf16b9b13c657f651bf9ce32ab3 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sat, 11 Feb 2006 01:11:57 +0000 Subject: Further work on FBO support in Java2D/JOGL bridge. Upgraded JOGL's Java2D class to latest proposed set of APIs in OGLUtilities and changed usage of these APIs to be approximately correct. Left in fallback path for working with non-FBO case in current Mustang builds. Not working yet, and don't yet understand why; checking in at this intermediate point to be able to more easily test on more machines. Added error checking to creation of external GLContexts and GLDrawables on Windows and X11 platforms. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@597 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/impl/windows/WindowsExternalGLContext.java | 3 +++ src/classes/com/sun/opengl/impl/windows/WindowsExternalGLDrawable.java | 3 +++ 2 files changed, 6 insertions(+) (limited to 'src/classes/com/sun/opengl/impl/windows') 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) { -- cgit v1.2.3