Make panel text optional (#109)

This commit is contained in:
Not-Nik 2024-06-25 19:49:50 +02:00
parent 18a7daa631
commit fb11a4e1c8
Failed to generate hash of commit
3 changed files with 35 additions and 9 deletions

View file

@ -435,3 +435,19 @@ pub fn guiTabBar(bounds: Rectangle, text: [][:0]const u8, active: *i32) i32 {
pub fn guiListViewEx(bounds: Rectangle, text: [][:0]const u8, scrollIndex: *i32, active: *i32, focus: *i32) i32 {
return @as(i32, cdef.GuiListViewEx(bounds, @as([*c][*c]const u8, @ptrCast(text)), @as(c_int, @intCast(text.len)), @as([*c]c_int, @ptrCast(scrollIndex)), @as([*c]c_int, @ptrCast(active)), @as([*c]c_int, @ptrCast(focus))));
}
pub fn guiPanel(bounds: Rectangle, text: ?[:0]const u8) i32 {
var textFinal = @as([*c]const u8, 0);
if (text) |textSure| {
textFinal = @as([*c]const u8, @ptrCast(textSure));
}
return @as(i32, cdef.GuiPanel(bounds, textFinal));
}
pub fn guiScrollPanel(bounds: Rectangle, text: ?[:0]const u8, content: Rectangle, scroll: *Vector2, view: *Rectangle) i32 {
var textFinal = @as([*c]const u8, 0);
if (text) |textSure| {
textFinal = @as([*c]const u8, @ptrCast(textSure));
}
return @as(i32, cdef.GuiScrollPanel(bounds, textFinal, content, @as([*c]Vector2, @ptrCast(scroll)), @as([*c]Rectangle, @ptrCast(view))));
}