https://github.com/zewenn/fyr
A wrapper/helper to work with raylib-zig (by Not-Nik)
https://github.com/zewenn/fyr
framework game-engine zig
Last synced: 5 months ago
JSON representation
A wrapper/helper to work with raylib-zig (by Not-Nik)
- Host: GitHub
- URL: https://github.com/zewenn/fyr
- Owner: zewenn
- License: apache-2.0
- Created: 2024-11-30T09:54:50.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-14T09:37:53.000Z (about 1 year ago)
- Last Synced: 2025-03-14T10:34:23.427Z (about 1 year ago)
- Topics: framework, game-engine, zig
- Language: Zig
- Homepage:
- Size: 2.61 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

v0.4 | Docs | Demo Project
**fyr** is a wrapper of [Not-Nik](https://github.com/Not-Nik)'s [raylib-zig](https://github.com/Not-Nik/raylib-zig) using [johan0A](https://github.com/johan0A)'s [clay-zig-bindings](https://github.com/johan0A/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.
## Add the `fyr` library
You are only a couple of easy steps away fromm building your dream project:
1. Run the following command to save the dependency:
```bash
zig fetch --save git+https://github.com/zewenn/fyr#stable
```
2. Add the following to your `build.zig`:
```zig
const fyr_module = b.dependency("fyr", .{
.target = target,
.optimize = optimize,
});
const fyr = fyr_module.module("fyr");
exe.root_module.addImport("fyr", fyr);
```
3. You are ready to go! Now you can import fyr with a regular zig `@import()`:
```zig
const fyr = @import("fyr");
```
## Project Setup
Setting up a project with `fyr` is so easy, even your grandma could do it :smile:
> [!NOTE]
> You can follow the documentation, or take a look at the [demo project](./src/demo/main.zig)
```zig
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
});
});
});
}
```