Scene: Add time as the amount of seconds it has been enabled.

This commit is contained in:
Alberto Torres 2025-03-18 18:11:16 +01:00
parent 0d2d2a2d44
commit a2024c4ebc
2 changed files with 2 additions and 0 deletions

View file

@ -188,6 +188,7 @@ proc myou_main_loop*(self: MyouEngine) =
for _,scene in self.scenes.pairs:
if not scene.enabled:
continue
scene.time += delta_seconds
for f in scene.pre_draw_callbacks:
f(scene, delta_seconds)
self.renderer.draw_all()

View file

@ -373,6 +373,7 @@ type
active_camera*: Camera
physics_enabled*: bool
world*: World
time*: float
# render options
background_color*: Vec4