UnrealImGui/Source/ImGui/Private/Widgets/SImGuiLayout.h
Sebastian d4ffe9443f Enforced IWYU-style PCH model:
- Removed explicit PCH.
- Fixed includes to compile for all supported engine versions, including non-unity builds.
- Configured build.cs to treat ImGui as an engine module and added stricter compilation rules.
2020-06-25 10:52:46 +01:00

44 lines
1009 B
C++

// Distributed under the MIT License (MIT) (see accompanying LICENSE file)
#pragma once
#include <UObject/WeakObjectPtr.h>
#include <Widgets/DeclarativeSyntaxSupport.h>
#include <Widgets/SCompoundWidget.h>
class FImGuiModuleManager;
class UGameViewportClient;
struct FImGuiDPIScaleInfo;
// Layout preset for ImGui Widget.
class SImGuiLayout : public SCompoundWidget
{
typedef SCompoundWidget Super;
public:
SLATE_BEGIN_ARGS(SImGuiLayout)
{}
SLATE_ARGUMENT(FImGuiModuleManager*, ModuleManager)
SLATE_ARGUMENT(UGameViewportClient*, GameViewport)
SLATE_ARGUMENT(int32, ContextIndex)
SLATE_END_ARGS()
void Construct(const FArguments& InArgs);
~SImGuiLayout();
const TWeakObjectPtr<UGameViewportClient>& GetGameViewport() const { return GameViewport; }
private:
float GetDPIScale() const { return DPIScale; }
void SetDPIScale(const FImGuiDPIScaleInfo& ScaleInfo);
FImGuiModuleManager* ModuleManager = nullptr;
TWeakObjectPtr<UGameViewportClient> GameViewport;
float DPIScale = 1.f;
};