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

Loading...
Searching...
No Matches
CRM64Pro::SceneLayerContext
Scene modules » Scene Layer

Layer Context structure. More...

## Detailed Description

Layer Context structure.

Contains all the state and data required for a layer to update or render. This structure is passed to the virtual update/render methods of SceneLayer and also to the user callbacks. It acts as both the input context (Time, Viewport, ID) and the output result container (Visible count, ranges).

## Public Member Functions
SDL_FPoint | worldToScreen (float fWorldX, float fWorldY, bool bQuantize=true) const
| Convert world coordinates to screen coordinates using the canonical render camera.

## Public Attributes
Sint32 | idLayer
| The ID of the layer.
eSceneLayerType | eType
| TILE, OBJECT, or IMAGE.
SDL_Rect | rViewport
| The effective viewport used for this frame.
float | fScrollX
| Current Logic/Render X scroll position.
float | fScrollY
| Current Logic/Render Y scroll position.
float | fInterpolation
| Render interpolation factor [0..1]. 1.0 during update or when smoothing is disabled.
float | fDeltaTime
| Time elapsed since last frame (for update). 0 during render.
Sint32 | idRes
| Render target ID (for render). 0 during update.
Sint32 | iAlpha
| Layer alpha modulation (0-255).
Sint32 | iQuantizeMode
| Final screen-space quantization policy. 0=None, 1=Floor.
float | fCameraRenderX
| Camera X used for rendering this frame.
float | fCameraRenderY
| Camera Y used for rendering this frame.

## Member Function Documentation

## ◆ worldToScreen()

SDL_FPoint CRM64Pro::SceneLayerContext::worldToScreen | ( | float | fWorldX,
|  | float | fWorldY,
|  | bool | bQuantize = true ) const
| inline

Convert world coordinates to screen coordinates using the canonical render camera.

Parameters

  fWorldX | World X coordinate.
  fWorldY | World Y coordinate.
  bQuantize | If true, applies final screen-space quantization policy from iQuantizeMode.

Returns
  Screen-space point in current viewport coordinates.