Compare commits
2 commits
bad90f12c5
...
f327df5c97
Author | SHA1 | Date | |
---|---|---|---|
|
f327df5c97 | ||
|
dfa42ab7db |
5 changed files with 26 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
libraylib.a
|
|
@ -1,4 +1,5 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
|
const raylib = @import("./3rdparty/raylib/src/build.zig");
|
||||||
|
|
||||||
pub fn build(b: *std.build.Builder) void {
|
pub fn build(b: *std.build.Builder) void {
|
||||||
// Standard target options allows the person running `zig build` to choose
|
// Standard target options allows the person running `zig build` to choose
|
||||||
|
@ -13,6 +14,11 @@ pub fn build(b: *std.build.Builder) void {
|
||||||
|
|
||||||
const exe = b.addExecutable("doggo", "src/main.zig");
|
const exe = b.addExecutable("doggo", "src/main.zig");
|
||||||
exe.setTarget(target);
|
exe.setTarget(target);
|
||||||
|
|
||||||
|
const ray = raylib.Pkg("./3rdparty/raylib/src").addRaylib(b, exe.target);
|
||||||
|
exe.linkLibrary(ray);
|
||||||
|
exe.addIncludeDir("./3rdparty/raylib/src");
|
||||||
|
|
||||||
exe.setBuildMode(mode);
|
exe.setBuildMode(mode);
|
||||||
exe.install();
|
exe.install();
|
||||||
|
|
||||||
|
|
2
justfile
Normal file
2
justfile
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
run:
|
||||||
|
nixGL zig build run
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
|
just
|
||||||
zig
|
zig
|
||||||
|
|
||||||
xorg.libX11
|
xorg.libX11
|
||||||
|
|
16
src/main.zig
16
src/main.zig
|
@ -1,7 +1,23 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
|
const ray = @cImport({
|
||||||
|
@cInclude("raylib.h");
|
||||||
|
});
|
||||||
|
|
||||||
pub fn main() anyerror!void {
|
pub fn main() anyerror!void {
|
||||||
std.log.info("All your codebase are belong to us.", .{});
|
std.log.info("All your codebase are belong to us.", .{});
|
||||||
|
|
||||||
|
ray.InitWindow(800, 450, "ray [core] example - basic window");
|
||||||
|
defer ray.CloseWindow();
|
||||||
|
|
||||||
|
while (!ray.WindowShouldClose())
|
||||||
|
{
|
||||||
|
ray.BeginDrawing();
|
||||||
|
defer ray.EndDrawing();
|
||||||
|
|
||||||
|
ray.ClearBackground(ray.RAYWHITE);
|
||||||
|
ray.DrawText("Congrats! You created your first window!", 190, 200, 20, ray.LIGHTGRAY);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test "basic test" {
|
test "basic test" {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue