1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-28 01:20:55 +01:00

Added a UserData void *pointer so that the callback functions can 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:
ocornut 2014-10-05 09:08:57 +01:00
parent 36212b9ad9
commit 1d9a4748de
2 changed files with 4 additions and 0 deletions

View File

@ -331,6 +331,7 @@ ImGuiIO::ImGuiIO()
MouseDoubleClickMaxDist = 6.0f;
// User functions
UserData = NULL;
RenderDrawListsFn = NULL;
MemAllocFn = malloc;
MemReallocFn = realloc;

View File

@ -427,6 +427,9 @@ struct ImGuiIO
// User Functions
//------------------------------------------------------------------
// Store your own data for retrieval by callbacks.
void* UserData; // = NULL
// REQUIRED: rendering function.
// See example code if you are unsure of how to implement this.
void (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);