From cfb0c1c57b3f436425ecc2d0869b46ec775d8811 Mon Sep 17 00:00:00 2001 From: San Jacobs Date: Wed, 2 Jul 2025 18:18:31 +0200 Subject: Init --- build.bat | 1 + src/main.odin | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 build.bat create mode 100644 src/main.odin diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..9fb4372 --- /dev/null +++ b/build.bat @@ -0,0 +1 @@ +odin run src/ \ No newline at end of file diff --git a/src/main.odin b/src/main.odin new file mode 100644 index 0000000..f4d2238 --- /dev/null +++ b/src/main.odin @@ -0,0 +1,52 @@ +package main + +import rl "vendor:raylib" +import "core:fmt" + + +main :: proc() { + fmt.println("Hello") + + // Initialization + //-------------------------------------------------------------------------------------- + + origin : rl.Vector2 = { 0.0, 0.0 } + + rotation : f32 = 0.0 + + cameraX : f32 = 0.0 + cameraY : f32 = 0.0 + camera : rl.Camera2D + + rl.InitWindow(1920, 1080, "BSC 2025 Presentation") + rl.SetTargetFPS(60) + // Main game loop // Detect window close button or ESC key + for !rl.WindowShouldClose() { + // Input + //---------------------------------------------------------------------------------- + mousePosition := rl.GetMousePosition() + left_clicked := rl.IsMouseButtonDown(rl.MouseButton(0)) + right_clicked := rl.IsMouseButtonDown(rl.MouseButton(1)) + + + // Process + //---------------------------------------------------------------------------------- + + + + // Draw + //---------------------------------------------------------------------------------- + rl.BeginDrawing() + rl.ClearBackground(rl.RED) + + rl.BeginMode2D(camera) + + rl.EndMode2D() + + rl.DrawFPS(rl.GetScreenWidth() - 95, 10) + rl.EndDrawing() + //---------------------------------------------------------------------------------- + } + + rl.CloseWindow() +} \ No newline at end of file -- cgit v1.2.1