From b4d3ccd1a7cc297e36ff6dc1029907856cdcaaf9 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 13 Feb 2004 01:34:28 +0000 Subject: [PATCH] check for 24 bpp correctly --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index cb67960ba0..7355b2772c 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -403,15 +403,18 @@ reset() { } // use per-vertex fog if per-pixel fog requires SW renderer - GLP(Hint)(GL_FOG_HINT,GL_DONT_CARE); + GLP(Hint)(GL_FOG_HINT, GL_DONT_CARE); - GLint iRedBits; - GLP(GetIntegerv)(GL_RED_BITS,&iRedBits); - if(iRedBits<24) { + GLint num_red_bits; + GLP(GetIntegerv)(GL_RED_BITS, &num_red_bits); + if (num_red_bits < 8) { GLP(Enable)(GL_DITHER); _dithering_enabled = true; - if(GLCAT.is_debug()) - GLCAT.debug() << "frame buffer depth < 8bits channel, enabling dithering\n"; + if (GLCAT.is_debug()) { + GLCAT.debug() + << "frame buffer depth = " << num_red_bits + << " bits/channel, enabling dithering\n"; + } } // Output the vendor and version strings.