SampleComponentManagerBus.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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/EBus/EBus.h>
  10. #include <AzCore/std/string/string.h>
  11. namespace AtomSampleViewer
  12. {
  13. class SampleComponentManagerRequests
  14. : public AZ::EBusTraits
  15. {
  16. public:
  17. //! Close any open sample and return to the home screen
  18. virtual void Reset() = 0;
  19. //! Open a sample with the given name. Return false if the sample wasn't found.
  20. virtual bool OpenSample(const AZStd::string& sampleName) = 0;
  21. //! Show or hide a debug tool with the given name. Return false if the tool wasn't found.
  22. virtual bool ShowTool(const AZStd::string& toolName, bool enable) = 0;
  23. //! Take a screenshot and save to the indicated file path.
  24. //! @param filePath where to save the screenshot file. The screenshot type is indicated by the extension.
  25. //! @param hideImGui hide ImGui while taking the screenshot.
  26. virtual void RequestFrameCapture(const AZStd::string& filePath, bool hideImGui) = 0;
  27. //! Returns true if a frame capture has been requested and not yet fulfilled
  28. virtual bool IsFrameCapturePending() = 0;
  29. //! Runs the main test suite, in an automated mode and closes AtomSampleViewer when the suite finished running
  30. //! @param suiteFilePath path to the compiled luac test script
  31. //! @param exitOnTestEnd if true, exits AtomSampleViewerStandalone when the script finishes, used in jenkins
  32. //! @param randomSeed the seed for the random generator, frequently used inside lua tests to shuffle the order of the test execution
  33. virtual void RunMainTestSuite(const AZStd::string& suiteFilePath, bool exitOnTestEnd, int randomSeed) = 0;
  34. //! Set the number of MSAA samples
  35. //! @param numMSAASamples the number of MSAA samples
  36. virtual void SetNumMSAASamples(int numMSAASamples) = 0;
  37. //! Set the number of MSAA samples to the platform default
  38. virtual void ResetNumMSAASamples() = 0;
  39. //! Reset the RPI scene while keeping the current sample running
  40. virtual void ResetRPIScene() = 0;
  41. //! Clear the RPI scene
  42. virtual void ClearRPIScene() = 0;
  43. //! Enables or disables the default render pipeline.
  44. virtual void EnableRenderPipeline(bool value) = 0;
  45. //! Enables or disables the XR pipelines.
  46. virtual void EnableXrPipelines(bool value) = 0;
  47. };
  48. using SampleComponentManagerRequestBus = AZ::EBus<SampleComponentManagerRequests>;
  49. class SampleComponentManagerNotifications
  50. : public AZ::EBusTraits
  51. {
  52. public:
  53. //! Called when SampleComponentManager has been activated
  54. virtual void OnSampleManagerActivated() {}
  55. };
  56. using SampleComponentManagerNotificationBus = AZ::EBus<SampleComponentManagerNotifications>;
  57. } // namespace AtomSampleViewer