MainThreadRenderRequestBus.h 874 B

123456789101112131415161718192021222324252627282930313233
  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/ComponentBus.h>
  10. #include <AzCore/std/parallel/mutex.h>
  11. namespace AZ
  12. {
  13. /**
  14. * Used to queue render commands to be safely executed on the main thread
  15. */
  16. class MainThreadRenderQueueEvents
  17. : public AZ::EBusTraits
  18. {
  19. public:
  20. virtual ~MainThreadRenderQueueEvents() {}
  21. // EBusTraits overrides
  22. static const AZ::EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
  23. static const bool EnableEventQueue = true;
  24. typedef AZStd::mutex EventQueueMutexType;
  25. };
  26. using MainThreadRenderRequestBus = AZ::EBus<MainThreadRenderQueueEvents>;
  27. }