StarsAsset.h 1.4 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. #pragma once
  9. #include <AzCore/Asset/AssetCommon.h>
  10. #include <AzCore/Asset/AssetSerializer.h>
  11. #include <AzFramework/Asset/GenericAssetHandler.h>
  12. namespace AZ::Render
  13. {
  14. class StarsAsset final
  15. : public AZ::Data::AssetData
  16. {
  17. public:
  18. static constexpr inline const char* DisplayName = "StarsAsset";
  19. static constexpr inline const char* Extension = "stars";
  20. static constexpr inline const char* Group = "Rendering";
  21. static constexpr inline const size_t HeaderSize = sizeof(uint32_t) * 3;
  22. AZ_RTTI(StarsAsset, "{211938C1-C54D-417D-977A-9928D7C630B1}", AZ::Data::AssetData)
  23. AZ_CLASS_ALLOCATOR(StarsAsset, AZ::SystemAllocator);
  24. AZStd::vector<AZ::u8> m_data;
  25. };
  26. class StarsAssetHandler final
  27. : public AzFramework::GenericAssetHandler<StarsAsset>
  28. {
  29. public:
  30. StarsAssetHandler();
  31. private:
  32. AZ::Data::AssetHandler::LoadResult LoadAssetData(
  33. const AZ::Data::Asset<AZ::Data::AssetData>& asset,
  34. AZStd::shared_ptr<AZ::Data::AssetDataStream> stream,
  35. const AZ::Data::AssetFilterCB& assetLoadFilterCB) override;
  36. };
  37. } // AZ::Render