Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
AssetLoader.hpp
1#pragma once
2
3#include <filesystem>
4#include <vector>
5
6#include <Common/Buffer.hpp>
7#include <Common/Graphics/GraphicsPipeline.hpp>
8#include <Common/ResourcePipeline/Uuid.hpp>
9#include <Common/ResourcePipeline/AssetType.hpp>
10
11namespace Grindstone::Assets {
12 enum class AssetLoadStatus {
13 Success,
14 FileNotFound,
15 NotEnoughMemory,
16 InvalidAssetType,
17 AssetNotInRegistry,
18 };
19
21 AssetLoadStatus status;
22 std::string displayName;
23 Buffer buffer;
24 };
25
27 AssetLoadStatus status;
28 std::string displayName;
29 std::string content;
30 };
31
33 public:
34 virtual AssetLoadBinaryResult LoadBinaryByPath(AssetType assetType, const std::filesystem::path& path) = 0;
35 virtual AssetLoadBinaryResult LoadBinaryByAddress(AssetType assetType, std::string_view address) = 0;
36 virtual AssetLoadBinaryResult LoadBinaryByUuid(AssetType assetType, Uuid uuid) = 0;
37
38 virtual AssetLoadTextResult LoadTextByPath(AssetType assetType, const std::filesystem::path& path) = 0;
39 virtual AssetLoadTextResult LoadTextByAddress(AssetType assetType, std::string_view address) = 0;
40 virtual AssetLoadTextResult LoadTextByUuid(AssetType assetType, Uuid uuid) = 0;
41
42 virtual bool LoadShaderStageByPath(
43 const std::filesystem::path& path,
44 GraphicsAPI::ShaderStage shaderStage,
46 std::vector<char>& fileData
47 ) = 0;
48 virtual bool LoadShaderStageByAddress(
49 std::string_view address,
50 GraphicsAPI::ShaderStage shaderStage,
52 std::vector<char>& fileData
53 ) = 0;
54 virtual bool LoadShaderStageByUuid(
55 Uuid uuid,
56 GraphicsAPI::ShaderStage shaderStage,
58 std::vector<char>& fileData
59 ) = 0;
60 };
61}
Definition AssetLoader.hpp:32
Definition Buffer.hpp:46
Definition Uuid.hpp:6
Definition AssetLoader.hpp:20
Definition AssetLoader.hpp:26