A dead simple 2D video game library written in zig
const crown = @import("crownlet");
const Game = struct {};
fn draw(game: *Game) !void {
_ = game;
try crown.graphics.begin(.{});
try crown.graphics.clear(crown.graphics.Color.black);
try crown.graphics.end();
}
pub fn main() !void {
var game = Game{};
try crown.run(&game, .{
.draw = &draw,
.window_title = "example",
});
}Fetch and save crownlet to your build.zig.zon by running this command:
zig fetch --save git+https://github.com/cacticrown/crownletThen in your build.zig, add the dependency and import the crownlet module into whatever module/executable needs it:
const crownlet_dep = b.dependency("crownlet", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("crownlet", crownlet_dep.module("crownlet"));See this example repository for more details.