Files
XCEngine/editor/src/Application.h

57 lines
1.3 KiB
C++

#pragma once
#include "Platform/D3D12WindowRenderer.h"
#include "UI/ImGuiBackendBridge.h"
#include "UI/ImGuiSession.h"
#include <memory>
#include <string>
#include <windows.h>
#include <XCEngine/Core/LayerStack.h>
namespace XCEngine {
namespace Editor {
class EditorLayer;
class IEditorContext;
class Application {
public:
static Application& Get();
bool Initialize(HWND hwnd);
void Shutdown();
void Render();
void OnResize(int width, int height);
HWND GetWindowHandle() const { return m_hwnd; }
IEditorContext& GetEditorContext() const { return *m_editorContext; }
private:
Application() = default;
~Application() = default;
bool InitializeWindowRenderer(HWND hwnd);
void InitializeEditorContext(const std::string& projectPath);
void InitializeImGui(HWND hwnd);
void AttachEditorLayer();
void DetachEditorLayer();
void ShutdownEditorContext();
void RenderEditorFrame();
void UpdateWindowTitle();
HWND m_hwnd = nullptr;
Core::LayerStack m_layerStack;
EditorLayer* m_editorLayer = nullptr;
std::shared_ptr<IEditorContext> m_editorContext;
Platform::D3D12WindowRenderer m_windowRenderer;
UI::ImGuiBackendBridge m_imguiBackend;
UI::ImGuiSession m_imguiSession;
uint64_t m_exitRequestedHandlerId = 0;
std::wstring m_lastWindowTitle;
};
}
}