Skip to content

Commit

Permalink
GL3 renderer: Add color write mask to OpenGL state backup
Browse files Browse the repository at this point in the history
  • Loading branch information
mikke89 committed Feb 4, 2024
1 parent 66a70d5 commit e6ac419
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Backends/RmlUi_Renderer_GL3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions Backends/RmlUi_Renderer_GL3.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ class RenderInterface_GL3 : public Rml::RenderInterface {

int stencil_clear_value;
float color_clear_value[4];
unsigned char color_writemask[4];

int blend_equation_rgb;
int blend_equation_alpha;
Expand Down

0 comments on commit e6ac419

Please sign in to comment.