summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c6
-rw-r--r--src/scenes/mainMenu.c9
-rw-r--r--src/scenes/sceneManager.c14
-rw-r--r--src/scenes/scenes.h17
4 files changed, 45 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 668d6a4..9679dab 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,5 +1,8 @@
#include <stdio.h>
#include <raylib.h>
+#include "scenes/scenes.h"
+
+enum SCENE current_scene = MAIN_MENU;
int main(void) {
printf("Hello, world!\n");
@@ -9,7 +12,8 @@ int main(void) {
SetTargetFPS(60);
while (!WindowShouldClose()) {
BeginDrawing();
- ClearBackground(RED);
+ UpdateScene(current_scene);
+ DrawScene(current_scene);
EndDrawing();
}
diff --git a/src/scenes/mainMenu.c b/src/scenes/mainMenu.c
new file mode 100644
index 0000000..07ba34d
--- /dev/null
+++ b/src/scenes/mainMenu.c
@@ -0,0 +1,9 @@
+#include <raylib.h>
+
+void MainMenuUpdate() {
+}
+
+void MainMenuDraw() {
+ ClearBackground(SKYBLUE);
+ DrawText("MAIN MENU", 10, 10, 30, BLACK);
+}
diff --git a/src/scenes/sceneManager.c b/src/scenes/sceneManager.c
new file mode 100644
index 0000000..4d42ed9
--- /dev/null
+++ b/src/scenes/sceneManager.c
@@ -0,0 +1,14 @@
+#include "scenes.h"
+
+void UpdateScene(enum SCENE scene) {
+ switch (scene) {
+ case MAIN_MENU: MainMenuUpdate();
+ }
+}
+
+void DrawScene(enum SCENE scene) {
+ switch (scene) {
+ case MAIN_MENU: MainMenuDraw();
+ }
+}
+
diff --git a/src/scenes/scenes.h b/src/scenes/scenes.h
new file mode 100644
index 0000000..88295e6
--- /dev/null
+++ b/src/scenes/scenes.h
@@ -0,0 +1,17 @@
+#ifndef SCENES_H
+#define SCENES_H
+
+/// The scene that the action should be executed upon
+enum SCENE {
+ MAIN_MENU,
+};
+
+void DrawScene(enum SCENE scene);
+void UpdateScene(enum SCENE scene);
+
+
+// ========== MAIN MENU ==========
+void MainMenuUpdate();
+void MainMenuDraw();
+
+#endif // SCENES_H