add raylib.zig as wrapper

This commit is contained in:
Fabien Freling 2023-10-13 15:53:58 +02:00
parent 3216292d08
commit c51423874b
2 changed files with 7 additions and 8 deletions

View file

@ -1,11 +1,5 @@
const std = @import("std");
const raylib = @cImport({
@cInclude("raylib.h");
});
const raygui = @cImport({
@cDefine("RAYGUI_IMPLEMENTATION", "1");
@cInclude("raygui.h");
});
const raylib = @import("raylib.zig");
const sqlite = @cImport({
@cInclude("sqlite3.h");
});
@ -21,7 +15,7 @@ pub fn main() !void {
raylib.ClearBackground(raylib.RAYWHITE);
raylib.DrawText("Congrats! You created your first window!", 190, 200, 20, raylib.LIGHTGRAY);
if (raygui.GuiButton(.{ .x = 0, .y = 0, .width = 100, .height = 100 }, "MyButton") == 1) {}
if (raylib.GuiButton(.{ .x = 0, .y = 0, .width = 100, .height = 100 }, "MyButton") == 1) {}
}
raylib.CloseWindow();
}

5
src/raylib.zig Normal file
View file

@ -0,0 +1,5 @@
pub usingnamespace @cImport({
@cInclude("raylib.h");
@cDefine("RAYGUI_IMPLEMENTATION", "1");
@cInclude("raygui.h");
});