diff options
| author | Loic Guegan <loic.guegan@mailbox.org> | 2023-12-24 18:20:11 +0100 |
|---|---|---|
| committer | Loic Guegan <loic.guegan@mailbox.org> | 2023-12-24 18:20:11 +0100 |
| commit | 19aa9ea7e906673d4da971220b982f144a284591 (patch) | |
| tree | 63054100f1abf0794e8a99f9c5459d85fcce78bc /src | |
| parent | c6eb14fc5ee363b8ffbebc81b7a2445c6c8c79b4 (diff) | |
Minor changes
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 2 | ||||
| -rw-r--r-- | src/main.c | 37 |
2 files changed, 37 insertions, 2 deletions
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) @@ -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; } |
