Asset representing a texture that can be used in the DirectX rendering pipeline. Handles CPU/GPU resources, including shader resource view and underlying texture resource.
More...
#include <TextureAsset.hpp>
|
| void | Load () override |
| | Loads the texture from the file associated with this asset.
|
| void | Unload () override |
| | Releases CPU and GPU resources associated with this texture.
|
| void | CreateBuffers (ID3D11Device *device) override |
| | Creates GPU resources for the texture (SRV and underlying resource).
|
| void | Bind (ID3D11DeviceContext *context) const override |
| | Binds the texture to the graphics pipeline.
|
| bool | IsReady () const |
| | Checks if the texture is ready to be used (SRV created and valid).
|
| ID3D11ShaderResourceView * | GetSRV () const |
| | Returns the Shader Resource View of the texture.
|
| UINT | GetWidth () const |
| | Returns the width of the texture in pixels.
|
| UINT | GetHeight () const |
| | Returns the height of the texture in pixels.
|
| virtual | ~Asset ()=default |
| | Virtual destructor.
|
|
| AssetID | id |
| | Unique identifier of the asset.
|
| std::string | path |
| | File path of the source asset.
|
Asset representing a texture that can be used in the DirectX rendering pipeline. Handles CPU/GPU resources, including shader resource view and underlying texture resource.
◆ Bind()
| void TextureAsset::Bind |
( |
ID3D11DeviceContext * | context | ) |
const |
|
overridevirtual |
Binds the texture to the graphics pipeline.
- Parameters
-
| context | Device context used for rendering |
Reimplemented from Asset.
◆ CreateBuffers()
| void TextureAsset::CreateBuffers |
( |
ID3D11Device * | device | ) |
|
|
overridevirtual |
Creates GPU resources for the texture (SRV and underlying resource).
- Parameters
-
| device | D3D11 device used for creating GPU resources |
Reimplemented from Asset.
◆ GetHeight()
| UINT TextureAsset::GetHeight |
( |
| ) |
const |
Returns the height of the texture in pixels.
- Returns
- Texture height
◆ GetSRV()
| ID3D11ShaderResourceView * TextureAsset::GetSRV |
( |
| ) |
const |
Returns the Shader Resource View of the texture.
- Returns
- ID3D11ShaderResourceView pointer
◆ GetWidth()
| UINT TextureAsset::GetWidth |
( |
| ) |
const |
Returns the width of the texture in pixels.
- Returns
- Texture width
◆ IsReady()
| bool TextureAsset::IsReady |
( |
| ) |
const |
Checks if the texture is ready to be used (SRV created and valid).
- Returns
- True if ready
◆ Load()
| void TextureAsset::Load |
( |
| ) |
|
|
overridevirtual |
Loads the texture from the file associated with this asset.
Implements Asset.
◆ Unload()
| void TextureAsset::Unload |
( |
| ) |
|
|
overridevirtual |
Releases CPU and GPU resources associated with this texture.
Implements Asset.
The documentation for this class was generated from the following file: