ProfilerImGuiModule.cpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <ProfilerImGuiSystemComponent.h>
  9. #include <ProfilerSystemComponent.h>
  10. #include <AzCore/Memory/SystemAllocator.h>
  11. #include <AzCore/Module/Module.h>
  12. namespace Profiler
  13. {
  14. class ProfilerImGuiModule
  15. : public AZ::Module
  16. {
  17. public:
  18. AZ_RTTI(ProfilerImGuiModule, "{5946991E-A96C-4E7A-A9B3-605E3C8EC3CB}", AZ::Module);
  19. AZ_CLASS_ALLOCATOR(ProfilerImGuiModule, AZ::SystemAllocator);
  20. ProfilerImGuiModule()
  21. {
  22. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  23. // Add ALL components descriptors associated with this gem to m_descriptors.
  24. // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext.
  25. // This happens through the [MyComponent]::Reflect() function.
  26. m_descriptors.insert(m_descriptors.end(), {
  27. ProfilerSystemComponent::CreateDescriptor(),
  28. ProfilerImGuiSystemComponent::CreateDescriptor(),
  29. });
  30. }
  31. /**
  32. * Add required SystemComponents to the SystemEntity.
  33. */
  34. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  35. {
  36. return AZ::ComponentTypeList{
  37. azrtti_typeid<ProfilerSystemComponent>(),
  38. azrtti_typeid<ProfilerImGuiSystemComponent>(),
  39. };
  40. }
  41. };
  42. }// namespace Profiler
  43. AZ_DECLARE_MODULE_CLASS(Gem_ProfilerImGui, Profiler::ProfilerImGuiModule)