![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
Base class for every asset type, carrying the identity the ResourceManager indexes by. More...
#include <resource.h>
Public Member Functions | |
| Resource (const Resource &other) | |
Duplicate other's contents and name, but not its identity. | |
| const std::string & | name () const noexcept |
| Serializable identity; non-empty and unique within its type once added. | |
| uint64_t | uid () const noexcept |
| Process-unique id stamped by add(); names the asset, not the slot it sits in. | |
| uint64_t | version () const noexcept |
| Change counter the backend keys GPU re-uploads on; moved by commit(). | |
| bool | isHidden () const noexcept |
| Added by ResourceManager::addPrivate: not user-facing, not saved. | |
| nlohmann::json & | sourceJson () |
| Mutable source JSON, allocating a null document if there is none. | |
| const nlohmann::json & | sourceJson () const |
| Const source JSON; asserts hasSource(), so guard the call with it. | |
Base class for every asset type, carrying the identity the ResourceManager indexes by.
Only the manager writes the identity fields: name an asset with add(asset, name), change it with rename(handle, name). A subclass is a plain data struct of bare public members.
| Vkm::Engine::Resource::Resource | ( | const Resource & | other | ) |
Duplicate other's contents and name, but not its identity.
Carries the contents, name and source descriptor; not the uid or version, which add() stamps afresh.
| other | The asset to duplicate. |
| nlohmann::json & Vkm::Engine::Resource::sourceJson | ( | ) |
Mutable source JSON, allocating a null document if there is none.
Callers must #include <nlohmann/json.hpp>.
| const nlohmann::json & Vkm::Engine::Resource::sourceJson | ( | ) | const |
Const source JSON; asserts hasSource(), so guard the call with it.