refactor: back editor host rendering with engine rhi

This commit is contained in:
2026-03-28 16:50:04 +08:00
parent 519bc1dbf2
commit 6fcb6ac8fb
4 changed files with 247 additions and 165 deletions

View File

@@ -4,6 +4,7 @@
#include "UI/ImGuiBackendBridge.h"
#include "UI/ImGuiSession.h"
#include <XCEngine/Rendering/RenderContext.h>
#include <memory>
#include <string>
#include <windows.h>
@@ -11,6 +12,11 @@
#include <XCEngine/Core/LayerStack.h>
namespace XCEngine {
namespace RHI {
class RHIDevice;
class RHISwapChain;
} // namespace RHI
namespace Editor {
class EditorLayer;
@@ -26,6 +32,9 @@ public:
void OnResize(int width, int height);
bool SwitchProject(const std::string& projectPath);
void SaveProjectState();
Rendering::RenderContext GetMainRenderContext() const { return m_windowRenderer.GetRenderContext(); }
RHI::RHIDevice* GetMainRHIDevice() const { return m_windowRenderer.GetRHIDevice(); }
RHI::RHISwapChain* GetMainSwapChain() const { return m_windowRenderer.GetSwapChain(); }
bool IsRenderReady() const { return m_renderReady; }
HWND GetWindowHandle() const { return m_hwnd; }