Initial commit for game init/shutdown code.

This commit is contained in:
2026-07-10 08:03:47 +02:00
parent 77bb6c1b0c
commit e0a29dfa4c
2 changed files with 55 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
package game
import rl "vendor:raylib"
WINDOW_WIDTH :: 1280
WINDOW_HEIGHT :: 720
WINDOW_TITLE :: "Graveyard"
Game :: struct {
// Game state lives here. Empty for now.
}
game_init :: proc() -> Game {
game := Game{}
rl.InitWindow(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE)
rl.SetTargetFPS(60)
return game
}
game_should_run :: proc(game: ^Game) -> bool {
return !rl.WindowShouldClose()
}
game_update :: proc(game: ^Game) {
if rl.IsMouseButtonPressed(.LEFT) {
rl.TraceLog(.INFO, "Mouse clicked!")
}
}
game_draw :: proc(game: ^Game) {
rl.BeginDrawing()
// Do Draw Calls here
rl.ClearBackground(rl.WHITE)
rl.EndDrawing()
}
game_close :: proc(game: ^Game) {
rl.CloseWindow()
}
+12
View File
@@ -0,0 +1,12 @@
package game
main :: proc() {
game := game_init()
for game_should_run(&game) {
game_update(&game)
game_draw(&game)
}
game_close(&game)
}