|
Aeon Engine c550894
AeonGames Open Source Game Engine
|
Base class for loadable engine resources. More...
#include <aeongames/Resource.hpp>


Public Member Functions | |
| virtual | ~Resource () |
| Virtual destructor. | |
| virtual void | LoadFromMemory (const void *aBuffer, size_t aBufferSize)=0 |
| Load the resource from a raw memory buffer. | |
| virtual void | Unload ()=0 |
| Release all data held by this resource. | |
| DLL void | LoadFromId (uint32_t aId) |
| Load the resource identified by a numeric id. | |
| DLL void | LoadFromFile (const std::string &aFilename) |
| Load the resource from a file on disk. | |
| DLL size_t | GetConsecutiveId () const |
| Get the Consecutive Id for the resource object. | |
Base class for loadable engine resources.
Provides a common interface for loading resource data from files, memory buffers, or numeric identifiers, and assigns each instance a unique consecutive id for runtime tracking.
Definition at line 32 of file Resource.hpp.
|
inlinevirtual |
Virtual destructor.
Definition at line 36 of file Resource.hpp.
| size_t AeonGames::Resource::GetConsecutiveId | ( | ) | const |
Get the Consecutive Id for the resource object.
The consecutive Id is different from the resource Id, it is a unique number per resource that increments as each object is created, as such it is a runtime value that will most likely change each run and cannot be relied on for serialization purposes, it is intended as an identifier for other classes who need to cache their own resource data linked to the original resource such as renderers.
Definition at line 42 of file Resource.cpp.
| void AeonGames::Resource::LoadFromFile | ( | const std::string & | aFilename | ) |
Load the resource from a file on disk.
| aFilename | Path to the resource file. |
Definition at line 37 of file Resource.cpp.
| void AeonGames::Resource::LoadFromId | ( | uint32_t | aId | ) |
Load the resource identified by a numeric id.
| aId | Resource identifier. |
Definition at line 30 of file Resource.cpp.
|
pure virtual |
Load the resource from a raw memory buffer.
| aBuffer | Pointer to the data buffer. |
| aBufferSize | Size of the data buffer in bytes. |
Implemented in AeonGames::Animation, AeonGames::Material, AeonGames::Mesh, AeonGames::Model, AeonGames::Pipeline, AeonGames::Skeleton, and AeonGames::Texture.
|
pure virtual |
Release all data held by this resource.
Implemented in AeonGames::Animation, AeonGames::FrameBuffer, AeonGames::Material, AeonGames::Mesh, AeonGames::Model, AeonGames::Pipeline, AeonGames::Skeleton, AeonGames::Texture, and AeonGames::VulkanFrameBuffer.