[atom_cpu_profiler_gem_promotion] added optional AZ::Interface usage to ProfilerImGuiRequests

Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com>
This commit is contained in:
AMZN-ScottR
2021-10-18 10:51:15 -07:00
parent 6480bc8b86
commit fa4e91b05c
2 changed files with 14 additions and 0 deletions
@@ -55,10 +55,22 @@ namespace Profiler
ProfilerImGuiSystemComponent::ProfilerImGuiSystemComponent()
{
#if defined(IMGUI_ENABLED)
if (ProfilerImGuiInterface::Get() == nullptr)
{
ProfilerImGuiInterface::Register(this);
}
#endif // defined(IMGUI_ENABLED)
}
ProfilerImGuiSystemComponent::~ProfilerImGuiSystemComponent()
{
#if defined(IMGUI_ENABLED)
if (ProfilerImGuiInterface::Get() == this)
{
ProfilerImGuiInterface::Unregister(this);
}
#endif // defined(IMGUI_ENABLED)
}
void ProfilerImGuiSystemComponent::Activate()