From 6ad9fa6e07a74838d30da1b7b52e483cc2b59039 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 7 May 2007 20:03:09 +0000 Subject: [PATCH] support gl-color-mask better --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 9fbe9b8d9c..8e30656456 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -4409,11 +4409,13 @@ set_draw_buffer(const RenderBuffer &rb) { } // Also ensure that any global color channels are masked out. - GLP(ColorMask)((_color_write_mask & ColorWriteAttrib::C_red) != 0, - (_color_write_mask & ColorWriteAttrib::C_green) != 0, - (_color_write_mask & ColorWriteAttrib::C_blue) != 0, - (_color_write_mask & ColorWriteAttrib::C_alpha) != 0); - + if (CLP(color_mask)) { + GLP(ColorMask)((_color_write_mask & ColorWriteAttrib::C_red) != 0, + (_color_write_mask & ColorWriteAttrib::C_green) != 0, + (_color_write_mask & ColorWriteAttrib::C_blue) != 0, + (_color_write_mask & ColorWriteAttrib::C_alpha) != 0); + } + report_my_gl_errors(); }