Init zig project with raylib bindings
This commit is contained in:
31
src/main.zig
Normal file
31
src/main.zig
Normal file
@ -0,0 +1,31 @@
|
||||
const std = @import("std");
|
||||
const rl = @import("raylib");
|
||||
|
||||
const Frug = struct {
|
||||
pos: rl.Vec3,
|
||||
};
|
||||
|
||||
|
||||
pub fn main(init: std.process.Init) anyerror!void {
|
||||
const io = init.io;
|
||||
try std.Io.File.stdout().writeStreamingAll(io, "FRUGG!\n");
|
||||
|
||||
const screenWidth = 800;
|
||||
const screenHeight = 450;
|
||||
|
||||
rl.initWindow(screenWidth, screenHeight, "Zig Frugger");
|
||||
defer rl.closeWindow();
|
||||
|
||||
rl.setTargetFPS(60);
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Main game loop
|
||||
while (!rl.windowShouldClose()) {
|
||||
rl.beginDrawing();
|
||||
defer rl.endDrawing();
|
||||
|
||||
rl.clearBackground(.white);
|
||||
|
||||
rl.drawText("FRUGG!", 190, 200, 40, .green);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user