ImGuiGem.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 "ImGuiGem.h"
  9. namespace ImGui
  10. {
  11. void ImGuiModule::OnSystemEvent([[maybe_unused]] ESystemEvent event, [[maybe_unused]] UINT_PTR wparam, [[maybe_unused]] UINT_PTR lparam)
  12. {
  13. #ifdef IMGUI_ENABLED
  14. switch (event)
  15. {
  16. case ESYSTEM_EVENT_GAME_POST_INIT:
  17. {
  18. manager.Initialize();
  19. lyCommonMenu.Initialize();
  20. break;
  21. }
  22. case ESYSTEM_EVENT_FULL_SHUTDOWN:
  23. case ESYSTEM_EVENT_FAST_SHUTDOWN:
  24. manager.Shutdown();
  25. lyCommonMenu.Shutdown();
  26. break;
  27. case ESYSTEM_EVENT_GAME_POST_INIT_DONE:
  28. // Register CVARS after Init is done
  29. manager.RegisterImGuiCVARs();
  30. break;
  31. }
  32. #endif //IMGUI_ENABLED
  33. }
  34. }
  35. #if !defined(IMGUI_GEM_EDITOR)
  36. #if defined(O3DE_GEM_NAME)
  37. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), ImGui::ImGuiModule)
  38. #else
  39. AZ_DECLARE_MODULE_CLASS(Gem_ImGui, ImGui::ImGuiModule)
  40. #endif
  41. #endif // IMGUI_GEM_EDITOR