#include "Scene/SceneViewportFeature.h" #include "Panels/EditorPanelIds.h" #include "Interfaces/UiTextureHost.h" #include "Viewport/ViewportHostService.h" #include "EditorSceneRuntime.h" #include "EditorCommandFocusService.h" namespace XCEngine::UI::Editor::App { void SceneViewportFeature::Initialize( const std::filesystem::path& repoRoot, Rendering::Host::UiTextureHost& textureHost, const BuiltInIcons* builtInIcons, ViewportHostService& viewportHostService) { viewportHostService.SetContentRenderer( kScenePanelId, &m_renderService, SceneViewportRenderService::GetViewportResourceRequirements()); m_controller.Initialize(repoRoot, textureHost, builtInIcons); } void SceneViewportFeature::Shutdown( Rendering::Host::UiTextureHost& textureHost, ViewportHostService& viewportHostService) { viewportHostService.SetContentRenderer(kScenePanelId, nullptr, {}); m_controller.Shutdown(textureHost); m_renderService.Shutdown(); } void SceneViewportFeature::ResetInteractionState() { m_controller.ResetInteractionState(); } void SceneViewportFeature::SetCommandFocusService( EditorCommandFocusService* commandFocusService) { m_controller.SetCommandFocusService(commandFocusService); } void SceneViewportFeature::SyncRenderRequest(EditorSceneRuntime& sceneRuntime) { m_renderService.SetRenderRequest( sceneRuntime.BuildSceneViewportRenderRequest()); } void SceneViewportFeature::Update( EditorSceneRuntime& sceneRuntime, const UIEditorWorkspaceComposeState& composeState, const UIEditorWorkspaceComposeFrame& composeFrame) { m_controller.Update( sceneRuntime, m_renderService, composeState, composeFrame); SyncRenderRequest(sceneRuntime); } void SceneViewportFeature::Append(::XCEngine::UI::UIDrawList& drawList) const { m_controller.Append(drawList); } } // namespace XCEngine::UI::Editor::App