A scene management system for Odin + raylib.
A scene is defined by a rawptr to the scene's state, and 4 procedures that take it as a parameter:
initis called the startupdateis called every framerenderis called every frame afterupdate, and happens betweenBeginDrawingandEndDrawingprocedurescleanupis called when the scene is closed, afterrenderSince the data is defined asrawptr, you can set the data field to anything. You can even have shared data between all scenes.
To run the system, call the run procedure. The system is based on a stack. This means that you can have open new scenes without the cleanup
of the previous ones. When set_scene is called, the whole stack is replaced, and only the new
scene remains. When push_scene is called, the scene is pushed on top of the stack. Once the stack
is empty, the run procedure returns.
Since scenes are mostly a collection of procedures, you can declare them as constants, and assign
data to them using with_data procedure.
To use this library, clone this repository and copy the scenes directory to your project
To run the demo, run the following command
odin run .