From be576b98ac0d8f8309510763064485961e485a7d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 26 Nov 2010 13:42:38 +0100 Subject: WGL: Add GetLastError in case external context/drawable can't be retrieved --- .../jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java | 6 +++--- .../jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/jogl') diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java index 173109db9..fd70842ac 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java @@ -75,15 +75,15 @@ public class WindowsExternalWGLContext extends WindowsWGLContext { protected static WindowsExternalWGLContext create(GLDrawableFactory factory, GLProfile glp) { long hdc = WGL.wglGetCurrentDC(); if (0==hdc) { - throw new GLException("Error: attempted to make an external GLDrawable without a drawable current"); + throw new GLException("Error: attempted to make an external GLDrawable without a drawable current, werr " + GDI.GetLastError()); } long ctx = WGL.wglGetCurrentContext(); if (ctx == 0) { - throw new GLException("Error: attempted to make an external GLContext without a context current"); + throw new GLException("Error: attempted to make an external GLContext without a context current, werr " + GDI.GetLastError()); } int pfdID = GDI.GetPixelFormat(hdc); if (pfdID == 0) { - throw new GLException("Error: attempted to make an external GLContext without a valid pixelformat"); + throw new GLException("Error: attempted to make an external GLContext without a valid pixelformat, werr " + GDI.GetLastError()); } AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS); diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java index 8f41db365..66a5c80a4 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java @@ -61,11 +61,11 @@ public class WindowsExternalWGLDrawable extends WindowsWGLDrawable { protected static WindowsExternalWGLDrawable create(GLDrawableFactory factory, GLProfile glp) { long hdc = WGL.wglGetCurrentDC(); if (0==hdc) { - throw new GLException("Error: attempted to make an external GLDrawable without a drawable current"); + throw new GLException("Error: attempted to make an external GLDrawable without a drawable current, werr " + GDI.GetLastError()); } int pfdID = GDI.GetPixelFormat(hdc); if (pfdID == 0) { - throw new GLException("Error: attempted to make an external GLContext without a valid pixelformat"); + throw new GLException("Error: attempted to make an external GLContext without a valid pixelformat, werr " + GDI.GetLastError()); } AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS); -- cgit v1.2.3