From f07dc359769d7aee3248b8de592c0ae8c2511fcf Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 12 Nov 2002 13:51:04 +0000 Subject: [PATCH] Fixed bug in stats where overdraw would be reported incorrectly. --- src/osgGLUT/Viewer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/osgGLUT/Viewer.cpp b/src/osgGLUT/Viewer.cpp index e865f6341..fac35b06a 100644 --- a/src/osgGLUT/Viewer.cpp +++ b/src/osgGLUT/Viewer.cpp @@ -1009,11 +1009,14 @@ void Viewer::keyboard(unsigned char key, int x, int y) _printStats++; //gwm jul 2001 range of possible outputs, 0-4 = !_printStats; if (_printStats>=Statistics::STAT_RESTART) _printStats=0; if (getNumViewports()<=1 && _printStats==Statistics::STAT_PRIMSPERVIEW) _printStats++; // no need for these stats as only one view - if (_printStats==Statistics::STAT_DC) { // count depth complexity by incrementing the stencil buffer every + if (_printStats==Statistics::STAT_DC) + { + + // count depth complexity by incrementing the stencil buffer every // time a pixel is hit GLint nsten=0; // Number of stencil planes available glGetIntegerv(GL_STENCIL_BITS , &nsten); - if (nsten>0) { + if (_displayMode & GLUT_STENCIL && nsten>0) { glEnable(GL_STENCIL_TEST); glStencilOp(GL_INCR ,GL_INCR ,GL_INCR); } else {// skip this option