initial commit
This commit is contained in:
commit
cd334f1a84
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
zig-cache
|
||||||
|
zig-out
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[submodule "libs/raylib"]
|
||||||
|
path = libs/raylib
|
||||||
|
url = git@rpuzonas.com:rpuzonas/raylib-zig.git
|
32
build.zig
Normal file
32
build.zig
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
const std = @import("std");
|
||||||
|
const raylib = @import("libs/raylib/build.zig");
|
||||||
|
|
||||||
|
pub fn build(b: *std.Build) void {
|
||||||
|
const target = b.standardTargetOptions(.{});
|
||||||
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
|
|
||||||
|
const exe = b.addExecutable(.{
|
||||||
|
.name = "step-kill",
|
||||||
|
.root_source_file = .{ .path = "src/main.zig" },
|
||||||
|
.target = target,
|
||||||
|
.optimize = optimize,
|
||||||
|
});
|
||||||
|
|
||||||
|
raylib.addTo(b, exe, target, optimize, .{});
|
||||||
|
|
||||||
|
const git_submodule_run = b.addSystemCommand(&.{"git", "submodule", "update", "--init", "--recursive"});
|
||||||
|
exe.step.dependOn(&git_submodule_run.step);
|
||||||
|
|
||||||
|
b.installArtifact(exe);
|
||||||
|
|
||||||
|
const run_cmd = b.addRunArtifact(exe);
|
||||||
|
run_cmd.step.dependOn(b.getInstallStep());
|
||||||
|
|
||||||
|
if (b.args) |args| {
|
||||||
|
run_cmd.addArgs(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
const run_step = b.step("run", "Run the app");
|
||||||
|
run_step.dependOn(&run_cmd.step);
|
||||||
|
|
||||||
|
}
|
1
libs/raylib
Submodule
1
libs/raylib
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 97f501240b3b23fa338ae589d484e914270f13eb
|
19
src/main.zig
Normal file
19
src/main.zig
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
const rl = @import("raylib");
|
||||||
|
|
||||||
|
pub fn main() void {
|
||||||
|
rl.SetConfigFlags(rl.ConfigFlags{ .FLAG_WINDOW_RESIZABLE = true });
|
||||||
|
rl.InitWindow(800, 800, "hello world!");
|
||||||
|
rl.SetTargetFPS(60);
|
||||||
|
|
||||||
|
defer rl.CloseWindow();
|
||||||
|
|
||||||
|
while (!rl.WindowShouldClose()) {
|
||||||
|
rl.BeginDrawing();
|
||||||
|
defer rl.EndDrawing();
|
||||||
|
|
||||||
|
rl.ClearBackground(rl.BLACK);
|
||||||
|
rl.DrawFPS(10, 10);
|
||||||
|
|
||||||
|
rl.DrawText("hello world!", 100, 100, 20, rl.YELLOW);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user