Browse Source

GL3 renderer: Add color write mask to OpenGL state backup

Michael Ragazzon 1 năm trước cách đây
mục cha
commit
8dfba0597a
2 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 3 0
      Backends/RmlUi_Renderer_GL3.cpp
  2. 1 0
      Backends/RmlUi_Renderer_GL3.h

+ 3 - 0
Backends/RmlUi_Renderer_GL3.cpp

@@ -828,6 +828,7 @@ void RenderInterface_GL3::BeginFrame()
 
 	glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &glstate_backup.stencil_clear_value);
 	glGetFloatv(GL_COLOR_CLEAR_VALUE, glstate_backup.color_clear_value);
+	glGetBooleanv(GL_COLOR_WRITEMASK, glstate_backup.color_writemask);
 
 	glGetIntegerv(GL_BLEND_EQUATION_RGB, &glstate_backup.blend_equation_rgb);
 	glGetIntegerv(GL_BLEND_EQUATION_ALPHA, &glstate_backup.blend_equation_alpha);
@@ -943,6 +944,8 @@ void RenderInterface_GL3::EndFrame()
 	glClearStencil(glstate_backup.stencil_clear_value);
 	glClearColor(glstate_backup.color_clear_value[0], glstate_backup.color_clear_value[1], glstate_backup.color_clear_value[2],
 		glstate_backup.color_clear_value[3]);
+	glColorMask(glstate_backup.color_writemask[0], glstate_backup.color_writemask[1], glstate_backup.color_writemask[2],
+		glstate_backup.color_writemask[3]);
 
 	glBlendEquationSeparate(glstate_backup.blend_equation_rgb, glstate_backup.blend_equation_alpha);
 	glBlendFuncSeparate(glstate_backup.blend_src_rgb, glstate_backup.blend_dst_rgb, glstate_backup.blend_src_alpha, glstate_backup.blend_dst_alpha);

+ 1 - 0
Backends/RmlUi_Renderer_GL3.h

@@ -193,6 +193,7 @@ private:
 
 		int stencil_clear_value;
 		float color_clear_value[4];
+		unsigned char color_writemask[4];
 
 		int blend_equation_rgb;
 		int blend_equation_alpha;