| CRM64Pro GDK v0.17.0 A free cross-platform game development kit built on top of SDL 3.0

Loading...
Searching...
No Matches
CRM64Pro::SceneLayerabstract
Scene module » Scene Layer base

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 (SCENE_OnLayerCallback callback)
| Set the callback for update events.
void | setOnRenderCallback (SCENE_OnLayerCallback callback)
| Set the callback for render events.
SCENE_OnLayerCallback | getOnUpdateCallback () const
| Get the update callback.
SCENE_OnLayerCallback | getOnRenderCallback () const
| Get the render callback.

## Protected Member Functions
virtual eSceneLayerType | getType () const =0
| Get the layer type.
virtual Sint32 | update (Scene *pEngine, SceneLayerContext &context)=0
| Update layer content.
virtual Sint32 | render (Scene *pEngine, SceneLayerContext &context)=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 | ( | SCENE_OnLayerCallback | callback | ) |

Set the callback for update events.

Parameters

  callback | Pointer to the user callback function.

## ◆ setOnRenderCallback()

void CRM64Pro::SceneLayer::setOnRenderCallback | ( | SCENE_OnLayerCallback | callback | ) |

Set the callback for render events.

Parameters

  callback | Pointer to the user callback function.

## ◆ getOnUpdateCallback()

SCENE_OnLayerCallback CRM64Pro::SceneLayer::getOnUpdateCallback | ( |  | ) | const

Get the update callback.

Returns
  Pointer to the current update callback function.

## ◆ getOnRenderCallback()

SCENE_OnLayerCallback CRM64Pro::SceneLayer::getOnRenderCallback | ( |  | ) | const

Get the render callback.

Returns
  Pointer to the current render callback function.

## ◆ getType()

virtual eSceneLayerType CRM64Pro::SceneLayer::getType | ( |  | ) | const
| protected pure 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 & | context )
| protected pure virtual

Update layer content.

Parameters

  pEngine | Pointer to the Scene instance.
  context | Layer 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 & | context )
| protected pure virtual

Render layer content.

Parameters

  pEngine | Pointer to the Scene instance.
  context | Layer 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.