AtomImGuiToolsSystemComponent.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. #pragma once
  9. #include <AzCore/Component/Component.h>
  10. #include <Atom/RPI.Public/Pass/Pass.h>
  11. #include <CrySystemBus.h>
  12. #if defined(IMGUI_ENABLED)
  13. #include <ImGuiBus.h>
  14. #include <imgui/imgui.h>
  15. #include <Atom/Utils/ImGuiGpuProfiler.h>
  16. #include <Atom/Utils/ImGuiMaterialDetails.h>
  17. #include <Atom/Utils/ImGuiPassTree.h>
  18. #include <Atom/Utils/ImGuiMaterialDetails.h>
  19. #include <Atom/Utils/ImGuiTransientAttachmentProfiler.h>
  20. #include <AtomLyIntegration/AtomImGuiTools/AtomImGuiToolsBus.h>
  21. #include <AzCore/std/containers/set.h>
  22. #include <MaterialShaderDetailsController.h>
  23. #endif
  24. namespace AtomImGuiTools
  25. {
  26. class AtomImGuiToolsSystemComponent
  27. : public AZ::Component
  28. #if defined(IMGUI_ENABLED)
  29. , public ImGui::ImGuiUpdateListenerBus::Handler
  30. , public AtomImGuiToolsRequestBus::Handler
  31. #endif
  32. , public CrySystemEventBus::Handler
  33. {
  34. public:
  35. AZ_COMPONENT(AtomImGuiToolsSystemComponent, "{AFA2493D-DF1C-4DBB-BC13-0AF990B3D5FC}");
  36. static void Reflect(AZ::ReflectContext* context);
  37. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  38. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  39. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  40. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  41. // AZ::Component interface implementation
  42. void Activate() override;
  43. void Deactivate() override;
  44. #if defined(IMGUI_ENABLED)
  45. // ImGuiUpdateListenerBus overrides...
  46. void OnImGuiUpdate() override;
  47. void OnImGuiMainMenuUpdate() override;
  48. // AtomImGuiToolsRequestBus::Handler overrides...
  49. void ShowMaterialShaderDetailsForEntity(AZ::EntityId entity, bool autoOpenDialog) override;
  50. #endif
  51. // CrySystemEventBus overrides...
  52. void OnCryEditorInitialized() override;
  53. private:
  54. #if defined(IMGUI_ENABLED)
  55. AZ::Render::ImGuiPassTree m_imguiPassTree;
  56. bool m_showPassTree = false;
  57. AZ::Render::ImGuiGpuProfiler m_imguiGpuProfiler;
  58. bool m_showGpuProfiler = false;
  59. AZ::Render::ImGuiTransientAttachmentProfiler m_imguiTransientAttachmentProfiler;
  60. bool m_showTransientAttachmentProfiler = false;
  61. AZ::Render::ImGuiMaterialDetails m_imguiMaterialDetails;
  62. bool m_showMaterialDetails = false;
  63. MaterialShaderDetailsController m_materialDetailsController;
  64. // switchable render pipelines
  65. AZStd::set<AZStd::string> m_switchableRenderPipelines;
  66. #endif
  67. };
  68. } // namespace AtomImGuiTools