Lysa  0.0
Lysa 3D Engine
Updatable Class Reference

Detailed Description

Helper mixin that tracks a finite number of pending updates for an object. Used by the engine to update resources in VRAM and associated pipelines and descriptors.

Typical usage is to mark an object as needing refresh a limited number of frames, decrementing the counter as work is performed, and querying the updated state with isUpdated().

+ Inheritance diagram for Updatable:

Public Member Functions

auto isUpdated () const
 
void decrementUpdates ()
 
void setUpdated ()
 
void setMaxUpdates (const uint32 maxUpdates)
 

Public Attributes

uint32 pendingUpdates {0}
 
uint32 maxUpdates {0}
 

Member Function Documentation

void decrementUpdates ( )
inline

Decrements the number of pending updates by one (not clamped).

auto isUpdated ( ) const
inline

Returns true if there are pending updates to process.

void setMaxUpdates ( const uint32  maxUpdates)
inline

Sets the maximum number of consecutive pending updates allowed.

void setUpdated ( )

Marks the object as updated, respecting maxUpdates if set.

Member Data Documentation

uint32 maxUpdates {0}

Upper bound on pendingUpdates; 0 means unbounded.

uint32 pendingUpdates {0}

Current number of pending updates to process.