summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <loic.guegan@mailbox.org>2023-12-24 18:20:11 +0100
committerLoic Guegan <loic.guegan@mailbox.org>2023-12-24 18:20:11 +0100
commit19aa9ea7e906673d4da971220b982f144a284591 (patch)
tree63054100f1abf0794e8a99f9c5459d85fcce78bc
parentc6eb14fc5ee363b8ffbebc81b7a2445c6c8c79b4 (diff)
Minor changes
-rw-r--r--.gitignore3
-rw-r--r--src/Makefile2
-rw-r--r--src/main.c37
3 files changed, 39 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 09b8ed0..ffd1cd0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
env
-docs/_build \ No newline at end of file
+docs/_build
+src/chip-8 \ No newline at end of file
diff --git a/src/Makefile b/src/Makefile
index 22512eb..d9aec8c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -2,7 +2,7 @@
EXEC=chip-8
$(EXEC): main.c
- gcc $^ -o $@
+ gcc -lraylib $^ -o $@
clean:
- rm $(EXEC)
diff --git a/src/main.c b/src/main.c
index cf33aba..be32b31 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,8 +1,43 @@
-
+#include "raylib.h"
int main(int argc, char *argv[])
{
+
+ // Initialization
+ //--------------------------------------------------------------------------------------
+ const int screenWidth = 800;
+ const int screenHeight = 450;
+
+ InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
+
+ SetTargetFPS(60); // Set our game to run at 60 frames-per-second
+ //--------------------------------------------------------------------------------------
+
+ // Main game loop
+ while (!WindowShouldClose()) // Detect window close button or ESC key
+ {
+ // Update
+ //----------------------------------------------------------------------------------
+ // TODO: Update your variables here
+ //----------------------------------------------------------------------------------
+
+ // Draw
+ //----------------------------------------------------------------------------------
+ BeginDrawing();
+
+ ClearBackground(RAYWHITE);
+
+ DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
+
+ EndDrawing();
+ //----------------------------------------------------------------------------------
+ }
+
+ // De-Initialization
+ //--------------------------------------------------------------------------------------
+ CloseWindow(); // Close window and OpenGL context
+ //----------
return 0;
}