From 1d5038e9f000e24bf957f3ad8eaba036e1f32c32 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 7 Aug 2007 03:30:25 +0000 Subject: [PATCH] gl-max-errors --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 4 +--- panda/src/glstuff/glmisc_src.cxx | 6 ++++++ panda/src/glstuff/glmisc_src.h | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index ff1ad1e61b..9c096fc7f5 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -4274,9 +4274,7 @@ bool CLP(GraphicsStateGuardian):: report_errors_loop(int line, const char *source_file, GLenum error_code, int &error_count) { #ifndef NDEBUG - static const int max_gl_errors_reported = 20; - - while ((error_count < max_gl_errors_reported) && + while ((CLP(max_errors) < 0 || error_count < CLP(max_errors)) && (error_code != GL_NO_ERROR)) { GLCAT.error() << "at " << line << " of " << source_file << " : " diff --git a/panda/src/glstuff/glmisc_src.cxx b/panda/src/glstuff/glmisc_src.cxx index 7fb5e4c8b8..02ac9654ce 100644 --- a/panda/src/glstuff/glmisc_src.cxx +++ b/panda/src/glstuff/glmisc_src.cxx @@ -94,6 +94,12 @@ ConfigVariableBool CLP(parallel_arrays) "render geometry as it appears in the GeomVertexData. See " "also gl-interleaved-arrays.")); +ConfigVariableInt CLP(max_errors) + ("gl-max-errors", 20, + PRC_DESC("This is the limit on the number of OpenGL errors Panda will " + "detect and report before it shuts down rendering. Set it to " + "-1 for no limit.")); + extern ConfigVariableBool CLP(parallel_arrays); void CLP(init_classes)() { diff --git a/panda/src/glstuff/glmisc_src.h b/panda/src/glstuff/glmisc_src.h index f8b072862e..a152b152b1 100644 --- a/panda/src/glstuff/glmisc_src.h +++ b/panda/src/glstuff/glmisc_src.h @@ -32,6 +32,7 @@ extern ConfigVariableBool CLP(support_occlusion_query); extern ConfigVariableBool CLP(compile_and_execute); extern ConfigVariableBool CLP(interleaved_arrays); extern ConfigVariableBool CLP(parallel_arrays); +extern ConfigVariableInt CLP(max_errors); extern EXPCL_GL void CLP(init_classes)();