aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authornathansmith117 <thenathansmithsmith@gmail.com>2024-02-14 22:20:30 +0000
committernathansmith117 <thenathansmithsmith@gmail.com>2024-02-14 22:20:30 +0000
commitc2d4a7939fe7f06384f9364e7877c618d9466484 (patch)
tree8676f9821c4b766cde64191a5a91f0a6f7812203 /src
downloadPenguinYippies-c2d4a7939fe7f06384f9364e7877c618d9466484.tar.gz
PenguinYippies-c2d4a7939fe7f06384f9364e7877c618d9466484.tar.bz2
PenguinYippies-c2d4a7939fe7f06384f9364e7877c618d9466484.zip
first commit
Diffstat (limited to 'src')
-rw-r--r--src/game.c21
-rw-r--r--src/game.h20
-rw-r--r--src/gameCommon.h16
-rw-r--r--src/main.c17
4 files changed, 74 insertions, 0 deletions
diff --git a/src/game.c b/src/game.c
new file mode 100644
index 0000000..a093269
--- /dev/null
+++ b/src/game.c
@@ -0,0 +1,21 @@
+#include "game.h"
+
+void initGame(Game* game)
+{
+ InitWindow(WINDOW_WIDTH, WINDOW_HEIGHT, "Penguin Yippies!");
+}
+
+void updateGame(Game* game)
+{
+ BeginDrawing();
+ ClearBackground(RAYWHITE);
+
+ DrawFPS(0, 0);
+
+ EndDrawing();
+}
+
+void closeGame(Game* game)
+{
+ CloseWindow();
+}
diff --git a/src/game.h b/src/game.h
new file mode 100644
index 0000000..5d4e58d
--- /dev/null
+++ b/src/game.h
@@ -0,0 +1,20 @@
+#include "gameCommon.h"
+
+#ifndef GAME_H
+#define GAME_H
+
+typedef enum ScreenId
+{
+ MAIN_MENU_SCREEN,
+ GAME_SCREEN
+} ScreenId;
+
+typedef struct Game
+{
+} Game;
+
+void initGame(Game* game);
+void updateGame(Game* game);
+void closeGame(Game* game);
+
+#endif
diff --git a/src/gameCommon.h b/src/gameCommon.h
new file mode 100644
index 0000000..c825873
--- /dev/null
+++ b/src/gameCommon.h
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include <raylib.h>
+#include <raymath.h>
+
+#define WINDOW_WIDTH 640
+#define WINDOW_HEIGHT 480
+
+#ifndef GAME_COMMON_H
+#define GAME_COMMON_H
+
+typedef struct Game game;
+
+#endif
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..e2e5e67
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,17 @@
+#include "gameCommon.h"
+#include "game.h"
+#include <raylib.h>
+
+int main(int argc, char** argv)
+{
+ Game game;
+ initGame(&game);
+
+ while (!WindowShouldClose())
+ {
+ updateGame(&game);
+ }
+
+ closeGame(&game);
+ return 0;
+}