SmartEngine  1.6.0
AssetStore.h
1 // Copyright (C) Entropy Software LLC - All Rights Reserved
2 
3 #pragma once
4 
5 #include "Defines.h"
6 #include "MemoryBuffer.h"
7 #include "Utilities.h"
8 
9 namespace SmartEngine
10 {
11 
12 #pragma pack(push, 4)
13 enum class AssetType : byte
14 {
19  JsonString,
20 
25  Binary,
26 
27  Count
28 };
29 SMARTENGINE_ENUM_STRING(AssetType, "JsonString", "Binary");
30 #pragma pack(pop)
31 
32 typedef bool (*AssetStoreHandler)(const char* assetName, AssetType assetType, IMemoryBuffer* buffer);
33 
37 SMARTENGINE_EXPORT void SetAssetStoreHandlers(AssetStoreHandler loadHandler, AssetStoreHandler saveHandler);
38 
40 extern "C"
41 {
42  typedef int (SMARTENGINE_CALLBACK *CAssetStoreHandler)(const char* assetName, int assetType, ObjPtr buffer);
43  SMARTENGINE_EXPORT void AssetStore_SetHandlers(CAssetStoreHandler loadHandler, CAssetStoreHandler saveHandler);
44 }
46 
47 } // namespace SmartEngine
SmartEngine::SetAssetStoreHandlers
SMARTENGINE_EXPORT void SetAssetStoreHandlers(AssetStoreHandler loadHandler, AssetStoreHandler saveHandler)
Used to set the handler for custom loading and saving of assets.
SmartEngine::AssetType
AssetType
Definition: AssetStore.h:14
SmartEngine::AssetStoreHandler
bool(* AssetStoreHandler)(const char *assetName, AssetType assetType, IMemoryBuffer *buffer)
Definition: AssetStore.h:32
SmartEngine
Definition: A2CTrainer.h:10
SmartEngine::AssetType::JsonString
@ JsonString
The memory buffer will be filled or should be filled with just a single string that is the content of...
SmartEngine::IMemoryBuffer
Simple in memory buffer. Used for serialization, but can be used as a generic buffer too.
Definition: MemoryBuffer.h:15