Correct debug bit setting with WGL

No need to tie the debug bit to OpenGL 3.0+. xcb is correct
in this respect, let's correct the windows plugin too.

Change-Id: I13ea48de067d3fb61575be8f71b97bb547d8eb02
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
This commit is contained in:
Laszlo Agocs 2013-11-27 16:10:20 +01:00 committed by The Qt Project
parent 9b621f3861
commit fc10bfd550

View File

@ -586,15 +586,17 @@ static HGLRC createContext(const QOpenGLStaticContext &staticContext,
attributes[attribIndex++] = WGL_CONTEXT_MINOR_VERSION_ARB;
attributes[attribIndex++] = minorVersion;
}
int flags = 0;
if (format.testOption(QSurfaceFormat::DebugContext))
flags |= WGL_CONTEXT_DEBUG_BIT_ARB;
if (requestedVersion >= 0x0300) {
attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB;
attributes[attribIndex] = 0;
if (!format.testOption(QSurfaceFormat::DeprecatedFunctions))
attributes[attribIndex] |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
if (format.testOption(QSurfaceFormat::DebugContext))
attributes[attribIndex] |= WGL_CONTEXT_DEBUG_BIT_ARB;
attribIndex++;
flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
}
attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB;
attributes[attribIndex++] = flags;
if (requestedVersion >= 0x0302) {
switch (format.profile()) {
case QSurfaceFormat::NoProfile: