RenderComponent is an abstract base class for all components that need to be rendered. It provides hooks for lifecycle events and defines the interface for rendering and draw order.
More...
#include <RenderComponent.h>
|
| RenderComponent (Actor *pOwner) |
| Constructs the RenderComponent and assigns it to the owning Actor.
|
|
void | OnStart () override |
| Called when the component is started. Registers the component with the scene's renderer for drawing.
|
|
void | OnEnd () override |
| Called when the component is removed or destroyed. Unregisters the component from the renderer.
|
|
virtual void | Render (IRenderer *rRenderer)=0 |
| Renders the component using the given renderer. Must be implemented by derived classes.
|
|
virtual RenderType | GetRenderType ()=0 |
| Returns the type of rendering this component belongs to (World or Viewport). Used for organizing rendering passes.
|
|
virtual int | GetDrawOrder () const |
|
| Component (Actor *pOwner, int pUpdateOrder=100) |
| Constructor for Component.
|
|
virtual | ~Component () |
|
virtual void | Update () |
| Called every frame to update the component. This can be used to perform actions that need to be updated periodically.
|
|
virtual void | OnUpdateWorldTrandform () |
| Called when the world transform of the actor is updated. This allows the component to react to changes in the actor's world transform.
|
|
void | SetActive (bool isActive) |
| Sets the active status of the component.
|
|
void | SetOwner (Actor *pOwner) |
| Sets the actor that owns this component.
|
|
int | GetUpdateOrder () const |
| Returns the update order of the component. Components with lower update orders are updated first.
|
|
Actor * | GetOwner () const |
| Returns the actor that owns this component.
|
|
|
Actor * | mOwner = nullptr |
| The actor that owns this component.
|
|
RenderComponent is an abstract base class for all components that need to be rendered. It provides hooks for lifecycle events and defines the interface for rendering and draw order.
◆ RenderComponent()
RenderComponent::RenderComponent |
( |
Actor * | pOwner | ) |
|
◆ GetDrawOrder()
int RenderComponent::GetDrawOrder |
( |
| ) |
const |
|
virtual |
@briefReturns the draw order priority of this component. Lower values are rendered first. Default is 0.
Reimplemented in SpriteRenderComponent.
◆ GetRenderType()
virtual RenderType RenderComponent::GetRenderType |
( |
| ) |
|
|
pure virtual |
◆ OnEnd()
void RenderComponent::OnEnd |
( |
| ) |
|
|
overridevirtual |
Called when the component is removed or destroyed. Unregisters the component from the renderer.
Reimplemented from Component.
◆ OnStart()
void RenderComponent::OnStart |
( |
| ) |
|
|
overridevirtual |
Called when the component is started. Registers the component with the scene's renderer for drawing.
Reimplemented from Component.
◆ Render()
virtual void RenderComponent::Render |
( |
IRenderer * | rRenderer | ) |
|
|
pure virtual |
◆ mColor
Color RenderComponent::mColor { 255,255,255,255 } |
The documentation for this class was generated from the following files: