From 8d03842c054fcc441685c5c6b3727f981b8a10b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Fri, 12 Mar 2010 14:55:34 +0000 Subject: [PATCH] Improve the debug output from checkGLError(). svn path=/trunk/KDE/kdebase/workspace/; revision=1102451 --- lib/kwinglutils.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/kwinglutils.cpp b/lib/kwinglutils.cpp index e46622f173..0e23144c4e 100644 --- a/lib/kwinglutils.cpp +++ b/lib/kwinglutils.cpp @@ -104,7 +104,18 @@ bool checkGLError( const char* txt ) GLenum err = glGetError(); if( err != GL_NO_ERROR ) { - kWarning(1212) << "GL error (" << txt << "): 0x" << QString::number( err, 16 ) ; + QString string; + switch (err) + { + case GL_INVALID_ENUM: string = "GL_INVALID_ENUM"; break; + case GL_INVALID_VALUE: string = "GL_INVALID_VALUE"; break; + case GL_INVALID_OPERATION: string = "GL_INVALID_OPERATION"; break; + case GL_STACK_OVERFLOW: string = "GL_STACK_OVERFLOW"; break; + case GL_STACK_UNDERFLOW: string = "GL_STACK_UNDERFLOW"; break; + case GL_OUT_OF_MEMORY: string = "GL_OUT_OF_MEMORY"; break; + default: string = QString( "0x" ) + QString::number( err, 16 ); break; + } + kWarning(1212) << "GL error (" << txt << "): " << string; return true; } return false;