From e1682f8cd5eab26b12c868f19ff3adc544098077 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 19 Dec 2010 00:16:19 +0100 Subject: Debug/Cleanup: toString: print base classname only; Misc .. --- .../com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/jogl/classes/com/jogamp/opengl/impl/windows') diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java index 1b826e6bf..0b4933db8 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java @@ -139,10 +139,17 @@ public class WindowsWGLContext extends GLContextImpl { // should not happen due to 'isGLReadDrawableAvailable()' query in GLContextImpl throw new InternalError("Given readDrawable but no driver support"); } + int werr = ( !ok ) ? GDI.GetLastError() : GDI.ERROR_SUCCESS; + if(DEBUG && !ok) { + Throwable t = new Throwable ("Info: wglMakeContextCurrent draw "+ + this.toHexString(hDrawDC) + ", read " + this.toHexString(hReadDC) + + ", ctx " + this.toHexString(ctx) + ", werr " + werr); + t.printStackTrace(); + } if(!ok && 0==hDrawDC && 0==hReadDC) { // Some GPU's falsely fails with a zero error code (success), // in case this is a release context request we tolerate this - return GDI.GetLastError() == GDI.ERROR_SUCCESS ; + return werr == GDI.ERROR_SUCCESS ; } return ok; } -- cgit v1.2.3