From de098e21d1f0c533fcace11368d5c76217eb0f56 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 22 May 2013 16:22:14 +0200 Subject: Improve error message in GL context creation. Output format, glGetError(), shared context as well. Task-number: QTBUG-30077 Change-Id: Ibc4a7f9ad99bdcdcb439e719394d2532445c3fbe Reviewed-by: Gunnar Sletta --- src/plugins/platforms/windows/qwindowsglcontext.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index ae66ef8a3d..f6dda04c13 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -613,8 +613,12 @@ static HGLRC createContext(const QOpenGLStaticContext &staticContext, const HGLRC result = staticContext.wglCreateContextAttribsARB(hdc, shared, attributes); - if (!result) - qErrnoWarning("%s: wglCreateContextAttribsARB() failed.", __FUNCTION__); + if (!result) { + QString message; + QDebug(&message).nospace() << __FUNCTION__ << ": wglCreateContextAttribsARB() failed (GL error code: 0x" + << hex << glGetError() << dec << ") for format: " << format << ", shared context: " << shared; + qErrnoWarning("%s", qPrintable(message)); + } return result; } -- cgit v1.2.3