v0.4 | Docs | Demo Project
fyr is a wrapper of Not-Nik's raylib-zig using johan0A's clay-zig-bindings. fyr also contains a fully functional ECS (Entity Component System) and a caching asset handling solution.
Important
The project uses zig version 0.14.0
and the latest version of the bindings.
Still in beta, some docs may be missing or incomplete! Contributions are welcome.
You are only a couple of easy steps away fromm building your dream project:
-
Run the following command to save the dependency:
zig fetch --save git+https://github.com/zewenn/fyr#stable
-
Add the following to your
build.zig
:const fyr_module = b.dependency("fyr", .{ .target = target, .optimize = optimize, }); const fyr = fyr_module.module("fyr"); exe.root_module.addImport("fyr", fyr);
-
You are ready to go! Now you can import fyr with a regular zig
@import()
:const fyr = @import("fyr");
Setting up a project with fyr
is so easy, even your grandma could do it 😄
Note
You can follow the documentation, or take a look at the demo project
const window = fyr.window;
pub fn main() !void {
fyr.project({
window.title("fyr-demo");
window.size.set(fyr.Vec2(1280, 720));
window.fps.setTarget(256);
window.resizing.enable();
// Paths for the assets directory
fyr.useAssetPaths(.{
.debug = "./src/demo/assets/",
});
})({
// The default scene will be automatically loaded.
fyr.scene("default")({
fyr.entities(.{
// Add entities here
});
fyr.scripts(.{
// Add scripts here
});
});
});
}