colorful box

This commit is contained in:
2024-11-25 20:54:45 -05:00
parent b8d89122ab
commit ce8109c1aa
8 changed files with 280 additions and 166 deletions

View File

@@ -93,3 +93,10 @@ pub fn add_resize_callback(cb: *const fn (u32, u32) void) void {
pub fn set_title(title: [:0]const u8) void {
c.glfwSetWindowTitle(handle, title);
}
pub fn size() std.meta.Tuple(&[_]type{ u32, u32 }) {
var w: c_int = undefined;
var h: c_int = undefined;
c.glfwGetFramebufferSize(handle, &w, &h);
return .{ @intCast(w), @intCast(h) };
}