AtomSampleViewerModule.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 <AzCore/Module/Module.h>
  9. #include <AzCore/Memory/SystemAllocator.h>
  10. #include <AtomSampleViewerSystemComponent.h>
  11. #include <SampleComponentManager.h>
  12. #include <AzFramework/Scene/SceneSystemComponent.h>
  13. namespace AtomSampleViewer
  14. {
  15. class Module final
  16. : public AZ::Module
  17. {
  18. public:
  19. AZ_CLASS_ALLOCATOR(Module, AZ::SystemAllocator, 0);
  20. AZ_RTTI(Module, "{8FEB7E9B-A5F7-4917-A1DE-974DE1FA7F1E}", AZ::Module);
  21. Module()
  22. {
  23. m_descriptors.insert(m_descriptors.end(), {
  24. AtomSampleViewerSystemComponent::CreateDescriptor(),
  25. SampleComponentManager::CreateDescriptor(),
  26. });
  27. AZStd::vector<SampleEntry> samples = SampleComponentManager::GetSamples();
  28. for (const SampleEntry& sample : samples)
  29. {
  30. m_descriptors.emplace_back(sample.m_componentDescriptor);
  31. }
  32. }
  33. ~Module() override = default;
  34. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  35. {
  36. AZ::ComponentTypeList requiredComponents;
  37. requiredComponents =
  38. {
  39. azrtti_typeid<AzFramework::SceneSystemComponent>(),
  40. azrtti_typeid<AtomSampleViewerSystemComponent>(),
  41. azrtti_typeid<SampleComponentManager>()
  42. };
  43. return requiredComponents;
  44. }
  45. };
  46. } // namespace AtomSampleViewer
  47. // DO NOT MODIFY THIS LINE UNLESS YOU RENAME THE GEM
  48. // The first parameter should be GemName_GemIdLower
  49. // The second should be the fully qualified name of the class above
  50. AZ_DECLARE_MODULE_CLASS(Gem_AtomSampleViewer, AtomSampleViewer::Module)