How to use ImDrawCallback_ResetRenderState?
draw_list->AddCallback(ImDrawCallback_ResetRenderState, nullptr); It seems this method won't work because we only have the ImDrawCallback delegate in our parameters. We need another method that will have this native parameter "delegate*<ImDrawList*, ImDrawCmd*, void> callback"
Hi, could you give more information about what exactly you mean, because i don't understand what you mean. And you can very well use those methods, you just have to use the NativeCallback helper from HexaGen.Runtime (which is available if you installed any Hexa.NET package)
I want to say that it is impossible to use ImGui.ImDrawCallbackResetRenderState because of the managed delegate
var draw_list = ImGui.GetWindowDrawList();
draw_list.AddDrawCmd();
draw_list.AddCallback(ImGui_ImplBlur_Begin, null);
draw_list.AddCallback(ImGui_ImplBlur_Pass, paramss);
draw_list.AddCallback(ImGui_ImplBlur_End, null);
draw_list.AddCallback(ImGui.ImDrawCallbackResetRenderState, null, 0);
https://github.com/itsRythem/DX11-ImGui-Kawase-Blur/blob/main/imgui_impl_blur.cpp#L403
we need these methods
class ImGui
{
public unsafe static void AddCallback(ImDrawListPtr self, delegate*<ImDrawList*, ImDrawCmd*, void> callback, void* userdata, nuint userdataSize);
}
struct ImDrawListPtr
{
public unsafe void AddCallback(delegate*<ImDrawList*, ImDrawCmd*, void> callback, void* userdata, nuint userdataSize);
}
struct ImDrawList
{
public unsafe void AddCallback(delegate*<ImDrawList*, ImDrawCmd*, void> callback, void* userdata, nuint userdataSize);
}