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; }