From: mzernova Date: Mon, 15 Jul 2024 10:14:36 +0000 (+0100) Subject: #Fixed bug with GL_COLOR_WRITEMASK X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=2ecf6008fa1f4a522fa4fefdc3cc4952182988bc;p=occt.git #Fixed bug with GL_COLOR_WRITEMASK --- diff --git a/src/OpenGl/OpenGl_LayerList.cxx b/src/OpenGl/OpenGl_LayerList.cxx index 65d4bdac2e..7a7c5d0145 100644 --- a/src/OpenGl/OpenGl_LayerList.cxx +++ b/src/OpenGl/OpenGl_LayerList.cxx @@ -884,9 +884,9 @@ void OpenGl_LayerList::UpdateOcclusion( const Handle(OpenGl_Workspace) & theWork // Remember global settings for glDepth mask and write mask - GLboolean aPrevColorMask; + GLboolean aPrevColorMask[4]; GLboolean aPrevDepthMask; - aCtx->core11fwd->glGetBooleanv(GL_COLOR_WRITEMASK, &aPrevColorMask); + aCtx->core11fwd->glGetBooleanv(GL_COLOR_WRITEMASK, aPrevColorMask); aCtx->core11fwd->glGetBooleanv(GL_DEPTH_WRITEMASK, &aPrevDepthMask); // Turn off writing to depth and color buffers @@ -930,7 +930,7 @@ void OpenGl_LayerList::UpdateOcclusion( const Handle(OpenGl_Workspace) & theWork // Back to prev settings aCtx->core11fwd->glDepthMask(aPrevDepthMask); - aCtx->core11fwd->glColorMask(aPrevColorMask, aPrevColorMask, aPrevColorMask, aPrevColorMask); + aCtx->core11fwd->glColorMask(aPrevColorMask[0], aPrevColorMask[1], aPrevColorMask[2], aPrevColorMask[3]); aTimer.Stop(); aStats->ActiveDataFrame()[Graphic3d_FrameStatsTimer_CpuCulling] = aTimer.UserTimeCPU();