Skip to content

Commit ec4b082

Browse files
committed
glgsg: restore more OpenGL state after draw callback
1 parent 53cec96 commit ec4b082

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

panda/src/glstuff/glGraphicsStateGuardian_src.cxx

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10661,6 +10661,71 @@ reissue_transforms() {
1066110661
_current_vertex_format.clear();
1066210662
memset(_vertex_attrib_columns, 0, sizeof(const GeomVertexColumn *) * 32);
1066310663
#endif
10664+
10665+
// Since this is called by clear_state_and_transform(), we also should reset
10666+
// the states that won't automatically be respecified when clearing the
10667+
// state mask.
10668+
_active_color_write_mask = ColorWriteAttrib::C_all;
10669+
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
10670+
10671+
if (_dithering_enabled) {
10672+
glEnable(GL_DITHER);
10673+
} else {
10674+
glDisable(GL_DITHER);
10675+
}
10676+
if (_depth_test_enabled) {
10677+
glEnable(GL_DEPTH_TEST);
10678+
} else {
10679+
glDisable(GL_DEPTH_TEST);
10680+
}
10681+
if (_stencil_test_enabled) {
10682+
glEnable(GL_STENCIL_TEST);
10683+
} else {
10684+
glDisable(GL_STENCIL_TEST);
10685+
}
10686+
if (_blend_enabled) {
10687+
glEnable(GL_BLEND);
10688+
} else {
10689+
glDisable(GL_BLEND);
10690+
}
10691+
10692+
#ifndef OPENGLES_2
10693+
if (_multisample_mode != 0) {
10694+
glEnable(GL_MULTISAMPLE);
10695+
} else {
10696+
glDisable(GL_MULTISAMPLE);
10697+
glDisable(GL_SAMPLE_ALPHA_TO_ONE);
10698+
glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
10699+
}
10700+
if (_line_smooth_enabled) {
10701+
glEnable(GL_LINE_SMOOTH);
10702+
} else {
10703+
glDisable(GL_LINE_SMOOTH);
10704+
}
10705+
#endif
10706+
10707+
#ifndef OPENGLES
10708+
if (_polygon_smooth_enabled) {
10709+
glEnable(GL_POLYGON_SMOOTH);
10710+
} else {
10711+
glDisable(GL_POLYGON_SMOOTH);
10712+
}
10713+
#endif
10714+
10715+
#ifdef SUPPORT_FIXED_FUNCTION
10716+
if (has_fixed_function_pipeline()) {
10717+
if (_alpha_test_enabled) {
10718+
glEnable(GL_ALPHA_TEST);
10719+
} else {
10720+
glDisable(GL_ALPHA_TEST);
10721+
}
10722+
if (_point_smooth_enabled) {
10723+
glEnable(GL_POINT_SMOOTH);
10724+
} else {
10725+
glDisable(GL_POINT_SMOOTH);
10726+
}
10727+
}
10728+
#endif
1066410729
}
1066510730

1066610731
#ifdef SUPPORT_FIXED_FUNCTION

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy