mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-04 07:01:04 +01:00 
			
		
		
		
	Enabled us to create the internal state on client side allocated memory, e.g. a heap
This commit is contained in:
		
							
								
								
									
										10
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								imgui.cpp
									
									
									
									
									
								
							@@ -1609,8 +1609,16 @@ void* ImGui::GetInternalState()
 | 
			
		||||
	return GImGui;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ImGui::SetInternalState(void* state)
 | 
			
		||||
unsigned ImGui::GetInternalStateSize()
 | 
			
		||||
{
 | 
			
		||||
	return sizeof(ImGuiState);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ImGui::SetInternalState(void* state, bool construct)
 | 
			
		||||
{
 | 
			
		||||
	if( construct )
 | 
			
		||||
		new (state) ImGuiState;
 | 
			
		||||
	
 | 
			
		||||
	GImGui = (ImGuiState*)state;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								imgui.h
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								imgui.h
									
									
									
									
									
								
							@@ -144,7 +144,8 @@ namespace ImGui
 | 
			
		||||
{
 | 
			
		||||
    // Main
 | 
			
		||||
	IMGUI_API void*         GetInternalState();
 | 
			
		||||
	IMGUI_API void          SetInternalState(void* state);
 | 
			
		||||
	IMGUI_API unsigned      GetInternalStateSize();
 | 
			
		||||
	IMGUI_API void          SetInternalState(void* state, bool construct = false);
 | 
			
		||||
    IMGUI_API ImGuiIO&      GetIO();
 | 
			
		||||
    IMGUI_API ImGuiStyle&   GetStyle();
 | 
			
		||||
    IMGUI_API void          NewFrame();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user