The code in this repository is a translation and refactoring of C source code found at:
https://github.com/raysan5/raylib-game-template
The original code is Copyright (c) 2014-2024 Ramon Santamaria
For documentation refer to the repository above.
The original code is written in C. This code was manually translated to zig and then refactored to be more "zig like" using established zigisms.
- zig naming conventions - except for all capitals constants names that were originally
#define
- no global (ie. file scope)
var
variables - each screen in the original is represented in zig by its own
struct
with consistent methods- init()
- deinit() where applicable
- update()
- draw()
- the screen instances are held in a tagged union
- there are no zig tests
- developed and run on Microsoft Windows 11 only
Both zig and raylib used for this project are development versions - primarily because zig is being heavily developed and raylib tracks changes in it's zig build.
- zig
0.12.0-dev.3033
- raylib master branch dated 27 February 2024
Please don't be surprised if the project does not compile without tweaking - this is not set up for the unwary.
zig build run