CRM64Pro GDK v0.18.0
A free cross-platform game development kit built on top of SDL 3.0
Loading...
Searching...
No Matches
CRM64Pro::SceneLayerabstract

Base class for all Scene layer types. More...

Detailed Description

Base class for all Scene layer types.

Inheritance diagram for CRM64Pro::SceneLayer:

Public Member Functions

virtual float getTotalWidth () const
 Get the layer's total width in pixels.
virtual float getTotalHeight () const
 Get the layer's total height in pixels.
void setOnUpdateCallback (SceneLayerCallback fnCallback)
 Set the callback for update events.
void setOnRenderCallback (SceneLayerCallback fnCallback)
 Set the callback for render events.
SceneLayerCallback getOnUpdateCallback () const
 Get the update callback.
SceneLayerCallback getOnRenderCallback () const
 Get the render callback.

Protected Member Functions

virtual eSceneLayerType getType () const =0
 Get the layer type.
virtual Sint32 update (Scene *pEngine, SceneLayerContext &rContext)=0
 Update layer content.
virtual Sint32 render (Scene *pEngine, SceneLayerContext &rContext)=0
 Render layer content.

Member Function Documentation

◆ getTotalWidth()

float CRM64Pro::SceneLayer::getTotalWidth ( ) const
virtual

Get the layer's total width in pixels.

Returns
Width in pixels, or 0 if not applicable.

Reimplemented in CRM64Pro::SceneLayerImage, CRM64Pro::SceneLayerObject, and CRM64Pro::SceneLayerTile.

◆ getTotalHeight()

float CRM64Pro::SceneLayer::getTotalHeight ( ) const
virtual

Get the layer's total height in pixels.

Returns
Height in pixels, or 0 if not applicable.

Reimplemented in CRM64Pro::SceneLayerImage, CRM64Pro::SceneLayerObject, and CRM64Pro::SceneLayerTile.

◆ setOnUpdateCallback()

void CRM64Pro::SceneLayer::setOnUpdateCallback ( SceneLayerCallback fnCallback)

Set the callback for update events.

Parameters
fnCallbackCallback function, or an empty callback to clear.

◆ setOnRenderCallback()

void CRM64Pro::SceneLayer::setOnRenderCallback ( SceneLayerCallback fnCallback)

Set the callback for render events.

Parameters
fnCallbackCallback function, or an empty callback to clear.

◆ getOnUpdateCallback()

SceneLayerCallback CRM64Pro::SceneLayer::getOnUpdateCallback ( ) const

Get the update callback.

Returns
Current update callback, or an empty callback if none is assigned.

◆ getOnRenderCallback()

SceneLayerCallback CRM64Pro::SceneLayer::getOnRenderCallback ( ) const

Get the render callback.

Returns
Current render callback, or an empty callback if none is assigned.

◆ getType()

virtual eSceneLayerType CRM64Pro::SceneLayer::getType ( ) const
protectedpure virtual

Get the layer type.

Returns
Layer type enum value.

Implemented in CRM64Pro::SceneLayerImage, CRM64Pro::SceneLayerObject, and CRM64Pro::SceneLayerTile.

◆ update()

virtual Sint32 CRM64Pro::SceneLayer::update ( Scene * pEngine,
SceneLayerContext & rContext )
protectedpure virtual

Update layer content.

Parameters
pEnginePointer to the Scene instance.
rContextLayer context structure containing update state (deltaTime, scroll position, etc).
Returns
0 on success, or a negative error code on failure.

Implemented in CRM64Pro::SceneLayerImage, CRM64Pro::SceneLayerObject, and CRM64Pro::SceneLayerTile.

◆ render()

virtual Sint32 CRM64Pro::SceneLayer::render ( Scene * pEngine,
SceneLayerContext & rContext )
protectedpure virtual

Render layer content.

Parameters
pEnginePointer to the Scene instance.
rContextLayer context structure containing render state (render target, scroll position, etc).
Returns
0 on success, or a negative error code on failure.

Implemented in CRM64Pro::SceneLayerImage, CRM64Pro::SceneLayerObject, and CRM64Pro::SceneLayerTile.