Moved preview renderer files to atom tools framework
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
This commit is contained in:
@@ -0,0 +1,259 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Feature/Utils/FrameCaptureBus.h>
|
||||
#include <Atom/RPI.Public/Pass/Specific/RenderToTexturePass.h>
|
||||
#include <Atom/RPI.Public/RPISystemInterface.h>
|
||||
#include <Atom/RPI.Public/RenderPipeline.h>
|
||||
#include <Atom/RPI.Public/Scene.h>
|
||||
#include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
|
||||
#include <Atom/RPI.Public/View.h>
|
||||
#include <Atom/RPI.Reflect/System/RenderPipelineDescriptor.h>
|
||||
#include <Atom/RPI.Reflect/System/SceneDescriptor.h>
|
||||
#include <AzCore/Math/MatrixUtils.h>
|
||||
#include <AzCore/Math/Transform.h>
|
||||
#include <AzFramework/Scene/Scene.h>
|
||||
#include <AzFramework/Scene/SceneSystemInterface.h>
|
||||
#include <Thumbnails/Rendering/CommonPreviewRenderer.h>
|
||||
#include <Thumbnails/Rendering/CommonPreviewRendererCaptureState.h>
|
||||
#include <Thumbnails/Rendering/CommonPreviewRendererIdleState.h>
|
||||
#include <Thumbnails/Rendering/CommonPreviewRendererLoadState.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace LyIntegration
|
||||
{
|
||||
namespace Thumbnails
|
||||
{
|
||||
CommonPreviewRenderer::CommonPreviewRenderer()
|
||||
{
|
||||
PreviewerFeatureProcessorProviderBus::Handler::BusConnect();
|
||||
|
||||
m_entityContext = AZStd::make_unique<AzFramework::EntityContext>();
|
||||
m_entityContext->InitContext();
|
||||
|
||||
// Create and register a scene with all required feature processors
|
||||
AZStd::unordered_set<AZStd::string> featureProcessors;
|
||||
PreviewerFeatureProcessorProviderBus::Broadcast(
|
||||
&PreviewerFeatureProcessorProviderBus::Handler::GetRequiredFeatureProcessors, featureProcessors);
|
||||
|
||||
RPI::SceneDescriptor sceneDesc;
|
||||
sceneDesc.m_featureProcessorNames.assign(featureProcessors.begin(), featureProcessors.end());
|
||||
m_scene = RPI::Scene::CreateScene(sceneDesc);
|
||||
|
||||
// Bind m_frameworkScene to the entity context's AzFramework::Scene
|
||||
auto sceneSystem = AzFramework::SceneSystemInterface::Get();
|
||||
AZ_Assert(sceneSystem, "Failed to get scene system implementation.");
|
||||
|
||||
Outcome<AZStd::shared_ptr<AzFramework::Scene>, AZStd::string> createSceneOutcome = sceneSystem->CreateScene(m_sceneName);
|
||||
AZ_Assert(createSceneOutcome, createSceneOutcome.GetError().c_str());
|
||||
|
||||
m_frameworkScene = createSceneOutcome.TakeValue();
|
||||
m_frameworkScene->SetSubsystem(m_scene);
|
||||
m_frameworkScene->SetSubsystem(m_entityContext.get());
|
||||
|
||||
// Create a render pipeline from the specified asset for the window context and add the pipeline to the scene
|
||||
RPI::RenderPipelineDescriptor pipelineDesc;
|
||||
pipelineDesc.m_mainViewTagName = "MainCamera";
|
||||
pipelineDesc.m_name = m_pipelineName;
|
||||
pipelineDesc.m_rootPassTemplate = "MainPipelineRenderToTexture";
|
||||
|
||||
// We have to set the samples to 4 to match the pipeline passes' setting, otherwise it may lead to device lost issue
|
||||
// [GFX TODO] [ATOM-13551] Default value sand validation required to prevent pipeline crash and device lost
|
||||
pipelineDesc.m_renderSettings.m_multisampleState.m_samples = 4;
|
||||
m_renderPipeline = RPI::RenderPipeline::CreateRenderPipeline(pipelineDesc);
|
||||
m_scene->AddRenderPipeline(m_renderPipeline);
|
||||
m_scene->Activate();
|
||||
RPI::RPISystemInterface::Get()->RegisterScene(m_scene);
|
||||
m_passHierarchy.push_back(m_pipelineName);
|
||||
m_passHierarchy.push_back("CopyToSwapChain");
|
||||
|
||||
// Connect camera to pipeline's default view after camera entity activated
|
||||
Matrix4x4 viewToClipMatrix;
|
||||
MakePerspectiveFovMatrixRH(viewToClipMatrix, FieldOfView, AspectRatio, NearDist, FarDist, true);
|
||||
m_view = RPI::View::CreateView(Name("MainCamera"), RPI::View::UsageCamera);
|
||||
m_view->SetViewToClipMatrix(viewToClipMatrix);
|
||||
m_renderPipeline->SetDefaultView(m_view);
|
||||
|
||||
m_states[CommonPreviewRenderer::State::IdleState] = AZStd::make_shared<CommonPreviewRendererIdleState>(this);
|
||||
m_states[CommonPreviewRenderer::State::LoadState] = AZStd::make_shared<CommonPreviewRendererLoadState>(this);
|
||||
m_states[CommonPreviewRenderer::State::CaptureState] = AZStd::make_shared<CommonPreviewRendererCaptureState>(this);
|
||||
SetState(CommonPreviewRenderer::State::IdleState);
|
||||
}
|
||||
|
||||
CommonPreviewRenderer::~CommonPreviewRenderer()
|
||||
{
|
||||
PreviewerFeatureProcessorProviderBus::Handler::BusDisconnect();
|
||||
|
||||
SetState(CommonPreviewRenderer::State::None);
|
||||
m_currentCaptureRequest = {};
|
||||
m_captureRequestQueue = {};
|
||||
|
||||
m_scene->Deactivate();
|
||||
m_scene->RemoveRenderPipeline(m_renderPipeline->GetId());
|
||||
RPI::RPISystemInterface::Get()->UnregisterScene(m_scene);
|
||||
m_frameworkScene->UnsetSubsystem(m_scene);
|
||||
m_frameworkScene->UnsetSubsystem(m_entityContext.get());
|
||||
}
|
||||
|
||||
RPI::ScenePtr CommonPreviewRenderer::GetScene() const
|
||||
{
|
||||
return m_scene;
|
||||
}
|
||||
|
||||
RPI::ViewPtr CommonPreviewRenderer::GetView() const
|
||||
{
|
||||
return m_view;
|
||||
}
|
||||
|
||||
AZ::Uuid CommonPreviewRenderer::GetEntityContextId() const
|
||||
{
|
||||
return m_entityContext->GetContextId();
|
||||
}
|
||||
|
||||
void CommonPreviewRenderer::AddCaptureRequest(const CaptureRequest& captureRequest)
|
||||
{
|
||||
m_captureRequestQueue.push(captureRequest);
|
||||
}
|
||||
|
||||
void CommonPreviewRenderer::SetState(State state)
|
||||
{
|
||||
auto stepItr = m_states.find(m_currentState);
|
||||
if (stepItr != m_states.end())
|
||||
{
|
||||
stepItr->second->Stop();
|
||||
}
|
||||
|
||||
m_currentState = state;
|
||||
|
||||
stepItr = m_states.find(m_currentState);
|
||||
if (stepItr != m_states.end())
|
||||
{
|
||||
stepItr->second->Start();
|
||||
}
|
||||
}
|
||||
|
||||
CommonPreviewRenderer::State CommonPreviewRenderer::GetState() const
|
||||
{
|
||||
return m_currentState;
|
||||
}
|
||||
|
||||
void CommonPreviewRenderer::SelectCaptureRequest()
|
||||
{
|
||||
if (!m_captureRequestQueue.empty())
|
||||
{
|
||||
// pop the next request to be rendered from the queue
|
||||
m_currentCaptureRequest = m_captureRequestQueue.front();
|
||||
m_captureRequestQueue.pop();
|
||||
|
||||
SetState(CommonPreviewRenderer::State::LoadState);
|
||||
}
|
||||
}
|
||||
|
||||
void CommonPreviewRenderer::CancelCaptureRequest()
|
||||
{
|
||||
m_currentCaptureRequest.m_captureFailedCallback();
|
||||
SetState(CommonPreviewRenderer::State::IdleState);
|
||||
}
|
||||
|
||||
void CommonPreviewRenderer::CompleteCaptureRequest()
|
||||
{
|
||||
SetState(CommonPreviewRenderer::State::IdleState);
|
||||
}
|
||||
|
||||
void CommonPreviewRenderer::LoadAssets()
|
||||
{
|
||||
m_currentCaptureRequest.m_content->Load();
|
||||
}
|
||||
|
||||
void CommonPreviewRenderer::UpdateLoadAssets()
|
||||
{
|
||||
if (m_currentCaptureRequest.m_content->IsReady())
|
||||
{
|
||||
SetState(CommonPreviewRenderer::State::CaptureState);
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_currentCaptureRequest.m_content->IsError())
|
||||
{
|
||||
CancelLoadAssets();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void CommonPreviewRenderer::CancelLoadAssets()
|
||||
{
|
||||
m_currentCaptureRequest.m_content->ReportErrors();
|
||||
CancelCaptureRequest();
|
||||
}
|
||||
|
||||
void CommonPreviewRenderer::UpdateScene()
|
||||
{
|
||||
m_currentCaptureRequest.m_content->UpdateScene();
|
||||
}
|
||||
|
||||
bool CommonPreviewRenderer::StartCapture()
|
||||
{
|
||||
auto captureCallback =
|
||||
[currentCaptureRequest = m_currentCaptureRequest](const RPI::AttachmentReadback::ReadbackResult& result)
|
||||
{
|
||||
if (result.m_dataBuffer)
|
||||
{
|
||||
currentCaptureRequest.m_captureCompleteCallback(QImage(
|
||||
result.m_dataBuffer.get()->data(), result.m_imageDescriptor.m_size.m_width,
|
||||
result.m_imageDescriptor.m_size.m_height, QImage::Format_RGBA8888));
|
||||
}
|
||||
else
|
||||
{
|
||||
currentCaptureRequest.m_captureFailedCallback();
|
||||
}
|
||||
};
|
||||
|
||||
if (auto renderToTexturePass = azrtti_cast<AZ::RPI::RenderToTexturePass*>(m_renderPipeline->GetRootPass().get()))
|
||||
{
|
||||
renderToTexturePass->ResizeOutput(m_currentCaptureRequest.m_size, m_currentCaptureRequest.m_size);
|
||||
}
|
||||
|
||||
m_renderPipeline->AddToRenderTickOnce();
|
||||
|
||||
bool startedCapture = false;
|
||||
Render::FrameCaptureRequestBus::BroadcastResult(
|
||||
startedCapture, &Render::FrameCaptureRequestBus::Events::CapturePassAttachmentWithCallback, m_passHierarchy,
|
||||
AZStd::string("Output"), captureCallback, RPI::PassAttachmentReadbackOption::Output);
|
||||
return startedCapture;
|
||||
}
|
||||
|
||||
void CommonPreviewRenderer::EndCapture()
|
||||
{
|
||||
m_renderPipeline->RemoveFromRenderTick();
|
||||
}
|
||||
|
||||
void CommonPreviewRenderer::GetRequiredFeatureProcessors(AZStd::unordered_set<AZStd::string>& featureProcessors) const
|
||||
{
|
||||
featureProcessors.insert({
|
||||
"AZ::Render::TransformServiceFeatureProcessor",
|
||||
"AZ::Render::MeshFeatureProcessor",
|
||||
"AZ::Render::SimplePointLightFeatureProcessor",
|
||||
"AZ::Render::SimpleSpotLightFeatureProcessor",
|
||||
"AZ::Render::PointLightFeatureProcessor",
|
||||
// There is currently a bug where having multiple DirectionalLightFeatureProcessors active can result in shadow
|
||||
// flickering [ATOM-13568]
|
||||
// as well as continually rebuilding MeshDrawPackets [ATOM-13633]. Lets just disable the directional light FP for now.
|
||||
// Possibly re-enable with [GFX TODO][ATOM-13639]
|
||||
// "AZ::Render::DirectionalLightFeatureProcessor",
|
||||
"AZ::Render::DiskLightFeatureProcessor",
|
||||
"AZ::Render::CapsuleLightFeatureProcessor",
|
||||
"AZ::Render::QuadLightFeatureProcessor",
|
||||
"AZ::Render::DecalTextureArrayFeatureProcessor",
|
||||
"AZ::Render::ImageBasedLightFeatureProcessor",
|
||||
"AZ::Render::PostProcessFeatureProcessor",
|
||||
"AZ::Render::SkyBoxFeatureProcessor" });
|
||||
}
|
||||
} // namespace Thumbnails
|
||||
} // namespace LyIntegration
|
||||
} // namespace AZ
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Thumbnails/Rendering/CommonPreviewRenderer.h>
|
||||
#include <Thumbnails/Rendering/CommonPreviewRendererCaptureState.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace LyIntegration
|
||||
{
|
||||
namespace Thumbnails
|
||||
{
|
||||
CommonPreviewRendererCaptureState::CommonPreviewRendererCaptureState(CommonPreviewRenderer* renderer)
|
||||
: CommonPreviewRendererState(renderer)
|
||||
{
|
||||
}
|
||||
|
||||
void CommonPreviewRendererCaptureState::Start()
|
||||
{
|
||||
m_ticksToCapture = 1;
|
||||
m_renderer->UpdateScene();
|
||||
TickBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
void CommonPreviewRendererCaptureState::Stop()
|
||||
{
|
||||
m_renderer->EndCapture();
|
||||
TickBus::Handler::BusDisconnect();
|
||||
Render::FrameCaptureNotificationBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
void CommonPreviewRendererCaptureState::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] ScriptTimePoint time)
|
||||
{
|
||||
if (m_ticksToCapture-- <= 0)
|
||||
{
|
||||
// Reset the capture flag if the capture request was successful. Otherwise try capture it again next tick.
|
||||
if (m_renderer->StartCapture())
|
||||
{
|
||||
Render::FrameCaptureNotificationBus::Handler::BusConnect();
|
||||
TickBus::Handler::BusDisconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CommonPreviewRendererCaptureState::OnCaptureFinished(
|
||||
[[maybe_unused]] Render::FrameCaptureResult result, [[maybe_unused]] const AZStd::string& info)
|
||||
{
|
||||
m_renderer->CompleteCaptureRequest();
|
||||
}
|
||||
} // namespace Thumbnails
|
||||
} // namespace LyIntegration
|
||||
} // namespace AZ
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Atom/Feature/Utils/FrameCaptureBus.h>
|
||||
#include <AzCore/Component/TickBus.h>
|
||||
#include <Thumbnails/Rendering/CommonPreviewRendererState.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace LyIntegration
|
||||
{
|
||||
namespace Thumbnails
|
||||
{
|
||||
//! CommonPreviewRendererCaptureState renders a thumbnail to a pixmap and notifies MaterialOrModelThumbnail once finished
|
||||
class CommonPreviewRendererCaptureState
|
||||
: public CommonPreviewRendererState
|
||||
, private TickBus::Handler
|
||||
, private Render::FrameCaptureNotificationBus::Handler
|
||||
{
|
||||
public:
|
||||
CommonPreviewRendererCaptureState(CommonPreviewRenderer* renderer);
|
||||
|
||||
void Start() override;
|
||||
void Stop() override;
|
||||
|
||||
private:
|
||||
//! AZ::TickBus::Handler interface overrides...
|
||||
void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
|
||||
|
||||
//! Render::FrameCaptureNotificationBus::Handler overrides...
|
||||
void OnCaptureFinished(Render::FrameCaptureResult result, const AZStd::string& info) override;
|
||||
|
||||
//! This is necessary to suspend capture to allow a frame for Material and Mesh components to assign materials
|
||||
int m_ticksToCapture = 0;
|
||||
};
|
||||
} // namespace Thumbnails
|
||||
} // namespace LyIntegration
|
||||
} // namespace AZ
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Thumbnails/Rendering/CommonPreviewRenderer.h>
|
||||
#include <Thumbnails/Rendering/CommonPreviewRendererIdleState.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace LyIntegration
|
||||
{
|
||||
namespace Thumbnails
|
||||
{
|
||||
CommonPreviewRendererIdleState::CommonPreviewRendererIdleState(CommonPreviewRenderer* renderer)
|
||||
: CommonPreviewRendererState(renderer)
|
||||
{
|
||||
}
|
||||
|
||||
void CommonPreviewRendererIdleState::Start()
|
||||
{
|
||||
TickBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
void CommonPreviewRendererIdleState::Stop()
|
||||
{
|
||||
TickBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
void CommonPreviewRendererIdleState::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] ScriptTimePoint time)
|
||||
{
|
||||
m_renderer->SelectCaptureRequest();
|
||||
}
|
||||
} // namespace Thumbnails
|
||||
} // namespace LyIntegration
|
||||
} // namespace AZ
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Thumbnails/Rendering/CommonPreviewRendererState.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace LyIntegration
|
||||
{
|
||||
namespace Thumbnails
|
||||
{
|
||||
//! CommonPreviewRendererIdleState checks whether there are any new thumbnails that need to be rendered every tick
|
||||
class CommonPreviewRendererIdleState
|
||||
: public CommonPreviewRendererState
|
||||
, private TickBus::Handler
|
||||
{
|
||||
public:
|
||||
CommonPreviewRendererIdleState(CommonPreviewRenderer* renderer);
|
||||
|
||||
void Start() override;
|
||||
void Stop() override;
|
||||
|
||||
private:
|
||||
|
||||
//! AZ::TickBus::Handler interface overrides...
|
||||
void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
|
||||
};
|
||||
} // namespace Thumbnails
|
||||
} // namespace LyIntegration
|
||||
} // namespace AZ
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Thumbnails/Rendering/CommonPreviewRenderer.h>
|
||||
#include <Thumbnails/Rendering/CommonPreviewRendererLoadState.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace LyIntegration
|
||||
{
|
||||
namespace Thumbnails
|
||||
{
|
||||
CommonPreviewRendererLoadState::CommonPreviewRendererLoadState(CommonPreviewRenderer* renderer)
|
||||
: CommonPreviewRendererState(renderer)
|
||||
{
|
||||
}
|
||||
|
||||
void CommonPreviewRendererLoadState::Start()
|
||||
{
|
||||
m_renderer->LoadAssets();
|
||||
m_timeRemainingS = TimeOutS;
|
||||
TickBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
void CommonPreviewRendererLoadState::Stop()
|
||||
{
|
||||
TickBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
void CommonPreviewRendererLoadState::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time)
|
||||
{
|
||||
m_timeRemainingS -= deltaTime;
|
||||
if (m_timeRemainingS > 0.0f)
|
||||
{
|
||||
m_renderer->UpdateLoadAssets();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_renderer->CancelLoadAssets();
|
||||
}
|
||||
}
|
||||
} // namespace Thumbnails
|
||||
} // namespace LyIntegration
|
||||
} // namespace AZ
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Component/TickBus.h>
|
||||
#include <Thumbnails/Rendering/CommonPreviewRendererState.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace LyIntegration
|
||||
{
|
||||
namespace Thumbnails
|
||||
{
|
||||
//! CommonPreviewRendererLoadState pauses further rendering until all assets used for rendering a thumbnail have been loaded
|
||||
class CommonPreviewRendererLoadState
|
||||
: public CommonPreviewRendererState
|
||||
, private TickBus::Handler
|
||||
{
|
||||
public:
|
||||
CommonPreviewRendererLoadState(CommonPreviewRenderer* renderer);
|
||||
|
||||
void Start() override;
|
||||
void Stop() override;
|
||||
|
||||
private:
|
||||
//! AZ::TickBus::Handler interface overrides...
|
||||
void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
|
||||
|
||||
static constexpr float TimeOutS = 5.0f;
|
||||
float m_timeRemainingS = TimeOutS;
|
||||
};
|
||||
} // namespace Thumbnails
|
||||
} // namespace LyIntegration
|
||||
} // namespace AZ
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace LyIntegration
|
||||
{
|
||||
namespace Thumbnails
|
||||
{
|
||||
class CommonPreviewRenderer;
|
||||
|
||||
//! CommonPreviewRendererState decouples CommonPreviewRenderer logic into easy-to-understand and debug pieces
|
||||
class CommonPreviewRendererState
|
||||
{
|
||||
public:
|
||||
explicit CommonPreviewRendererState(CommonPreviewRenderer* renderer) : m_renderer(renderer) {}
|
||||
virtual ~CommonPreviewRendererState() = default;
|
||||
|
||||
//! Start is called when state begins execution
|
||||
virtual void Start() {}
|
||||
//! Stop is called when state ends execution
|
||||
virtual void Stop() {}
|
||||
|
||||
protected:
|
||||
CommonPreviewRenderer* m_renderer;
|
||||
};
|
||||
} // namespace Thumbnails
|
||||
} // namespace LyIntegration
|
||||
} // namespace AZ
|
||||
|
||||
Reference in New Issue
Block a user