1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-12 00:14:20 +00:00

Add a UserData pointer so that the callback functions can easily access user state.

Just in case a project has adverse reactions to adding globals or statics in their own code.
This commit is contained in:
Sean Middleditch 2014-10-04 21:59:18 -07:00
parent 36212b9ad9
commit c40dc84909
2 changed files with 2 additions and 0 deletions

View file

@ -332,6 +332,7 @@ ImGuiIO::ImGuiIO()
// User functions
RenderDrawListsFn = NULL;
UserData = NULL;
MemAllocFn = malloc;
MemReallocFn = realloc;
MemFreeFn = free;

View file

@ -430,6 +430,7 @@ struct ImGuiIO
// REQUIRED: rendering function.
// See example code if you are unsure of how to implement this.
void (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);
void* UserData;
// Optional: access OS clipboard (default to use native Win32 clipboard on Windows, otherwise use a ImGui private clipboard)
// Override to access OS clipboard on other architectures.