From d42275f11cc53000fead76b7c695fb370d19e56d Mon Sep 17 00:00:00 2001 From: tfarley Date: Thu, 28 May 2015 21:41:37 -0400 Subject: Implemented glColorMask --- src/video_core/renderer_opengl/gl_state.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/video_core/renderer_opengl/gl_state.cpp') diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 9c5f38f9..2305fb2c 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -16,6 +16,11 @@ OpenGLState::OpenGLState() { depth.test_func = GL_LESS; depth.write_mask = GL_TRUE; + color_mask.red_enabled = GL_TRUE; + color_mask.green_enabled = GL_TRUE; + color_mask.blue_enabled = GL_TRUE; + color_mask.alpha_enabled = GL_TRUE; + stencil.test_enabled = false; stencil.test_func = GL_ALWAYS; stencil.test_ref = 0; @@ -77,6 +82,14 @@ void OpenGLState::Apply() { glDepthMask(depth.write_mask); } + // Color mask + if (color_mask.red_enabled != cur_state.color_mask.red_enabled || + color_mask.green_enabled != cur_state.color_mask.green_enabled || + color_mask.blue_enabled != cur_state.color_mask.blue_enabled || + color_mask.alpha_enabled != cur_state.color_mask.alpha_enabled) { + glColorMask(color_mask.red_enabled, color_mask.green_enabled, color_mask.blue_enabled, color_mask.alpha_enabled); + } + // Stencil test if (stencil.test_enabled != cur_state.stencil.test_enabled) { if (stencil.test_enabled) { -- cgit v1.2.3