Base class for all assets in the engine. Defines the interface for loading, unloading, creating GPU resources, and binding the asset to the graphics pipeline.
More...
#include <Asset.hpp>
|
| virtual void | Load ()=0 |
| | Loads the asset data into CPU memory. Must be implemented by derived asset classes.
|
| virtual void | Unload ()=0 |
| | Frees CPU and GPU resources if applicable. Must be implemented by derived asset classes.
|
| virtual void | CreateBuffers (ID3D11Device *device) |
| | Creates GPU resources for the asset (e.g., vertex/index buffers, textures). Can be overridden if the asset needs GPU-side resources.
|
| virtual void | Bind (ID3D11DeviceContext *context) const |
| | Binds the asset to the graphics pipeline if applicable (for example, textures or meshes).
|
| virtual | ~Asset ()=default |
| | Virtual destructor.
|
|
| AssetID | id |
| | Unique identifier of the asset.
|
| std::string | path |
| | File path of the source asset.
|
Base class for all assets in the engine. Defines the interface for loading, unloading, creating GPU resources, and binding the asset to the graphics pipeline.
◆ ~Asset()
| virtual Asset::~Asset |
( |
| ) |
|
|
virtualdefault |
◆ Bind()
| virtual void Asset::Bind |
( |
ID3D11DeviceContext * | context | ) |
const |
|
inlinevirtual |
Binds the asset to the graphics pipeline if applicable (for example, textures or meshes).
- Parameters
-
| context | Device context used for rendering |
Reimplemented in MeshAsset, and TextureAsset.
◆ CreateBuffers()
| virtual void Asset::CreateBuffers |
( |
ID3D11Device * | device | ) |
|
|
inlinevirtual |
Creates GPU resources for the asset (e.g., vertex/index buffers, textures). Can be overridden if the asset needs GPU-side resources.
- Parameters
-
| device | D3D11 device used to create GPU resources |
Reimplemented in MeshAsset, and TextureAsset.
◆ Load()
| virtual void Asset::Load |
( |
| ) |
|
|
pure virtual |
Loads the asset data into CPU memory. Must be implemented by derived asset classes.
Implemented in MeshAsset, and TextureAsset.
◆ Unload()
| virtual void Asset::Unload |
( |
| ) |
|
|
pure virtual |
Frees CPU and GPU resources if applicable. Must be implemented by derived asset classes.
Implemented in MeshAsset, and TextureAsset.
◆ id
Unique identifier of the asset.
◆ path
File path of the source asset.
The documentation for this class was generated from the following file: