Component responsible for storing a texture associated with a GameObject. This texture can later be used by the rendering system.
More...
#include <TextureComponent.hpp>
|
| | TextureComponent ()=default |
| | Default constructor.
|
| std::shared_ptr< TextureAsset > | GetTexture () const |
| | Returns the texture assigned to this component.
|
| void | SetTexture (std::shared_ptr< TextureAsset > texture) |
| | Assigns a texture to the GameObject. Logs the operation for debugging purposes.
|
| void | Start () override |
| | Called when the component starts.
|
| void | Update (float dt) override |
| | Called every frame to update the component.
|
| void | OnDestroy () override |
| | Called when the component is destroyed. Releases the texture reference.
|
| std::string | GetTypeName () const override |
| | Returns the component type name. Useful for debugging, serialization, or editor systems.
|
| virtual | ~Component ()=default |
| | Virtual destructor to allow proper cleanup of derived components.
|
Component responsible for storing a texture associated with a GameObject. This texture can later be used by the rendering system.
◆ TextureComponent()
| Engine::TextureComponent::TextureComponent |
( |
| ) |
|
|
default |
◆ GetTexture()
| std::shared_ptr< TextureAsset > Engine::TextureComponent::GetTexture |
( |
| ) |
const |
|
inline |
Returns the texture assigned to this component.
- Returns
- Shared pointer to the TextureAsset
◆ GetTypeName()
| std::string Engine::TextureComponent::GetTypeName |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the component type name. Useful for debugging, serialization, or editor systems.
- Returns
- Component type name
Implements Engine::Component.
◆ OnDestroy()
| void Engine::TextureComponent::OnDestroy |
( |
| ) |
|
|
inlineoverridevirtual |
Called when the component is destroyed. Releases the texture reference.
Reimplemented from Engine::Component.
◆ SetTexture()
| void Engine::TextureComponent::SetTexture |
( |
std::shared_ptr< TextureAsset > | texture | ) |
|
|
inline |
Assigns a texture to the GameObject. Logs the operation for debugging purposes.
- Parameters
-
| texture | Texture asset to assign |
◆ Start()
| void Engine::TextureComponent::Start |
( |
| ) |
|
|
inlineoverridevirtual |
◆ Update()
| void Engine::TextureComponent::Update |
( |
float | dt | ) |
|
|
inlineoverridevirtual |
Called every frame to update the component.
- Parameters
-
| dt | Delta time between frames |
Reimplemented from Engine::Component.
The documentation for this class was generated from the following file: