My Project
Loading...
Searching...
No Matches
Engine::TextureComponent Class Reference

Component responsible for storing a texture associated with a GameObject. This texture can later be used by the rendering system. More...

#include <TextureComponent.hpp>

Inheritance diagram for Engine::TextureComponent:
Engine::Component

Public Member Functions

 TextureComponent ()=default
 Default constructor.
std::shared_ptr< TextureAssetGetTexture () 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.
Public Member Functions inherited from Engine::Component
virtual ~Component ()=default
 Virtual destructor to allow proper cleanup of derived components.

Additional Inherited Members

Public Attributes inherited from Engine::Component
GameObjectgameObject = nullptr
 Pointer to the GameObject that owns this component.
Protected Member Functions inherited from Engine::Component
 Component ()=default
 Protected constructor to prevent direct instantiation of the base class.

Detailed Description

Component responsible for storing a texture associated with a GameObject. This texture can later be used by the rendering system.

Constructor & Destructor Documentation

◆ TextureComponent()

Engine::TextureComponent::TextureComponent ( )
default

Default constructor.

Member Function Documentation

◆ 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
textureTexture asset to assign

◆ Start()

void Engine::TextureComponent::Start ( )
inlineoverridevirtual

Called when the component starts.

Reimplemented from Engine::Component.

◆ Update()

void Engine::TextureComponent::Update ( float dt)
inlineoverridevirtual

Called every frame to update the component.

Parameters
dtDelta time between frames

Reimplemented from Engine::Component.


The documentation for this class was generated from the following file: