From: José Fonseca Date: Fri, 7 Jun 2013 07:55:03 +0000 (+0100) Subject: glstate: Use helper function for flushing GL errors. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=2143a066d7ebb52ea48e25da4f9de70b65c0ab79;p=apitrace glstate: Use helper function for flushing GL errors. --- diff --git a/retrace/glstate_params.py b/retrace/glstate_params.py index 9e4fab0..54e0c67 100644 --- a/retrace/glstate_params.py +++ b/retrace/glstate_params.py @@ -280,6 +280,12 @@ class StateDumper: print 'namespace glstate {' print + print 'static void' + print 'flushErrors(void) {' + print ' while (glGetError() != GL_NO_ERROR) {}' + print '}' + print + print 'void' print 'dumpBoolean(JSONWriter &json, GLboolean value)' print '{' @@ -540,11 +546,11 @@ class StateDumper: print ' // %s' % name print ' {' - print ' while (glGetError() != GL_NO_ERROR) {}' + print ' flushErrors();' type, value = getter(*args) print ' if (glGetError() != GL_NO_ERROR) {' #print ' std::cerr << "warning: %s(%s) failed\\n";' % (inflection, name) - print ' while (glGetError() != GL_NO_ERROR) {}' + print ' flushErrors();' print ' } else {' print ' json.beginMember("%s");' % name JsonWriter().visit(type, value)