UnrealImGui/Source/ImGui/Private/ImGuiImplementation.cpp
Sebastian 1a6aa98f51 Added support for session reloading and updated contexts and widgets management:
- Added to ImGui Context Proxy a name that is mapped to ini file set in ImGui context.
- ImGui Context Manager generates unique context names from world type and context index.
- Refactored ImGui Context Manager to have a cleaner separation between editor and non-editor bits.
- Fixed context update rules in ImGui Context Manager.
- Changed widgets management in ImGui Module Manager to allow automatic garbage collection after viewports are closed and manual removal when module is shutting down.
- ImGui Widgets are in full control of communication with context proxies.
- Added basic world context utilities.
- Refactored world context index utilities and replaced ambiguous 'default context index' with 'editor' and 'game' ones.
2017-09-27 21:16:54 +01:00

38 lines
1.2 KiB
C++

// Distributed under the MIT License (MIT) (see accompanying LICENSE file)
#include "ImGuiPrivatePCH.h"
// We build ImGui source code as part of this module. This is for convenience (no need to manually build libraries for
// different target platforms) but it also exposes the whole ImGui source for inspection, which can be pretty handy.
// Source files are included from Third Party directory, so we can wrap them in required by Unreal Build System headers
// without modifications in ImGui source code.
//
// We don't need to define IMGUI_API manually because it is already done for this module.
#if PLATFORM_WINDOWS
#include <AllowWindowsPlatformTypes.h>
#endif // PLATFORM_WINDOWS
#include "imgui.cpp"
#include "imgui_demo.cpp"
#include "imgui_draw.cpp"
#if PLATFORM_WINDOWS
#include <HideWindowsPlatformTypes.h>
#endif // PLATFORM_WINDOWS
namespace ImGuiImplementation
{
// This is exposing ImGui default context for the whole module.
// This is assuming that we don't define custom GImGui and therefore have GImDefaultContext defined in imgui.cpp.
ImGuiContext& GetDefaultContext()
{
return GImDefaultContext;
}
void SaveCurrentContextIniSettings(const char* Filename)
{
SaveIniSettingsToDisk(Filename);
}
}