Everything compiling again after moving preview renderer to atom tools framework

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
This commit is contained in:
Guthrie Adams
2021-10-08 04:33:45 -05:00
parent 569318e9e1
commit 76b4dafbb3
20 changed files with 515 additions and 583 deletions
@@ -6,52 +6,46 @@
*
*/
#include <Thumbnails/Rendering/CommonPreviewRenderer.h>
#include <Thumbnails/Rendering/CommonPreviewRendererCaptureState.h>
#include <AtomToolsFramework/PreviewRenderer/PreviewRenderer.h>
#include <PreviewRenderer/PreviewRendererCaptureState.h>
namespace AZ
namespace AtomToolsFramework
{
namespace LyIntegration
PreviewRendererCaptureState::PreviewRendererCaptureState(PreviewRenderer* renderer)
: PreviewRendererState(renderer)
{
namespace Thumbnails
}
void PreviewRendererCaptureState::Start()
{
m_ticksToCapture = 1;
m_renderer->UpdateScene();
AZ::TickBus::Handler::BusConnect();
}
void PreviewRendererCaptureState::Stop()
{
m_renderer->EndCapture();
AZ::TickBus::Handler::BusDisconnect();
AZ::Render::FrameCaptureNotificationBus::Handler::BusDisconnect();
}
void PreviewRendererCaptureState::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time)
{
if (m_ticksToCapture-- <= 0)
{
CommonPreviewRendererCaptureState::CommonPreviewRendererCaptureState(CommonPreviewRenderer* renderer)
: CommonPreviewRendererState(renderer)
// Reset the capture flag if the capture request was successful. Otherwise try capture it again next tick.
if (m_renderer->StartCapture())
{
AZ::Render::FrameCaptureNotificationBus::Handler::BusConnect();
AZ::TickBus::Handler::BusDisconnect();
}
}
}
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
void PreviewRendererCaptureState::OnCaptureFinished(
[[maybe_unused]] AZ::Render::FrameCaptureResult result, [[maybe_unused]] const AZStd::string& info)
{
m_renderer->CompleteCaptureRequest();
}
} // namespace AtomToolsFramework