DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
AssetManager.h File Reference

Classes

class  Deki::AssetManager

Namespaces

namespace  Deki

Macros

#define DEKI_ASSET_MANAGER_API
#define REGISTER_ASSET_TYPE(TypeName, LoadFunc)
#define REGISTER_ASSET_TYPE_WITH_MEMLOAD(TypeName, LoadFunc, MemLoadFunc)

Typedefs

using AssetLoadFn = void* (*)(const char* path)
using AssetMemLoadFn = void* (*)(const uint8_t* data, size_t size)
using AssetUnloadFn = void (*)(void* asset)

Macro Definition Documentation

◆ DEKI_ASSET_MANAGER_API

#define DEKI_ASSET_MANAGER_API

◆ REGISTER_ASSET_TYPE

#define REGISTER_ASSET_TYPE ( TypeName,
LoadFunc )
Value:
namespace \
{ \
struct AssetTypeReg##TypeName \
{ \
AssetTypeReg##TypeName() \
{ \
Deki::AssetManager::RegisterLoader( \
TypeName::kAssetTypeName, [](const char* p) -> void* { return LoadFunc(p); }, \
[](void* a) { delete static_cast<TypeName*>(a); }); \
} \
}; \
static AssetTypeReg##TypeName s_AssetReg##TypeName; \
}
constexpr const char * TypeName()
The fully qualified name of T as a null-terminated string with static storage.
Definition TypeId.h:146

◆ REGISTER_ASSET_TYPE_WITH_MEMLOAD

#define REGISTER_ASSET_TYPE_WITH_MEMLOAD ( TypeName,
LoadFunc,
MemLoadFunc )
Value:
namespace \
{ \
struct AssetTypeReg##TypeName \
{ \
AssetTypeReg##TypeName() \
{ \
Deki::AssetManager::RegisterLoader( \
TypeName::kAssetTypeName, [](const char* p) -> void* { return LoadFunc(p); }, \
[](void* a) { delete static_cast<TypeName*>(a); }, \
[](const uint8_t* d, size_t s) -> void* { return MemLoadFunc(d, s); }); \
} \
}; \
static AssetTypeReg##TypeName s_AssetReg##TypeName; \
}

Typedef Documentation

◆ AssetLoadFn

using AssetLoadFn = void* (*)(const char* path)

◆ AssetMemLoadFn

using AssetMemLoadFn = void* (*)(const uint8_t* data, size_t size)

◆ AssetUnloadFn

using AssetUnloadFn = void (*)(void* asset)