Raylib has a ton of language bindings. I've been using it with Zig, the integration was seamless and have not encountered these types of bugs yet.
Both Raylib and Zig include all dependencies too, so I was able to build a single 700kb .exe from Linux, copy that to my Windows machine, and it just worked immediately without any issues. Pretty amazing.
At the top of your build.zig, import the raylib build.zig inside raylib's /src folder (exact path will depend where you've cloned raylib)
const raySdk = @import("raylib/src/build.zig");
Use the imported addRaylib() function to build raylib, then link to the exe and add include path var raylib = raySdk.addRaylib(b, target, optimize, .{});
exe.addIncludePath(.{ .path = "raylib/src" });
exe.linkLibrary(raylib);
After that, you should be fine to just use @cImport to use raylib within your project const ray = @cImport({
@cInclude("raylib.h");
});
pub fn main() void {
ray.InitWindow(800, 450, "raylib [core] example - basic window");
...Cannot not mention a Tic80. It is a FOSS alternative to PICO8.
Main differences are: 16:9 aspect ratio, no cpu limits and many languages to tinker with: lua, js, moonscript, ruby, squirrel, wren, fennel, janet, wasm, ... and just recently - a Python support was added.
- https://github.com/kitao/pyxel (Python)
- https://github.com/minigdx/tiny (Lua)
https://github.com/picolove/picolove (Love2D)
https://pixelvision8.github.io/Website/ (Lua)
https://hallucino.itch.io/px8 (Lua/Python)
https://liko-12.github.io/ (Lua)
https://github.com/antirez/load81 (Lua)
https://wasm4.org/ (WASM)
No idea if it will ever see the light of day, but it's been a very therapeutic hobby project.
I love open source: my two books are open source, I work in open source, and almost all of my hobby projects are open source.
But after spending all day coordinating with users and combing through the issue tracker, there's something very relaxing to me to have a little project where I don't feel "on stage" whenn working on it. It's good for me to get a social break.
If you're looking in that realm I also have to mention RAYLIB [1]. It might remind you of the XNA days, except it runs on many platforms and it actually works! (sic.) It's a Borland C style one-file include with some serious power. It's also a ton of fun until you segfault 3 mins into gameplay and you have no idea why. But then you can only blame yourself!
Final plug is of course PICO8. Very different style once again but so much fun[2]! Simple, cheat-sheet style programming, with all batteries included (pixel/spritesheet editor, mini DAW). And the productivity might surprise you, as you don't agonise for days on your third redesign this month.
All of these have vibrant, helpful, communities. You can't go wrong for fun.
[1] https://www.raylib.com/
[2] https://www.lexaloffle.com/pico-8.php