IMaterial.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. // Description : IMaterial interface declaration.
  9. #pragma once
  10. #include <smartptr.h>
  11. #include <AzCore/EBus/EBus.h>
  12. struct IShader;
  13. struct SShaderItem;
  14. namespace AZ
  15. {
  16. class MaterialNotificationEvents : public AZ::EBusTraits
  17. {
  18. public:
  19. virtual ~MaterialNotificationEvents() {}
  20. static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
  21. static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
  22. static const bool EnableEventQueue = true;
  23. using EventQueueMutexType = AZStd::mutex;
  24. virtual void OnShaderLoaded([[maybe_unused]] IShader* shader) {}
  25. };
  26. using MaterialNotificationEventBus = AZ::EBus<MaterialNotificationEvents>;
  27. }
  28. struct IMaterial
  29. {
  30. // TODO: Remove it!
  31. virtual ~IMaterial() {}
  32. virtual SShaderItem& GetShaderItem() = 0;
  33. virtual const SShaderItem& GetShaderItem() const = 0;
  34. };