关键节点
This commit is contained in:
56
editor/app/Rendering/D3D12/D3D12WindowRenderLoop.h
Normal file
56
editor/app/Rendering/D3D12/D3D12WindowRenderLoop.h
Normal file
@@ -0,0 +1,56 @@
|
||||
#pragma once
|
||||
|
||||
#include <Rendering/D3D12/D3D12UiRenderer.h>
|
||||
#include <Rendering/D3D12/D3D12WindowRenderer.h>
|
||||
|
||||
#include <XCEngine/UI/DrawData.h>
|
||||
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
|
||||
namespace XCEngine::UI::Editor::Host {
|
||||
|
||||
struct D3D12WindowRenderLoopAttachResult {
|
||||
bool hasViewportSurfacePresentation = false;
|
||||
std::string warning = {};
|
||||
};
|
||||
|
||||
struct D3D12WindowRenderLoopFrameContext {
|
||||
bool canRenderViewports = false;
|
||||
::XCEngine::Rendering::RenderContext renderContext = {};
|
||||
std::string warning = {};
|
||||
};
|
||||
|
||||
struct D3D12WindowRenderLoopResizeResult {
|
||||
bool hasViewportSurfacePresentation = false;
|
||||
std::string windowRendererWarning = {};
|
||||
};
|
||||
|
||||
struct D3D12WindowRenderLoopPresentResult {
|
||||
bool framePresented = false;
|
||||
bool captureSucceeded = false;
|
||||
std::string captureError = {};
|
||||
std::string warning = {};
|
||||
};
|
||||
|
||||
class D3D12WindowRenderLoop {
|
||||
public:
|
||||
D3D12WindowRenderLoopAttachResult Attach(
|
||||
D3D12UiRenderer& uiRenderer,
|
||||
D3D12WindowRenderer& windowRenderer);
|
||||
void Detach();
|
||||
|
||||
D3D12WindowRenderLoopFrameContext BeginFrame() const;
|
||||
D3D12WindowRenderLoopResizeResult ApplyResize(UINT width, UINT height);
|
||||
D3D12WindowRenderLoopPresentResult Present(
|
||||
const ::XCEngine::UI::UIDrawData& drawData,
|
||||
const std::filesystem::path* captureOutputPath = nullptr);
|
||||
|
||||
bool HasViewportSurfacePresentation() const;
|
||||
|
||||
private:
|
||||
D3D12UiRenderer* m_uiRenderer = nullptr;
|
||||
D3D12WindowRenderer* m_windowRenderer = nullptr;
|
||||
};
|
||||
|
||||
} // namespace XCEngine::UI::Editor::Host
|
||||
Reference in New Issue
Block a user