IO: Added GetPlatformIO(), ImGuiPlatformIO, currently empty.

This commit is contained in:
ocornut
2024-08-22 16:31:10 +02:00
parent 8e40104795
commit e6460722ea
4 changed files with 32 additions and 6 deletions

View File

@@ -63,7 +63,7 @@ CODE
// [SECTION] INCLUDES
// [SECTION] FORWARD DECLARATIONS
// [SECTION] CONTEXT AND MEMORY ALLOCATORS
// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO)
// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO, ImGuiPlatformIO)
// [SECTION] MISC HELPERS/UTILITIES (Geometry functions)
// [SECTION] MISC HELPERS/UTILITIES (String, Format, Hash functions)
// [SECTION] MISC HELPERS/UTILITIES (File functions)
@@ -1244,7 +1244,7 @@ static ImGuiMemFreeFunc GImAllocatorFreeFunc = FreeWrapper;
static void* GImAllocatorUserData = NULL;
//-----------------------------------------------------------------------------
// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO)
// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO, ImGuiPlatformIO)
//-----------------------------------------------------------------------------
ImGuiStyle::ImGuiStyle()
@@ -1762,6 +1762,12 @@ void ImGuiIO::AddFocusEvent(bool focused)
g.InputEventsQueue.push_back(e);
}
ImGuiPlatformIO::ImGuiPlatformIO()
{
// Most fields are initialized with zero
memset(this, 0, sizeof(*this));
}
//-----------------------------------------------------------------------------
// [SECTION] MISC HELPERS/UTILITIES (Geometry functions)
//-----------------------------------------------------------------------------
@@ -4461,6 +4467,12 @@ ImGuiIO& ImGui::GetIO()
return GImGui->IO;
}
ImGuiPlatformIO& ImGui::GetPlatformIO()
{
IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext()?");
return GImGui->PlatformIO;
}
// Pass this to your backend rendering function! Valid after Render() and until the next call to NewFrame()
ImDrawData* ImGui::GetDrawData()
{