ZSceneStateHandler

Asynchronous state handler for managing the lifecycle events of a scene within the Zernikalos engine. This interface facilitates the handling of ready, resize, and render events in an asynchronous manner by utilizing callback functions to signal the completion of tasks.

Functions

Link copied to clipboard
abstract fun onReady(context: ZContext, done: () -> Unit)

Called when the scene or the system is ready to start interacting or rendering. This method is typically used to perform initialization tasks specific to the scene state.

Link copied to clipboard
open fun onRender(context: ZContext, done: () -> Unit)

Handles the rendering process for the current scene and rendering context. This method is expected to be called during each frame of the rendering loop to process and render the visual elements of the scene.

Link copied to clipboard
open fun onResize(context: ZContext, width: Int, height: Int, done: () -> Unit)

Handles the resizing of the scene or rendering system, typically triggered when the viewport dimensions change. This should update internal state or configurations based on the new width and height values.

Link copied to clipboard
open fun onUpdate(context: ZContext, done: () -> Unit)

Handles the updating process for the current scene and rendering context. This method is expected to be called during each frame of the rendering loop.