![]() |
Lysa Nodes
0.0
Lysa Nodes — Scene Graph for the Lysa Engine
|
src/Main.cpp With Lysa Nodes the Application class only needs the render() call and the main loop.
RotatingAssetScene(window) wires everything: it adds all nodes, calls attach(window), and subscribes to engine events. After the constructor returns the scene is fully operational; the application needs no further setup.
Shaders directory validation happens in the constructor rather than run() to surface the error before the main loop starts.
run() A single subscription calls render() after the scene tree has processed the frame. Event subscriptions fire in registration order (FIFO); because RotatingAssetScene::attach(window) was called during construction — before Application::run() — the scene's PROCESS handler is always invoked first.
After lysa::Lysa::run() returns (when lysa::ctx().exit is set to true by MainWindow on CLOSING), the Application destructor releases objects in reverse declaration order: scene, then window, then lysa. This ensures that GPU resources owned by the scene are released before the device is destroyed.
Next : What's next?