Skip to content
cacticrownPublic

About

A dead simple 2D video game library written in zig

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

47 Commits

Folders and files

Repository files navigation

crownlet

A dead simple 2D video game library written in zig

License Zig Version Documentation

Example

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",
    });
}

Getting started

Fetch and save crownlet to your build.zig.zon by running this command:

zig fetch --save git+https://github.com/cacticrown/crownlet

Then 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.

About

A dead simple 2D video game library written in zig

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages