3#ifdef BUILDSYSTEM_ENABLE_IMGUI_SUPPORT
5# include <Core/ResourceManager/ResourceHandle.h>
6# include <Foundation/Configuration/Singleton.h>
7# include <Foundation/Math/Size.h>
8# include <Foundation/Memory/CommonAllocators.h>
9# include <Foundation/Types/UniquePtr.h>
10# include <GameEngine/GameEngineDLL.h>
11# include <RendererCore/Pipeline/Declarations.h>
13# include <Imgui/imgui.h>
19using plImguiConfigFontCallback =
plDelegate<void(ImFontAtlas&)>;
20using plImguiConfigStyleCallback =
plDelegate<void(ImGuiStyle&)>;
33class PL_GAMEENGINE_DLL plImgui
35 PL_DECLARE_SINGLETON(plImgui);
38 plImgui(plImguiConfigFontCallback configFontCallback = plImguiConfigFontCallback(),
39 plImguiConfigStyleCallback configStyleCallback = plImguiConfigStyleCallback());
43 void SetCurrentContextForView(
const plViewHandle& hView);
46 plSizeU32 GetCurrentWindowResolution()
const {
return m_CurrentWindowResolution; }
50 void SetPassInputToImgui(
bool bPassInput) { m_bPassInputToImgui = bPassInput; }
55 bool WantsInput()
const {
return m_bImguiWantsInput; }
58 ImFontAtlas& GetFontAtlas() {
return *m_pSharedFontAtlas; }
63 friend class plImguiExtractor;
64 friend class plImguiRenderer;
66 void Startup(plImguiConfigFontCallback configFontCallback);
69 ImGuiContext* CreateContext();
74 bool m_bPassInputToImgui =
true;
75 bool m_bImguiWantsInput =
false;
79 plImguiConfigStyleCallback m_ConfigStyleCallback;
85 ImGuiContext* m_pImGuiContext =
nullptr;
86 plUInt64 m_uiFrameBeginCounter = -1;
87 plUInt64 m_uiFrameRenderCounter = -1;
90 plMutex m_ViewToContextTableMutex;
Definition HashTable.h:333
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Provides a simple mechanism for mutual exclusion to prevent multiple threads from accessing a shared ...
Definition Mutex.h:13
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
Definition Declarations.h:64
A generic delegate class which supports static functions and member functions.
Definition Delegate.h:76