@@ -72,6 +72,7 @@ public final class ImGuiImplGl3 {
72
72
private boolean lastEnableBlend = false ;
73
73
private boolean lastEnableCullFace = false ;
74
74
private boolean lastEnableDepthTest = false ;
75
+ private boolean lastEnableStencilTest = false ;
75
76
private boolean lastEnableScissorTest = false ;
76
77
77
78
/**
@@ -337,6 +338,7 @@ private void backupGlState() {
337
338
lastEnableBlend = glIsEnabled (GL_BLEND );
338
339
lastEnableCullFace = glIsEnabled (GL_CULL_FACE );
339
340
lastEnableDepthTest = glIsEnabled (GL_DEPTH_TEST );
341
+ lastEnableStencilTest = glIsEnabled (GL_STENCIL_TEST );
340
342
lastEnableScissorTest = glIsEnabled (GL_SCISSOR_TEST );
341
343
}
342
344
@@ -352,6 +354,7 @@ private void restoreModifiedGlState() {
352
354
if (lastEnableBlend ) glEnable (GL_BLEND ); else glDisable (GL_BLEND );
353
355
if (lastEnableCullFace ) glEnable (GL_CULL_FACE ); else glDisable (GL_CULL_FACE );
354
356
if (lastEnableDepthTest ) glEnable (GL_DEPTH_TEST ); else glDisable (GL_DEPTH_TEST );
357
+ if (lastEnableStencilTest ) glEnable (GL_STENCIL_TEST ); else glDisable (GL_STENCIL_TEST );
355
358
if (lastEnableScissorTest ) glEnable (GL_SCISSOR_TEST ); else glDisable (GL_SCISSOR_TEST );
356
359
// @formatter:on CHECKSTYLE:ON
357
360
glViewport (lastViewport [0 ], lastViewport [1 ], lastViewport [2 ], lastViewport [3 ]);
@@ -367,9 +370,10 @@ private void bind(final int fbWidth, final int fbHeight) {
367
370
// Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled, polygon fill
368
371
glEnable (GL_BLEND );
369
372
glBlendEquation (GL_FUNC_ADD );
370
- glBlendFunc (GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA );
373
+ glBlendFuncSeparate (GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA , GL_ONE , GL_ONE_MINUS_SRC_ALPHA );
371
374
glDisable (GL_CULL_FACE );
372
375
glDisable (GL_DEPTH_TEST );
376
+ glDisable (GL_STENCIL_TEST );
373
377
glEnable (GL_SCISSOR_TEST );
374
378
375
379
// Setup viewport, orthographic projection matrix
0 commit comments