Refine editor host boundary
This commit is contained in:
76
editor/app/Host/D3D12/D3D12EditorWindowRenderRuntime.h
Normal file
76
editor/app/Host/D3D12/D3D12EditorWindowRenderRuntime.h
Normal file
@@ -0,0 +1,76 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
|
||||
#include "D3D12UiRenderer.h"
|
||||
#include "D3D12UiTextSystem.h"
|
||||
#include "D3D12UiTextureHost.h"
|
||||
#include "D3D12WindowRenderLoop.h"
|
||||
#include "D3D12WindowRenderer.h"
|
||||
#include "EditorWindowRenderRuntime.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace XCEngine::UI::Editor::Host {
|
||||
|
||||
class D3D12EditorWindowRenderRuntime final
|
||||
: public ::XCEngine::UI::Editor::Rendering::Host::EditorWindowRenderRuntime {
|
||||
public:
|
||||
D3D12EditorWindowRenderRuntime() = default;
|
||||
~D3D12EditorWindowRenderRuntime() override;
|
||||
|
||||
D3D12EditorWindowRenderRuntime(const D3D12EditorWindowRenderRuntime&) = delete;
|
||||
D3D12EditorWindowRenderRuntime& operator=(const D3D12EditorWindowRenderRuntime&) = delete;
|
||||
D3D12EditorWindowRenderRuntime(D3D12EditorWindowRenderRuntime&&) = delete;
|
||||
D3D12EditorWindowRenderRuntime& operator=(D3D12EditorWindowRenderRuntime&&) = delete;
|
||||
|
||||
bool IsReady() const override;
|
||||
void SetDpiScale(float dpiScale) override;
|
||||
UIEditorTextMeasurer& GetTextMeasurer() override;
|
||||
const UIEditorTextMeasurer& GetTextMeasurer() const override;
|
||||
Rendering::Host::UiTextureHost& GetTextureHost() override;
|
||||
Rendering::Host::ViewportRenderHost& GetViewportRenderHost() override;
|
||||
|
||||
Rendering::Host::EditorWindowRenderRuntimeInitializeResult Initialize(
|
||||
const Rendering::Host::EditorWindowRenderRuntimeInitializeParams& params) override;
|
||||
void WaitForGpuIdle() override;
|
||||
void Shutdown() override;
|
||||
Rendering::Host::EditorWindowRenderRuntimeResizeResult ApplyResize(
|
||||
std::uint32_t width,
|
||||
std::uint32_t height) override;
|
||||
Rendering::Host::EditorWindowRenderRuntimeFrameContext BeginFrame() override;
|
||||
Rendering::Host::EditorWindowRenderRuntimePresentResult Present(
|
||||
const ::XCEngine::UI::UIDrawData& drawData,
|
||||
const std::filesystem::path* captureOutputPath) override;
|
||||
|
||||
private:
|
||||
D3D12WindowRenderer m_windowRenderer = {};
|
||||
D3D12UiTextureHost m_textureHost = {};
|
||||
D3D12UiTextSystem m_textSystem = {};
|
||||
D3D12UiRenderer m_uiRenderer = {};
|
||||
D3D12WindowRenderLoop m_windowRenderLoop = {};
|
||||
float m_dpiScale = 1.0f;
|
||||
bool m_ready = false;
|
||||
};
|
||||
|
||||
class D3D12EditorWindowRenderRuntimeFactory final
|
||||
: public ::XCEngine::UI::Editor::Rendering::Host::EditorWindowRenderRuntimeFactory {
|
||||
public:
|
||||
D3D12EditorWindowRenderRuntimeFactory() = default;
|
||||
~D3D12EditorWindowRenderRuntimeFactory() override = default;
|
||||
|
||||
D3D12EditorWindowRenderRuntimeFactory(
|
||||
const D3D12EditorWindowRenderRuntimeFactory&) = delete;
|
||||
D3D12EditorWindowRenderRuntimeFactory& operator=(
|
||||
const D3D12EditorWindowRenderRuntimeFactory&) = delete;
|
||||
D3D12EditorWindowRenderRuntimeFactory(D3D12EditorWindowRenderRuntimeFactory&&) = delete;
|
||||
D3D12EditorWindowRenderRuntimeFactory& operator=(
|
||||
D3D12EditorWindowRenderRuntimeFactory&&) = delete;
|
||||
|
||||
std::unique_ptr<Rendering::Host::EditorWindowRenderRuntime>
|
||||
CreateWindowRenderRuntime() override;
|
||||
};
|
||||
|
||||
} // namespace XCEngine::UI::Editor::Host
|
||||
Reference in New Issue
Block a user