[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:
@@ -8,6 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
|
||||
namespace Profiler
|
||||
{
|
||||
@@ -31,5 +32,6 @@ namespace Profiler
|
||||
static constexpr AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
};
|
||||
|
||||
using ProfilerImGuiInterface = AZ::Interface<ProfilerImGuiRequests>;
|
||||
using ProfilerImGuiRequestBus = AZ::EBus<ProfilerImGuiRequests, ProfilerImGuiBusTraits>;
|
||||
} // namespace Profiler
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user