diff --git a/src/consts.zig b/src/consts.zig new file mode 100644 index 0000000..4695511 --- /dev/null +++ b/src/consts.zig @@ -0,0 +1,2 @@ +pub const SCREEN_WIDTH = 1920; +pub const SCREEN_HEIGHT = 1080; diff --git a/src/main.zig b/src/main.zig index 7e2e133..002f2a9 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1,34 +1,20 @@ -// raylib-zig (c) Nikolas Wipper 2023 - const rl = @import("raylib"); +const consts = @import("consts.zig"); pub fn main() anyerror!void { - // Initialization - //-------------------------------------------------------------------------------------- - const screenWidth = 800; - const screenHeight = 450; - - rl.initWindow(screenWidth, screenHeight, "raylib-zig [core] example - basic window"); - defer rl.closeWindow(); // Close window and OpenGL context - - rl.setTargetFPS(60); // Set our game to run at 60 frames-per-second - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!rl.windowShouldClose()) { // Detect window close button or ESC key - // Update - //---------------------------------------------------------------------------------- - // TODO: Update your variables here - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - rl.beginDrawing(); - defer rl.endDrawing(); - - rl.clearBackground(.white); - - rl.drawText("Congrats! You created your first window!", 190, 200, 20, .light_gray); - //---------------------------------------------------------------------------------- + rl.initWindow(consts.SCREEN_WIDTH, consts.SCREEN_HEIGHT, "Pathdelver"); + defer rl.closeWindow(); + rl.setTargetFPS(60); + // init game + + while (!rl.windowShouldClose()) { + // update game + + { + rl.beginDrawing(); + defer rl.endDrawing(); + rl.clearBackground(.black); + // draw game + } } }