Question about Integrating JUCE with sokol 3D frame work

I want to integrate JUCE with GitHub - floooh/sokol: minimal cross-platform standalone C headers which is a populor 3d library, I got it working and the code is at : https://github.com/iomeone/jucesokoltest/blob/step1_triangle

I just want to know why the code at https://github.com/iomeone/jucesokoltest/blob/eb5251eeb8e2f8b2017af5ba58703ff6ca660da2/Source/MainComponent.cpp#L23

this->openGLContext.setComponentPaintingEnabled(false);

then the triangle would show, If I don’t add this line of code , the triangle would not show!

platform: windows 10 (19042.844)
compiler: visual studio 2022

JUCE’s OpenGLAppComponent an OpenGL context, which it uses to optionally render JUCE components. I’m not familiar with Sokol, but my guess is that it attempts to use the same OpenGL context, and that JUCE’s component painting leaves the OpenGL context in a state that Sokol doesn’t expect.

What you said makes sense. I also believe that JUCE’s component painting is not fully compatible with the state of Sokol’s OpenGL context.