You can use AddCallback() on a given ImDrawList:: to register functions to be run during rendering and use callbacks to alter your render state (e.g. enable depth testing + enable a custom shader with uniform to write a specific Z value into the framebuffer). This will be dependent on your rendering backend so you'll need to be familiar with your graphics stack to do it, and will require a bit of plumbing.
详见Depth test with imgui primitives · Issue #4022 · ocornut/imgui (github.com)
标签:ImGui,enable,use,imgui,will,rendering,测试,引入,your From: https://www.cnblogs.com/koala999/p/16779932.html