# raylib + C + explicit game loop
URL: https://wwadd.dev/stacks/raylib-c
Last verified: 2026-09-30

A small C-based 2D game workflow: initialize the library, update game state, draw each frame, and own resource lifetime and packaging.

## When to use it
- A small desktop game or prototype benefits from a direct C API
- The developer is comfortable with memory and resource lifetime
- The project can supply its own scenes, UI, and content workflow

## How the pieces fit
raylib provides windowing, graphics, input, and audio. Your C code owns the main loop, simulation, scene transitions, and asset lifetime. Keep update and render responsibilities distinct, unload resources explicitly, and test packaged asset paths. Pin library and compiler versions and validate distribution on the actual target. A browser build adds a separate toolchain and browser constraints; language bindings are independent choices.

## The tech and its role
- raylib: Windowing, graphics, input, audio, and resource APIs
- C game loop: Simulation, scenes, and resource lifetime

## Real-world examples
- Cat vs Roomba: The maintainer publishes this game-jam sample in the raylib-games collection. A small public game example, not a production distribution template. (source: https://github.com/raysan5/raylib-games/tree/master/cat_vs_roomba)
- Dr Turtle and Mr Gamera: The maintainer collection includes this sample game. Inspect current source before reuse; the example does not establish every target platform. (source: https://github.com/raysan5/raylib-games/tree/master/drturtle)

## Skip if
Skip if a visual scene editor is required, browser delivery is the primary target, or a high-fidelity 3D production workflow is central.

