mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 05:01:05 +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:
		| @@ -331,6 +331,7 @@ ImGuiIO::ImGuiIO() | |||||||
|     MouseDoubleClickMaxDist = 6.0f; |     MouseDoubleClickMaxDist = 6.0f; | ||||||
|  |  | ||||||
|     // User functions |     // User functions | ||||||
|  |     UserData = NULL; | ||||||
|     RenderDrawListsFn = NULL; |     RenderDrawListsFn = NULL; | ||||||
|     MemAllocFn = malloc; |     MemAllocFn = malloc; | ||||||
|     MemReallocFn = realloc; |     MemReallocFn = realloc; | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								imgui.h
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								imgui.h
									
									
									
									
									
								
							| @@ -427,6 +427,9 @@ struct ImGuiIO | |||||||
|     // User Functions |     // User Functions | ||||||
|     //------------------------------------------------------------------ |     //------------------------------------------------------------------ | ||||||
|  |  | ||||||
|  |     // Store your own data for retrieval by callbacks. | ||||||
|  |     void*       UserData;                   // = NULL | ||||||
|  |  | ||||||
|     // REQUIRED: rendering function.  |     // REQUIRED: rendering function.  | ||||||
|     // See example code if you are unsure of how to implement this. |     // See example code if you are unsure of how to implement this. | ||||||
|     void        (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);       |     void        (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);       | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user