summaryrefslogtreecommitdiff
path: root/src/scenes/scenes.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/scenes/scenes.h')
-rw-r--r--src/scenes/scenes.h31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/scenes/scenes.h b/src/scenes/scenes.h
index 88295e6..7ad34af 100644
--- a/src/scenes/scenes.h
+++ b/src/scenes/scenes.h
@@ -1,17 +1,30 @@
+#include <stdbool.h>
+
#ifndef SCENES_H
#define SCENES_H
-/// The scene that the action should be executed upon
-enum SCENE {
- MAIN_MENU,
-};
+#define SCENE_STACK_SIZE 16
+
+/// This structure represents a scene that is stored in a stack.
+/// The main appeal of this data type is dynamic creation of different
+/// scenes that don't depend on global state
+typedef struct {
+ bool (*Update)(void *self);
+ bool (*Draw)(void *self);
+ void (*Deint)(void *self);
+ /// A generic pointer to whatever data the scene needs. You will have to
+ /// cast it yourself
+ void *data;
+} Scene;
+
+bool InitSceneStack();
-void DrawScene(enum SCENE scene);
-void UpdateScene(enum SCENE scene);
+bool AddScene(Scene *newScene);
+void DeleteSceneFromStack();
+bool DrawScene();
+bool UpdateScene();
-// ========== MAIN MENU ==========
-void MainMenuUpdate();
-void MainMenuDraw();
+Scene *CreateMainMenu();
#endif // SCENES_H