The ImDrawList advanced API allows one to register arbitrary callbacks to change the OpenGL state during rendering. This can be used to manipulate shaders or, in my case, to temporarily change the glBlendFunc for the rendering of one particular widget.
The
ImDrawList
advanced API allows one to register arbitrary callbacks to change the OpenGL state during rendering. This can be used to manipulate shaders or, in my case, to temporarily change theglBlendFunc
for the rendering of one particular widget.This needs support from the rendering engine. The Magnum integration is ignoring these, but this is how the standard OpenGL integration handles them: https://github.com/ocornut/imgui/blob/6a161b878943241ddecbeee4ae27103dbd2d33d0/backends/imgui_impl_opengl2.cpp#L163