Simple odin raylib starter based on Zylinski's work and some extensions so I don't have to keep copy pasting.
0

Configure Feed

Select the types of activity you want to include in your feed.

1 1 0

Clone this repository

https://tangled.org/wlls.dev/odin-raylib-template https://tangled.org/did:plc:r7q4vbxoukn2zgjuioysa4jg
git@tangled.org:wlls.dev/odin-raylib-template git@tangled.org:did:plc:r7q4vbxoukn2zgjuioysa4jg

For self-hosted knots, clone URLs may differ based on your setup.



README.md

Odin + Raylib Template#

A minimal starter for Odin + Raylib games with a basic window, hot reloading, and release builds.

This template is intentionally light on game opinions. Put your game state and logic in src/game; the src/lib packages provide the launcher and hot-reload infrastructure.

Requirements#

Raylib is provided by Odin's vendor:raylib package.

Commands#

just check        # check all packages
just build        # build the hot-reload game library
just build-loader # build the hot-reload loader executable
just run          # build and run the hot-reload loader in the foreground
just reload       # rebuild the game library for a running loader
just dev          # run loader in the background and rebuild on src/game changes; requires watchexec or fswatch
just release      # build an optimized non-hot-reload executable
just clean        # remove build artifacts

Layout#

assets/                 Game assets
docs/                   Template docs
src/game/               Your game package
src/lib/hot_reload/     Hot-reload loader executable
src/lib/release/        Release executable entry point
src/lib/platform/       Small platform constants/helpers

Hot reload#

The game package exports a small game_* API used by both the hot-reload loader and release executable.

Persistent state should live in Game_Memory or be reachable from it. During hot reload, the loader keeps the existing Game_Memory pointer when size_of(Game_Memory) is unchanged. If the memory layout size changes, the loader restarts the game memory.

Runtime controls:

  • F5: force hot reload
  • F6: restart game memory
  • Esc: quit

Platform notes#

The Odin code uses compile-time when ODIN_OS == ... checks for platform-specific constants such as dynamic library extensions. The build is set up for macOS and Linux, with Windows extension support included but not yet validated in this repository.