public static void AddCallback(ImDrawListPtr drawList, CustomDrawEvent callback, object args = null) { int index = ImGuiDelegates.Count + 1; int dataIndex = ImGuiDelegateArgs.Count + 1; ImGuiDelegates.Add(callback); ImGuiDelegateArgs.Add(args); drawList.AddCallback((IntPtr)index, (IntPtr)dataIndex); }