Make textLeft, textRight, value optional in GuiSlider, GuiSliderBar, GuiProgressBar (#306)

This commit is contained in:
Nikolas 2026-01-29 20:32:14 +01:00
parent aaaa53c3ce
commit 81c58a3d44
No known key found for this signature in database
GPG Key ID: E95F679E3CDD9784
2 changed files with 13 additions and 4 deletions

View File

@ -399,7 +399,16 @@ def parse_header(header_name: str, output_file: str, ext_file: str, prefix: str,
("rlLoadShaderBuffer", "data"),
("rlLoadShaderCode", "vsCode"),
("rlLoadShaderCode", "fsCode"),
("GuiTextInputBox", "secretViewActive")
("GuiTextInputBox", "secretViewActive"),
("GuiSlider", "textLeft"),
("GuiSlider", "textRight"),
("GuiSlider", "value"),
("GuiSliderBar", "textLeft"),
("GuiSliderBar", "textRight"),
("GuiSliderBar", "value"),
("GuiProgressBar", "textLeft"),
("GuiProgressBar", "textRight"),
("GuiProgressBar", "value"),
]
zig_type = ziggify_type(arg_name, arg_type, func_name)

View File

@ -665,17 +665,17 @@ pub fn valueBoxFloat(bounds: Rectangle, text: [:0]const u8, textValue: [:0]u8, v
}
/// Slider control
pub fn slider(bounds: Rectangle, textLeft: [:0]const u8, textRight: [:0]const u8, value: *f32, minValue: f32, maxValue: f32) i32 {
pub fn slider(bounds: Rectangle, textLeft: ?[:0]const u8, textRight: ?[:0]const u8, value: ?*f32, minValue: f32, maxValue: f32) i32 {
return @as(i32, cdef.GuiSlider(bounds, @as([*c]const u8, @ptrCast(textLeft)), @as([*c]const u8, @ptrCast(textRight)), @as([*c]f32, @ptrCast(value)), minValue, maxValue));
}
/// Slider Bar control
pub fn sliderBar(bounds: Rectangle, textLeft: [:0]const u8, textRight: [:0]const u8, value: *f32, minValue: f32, maxValue: f32) i32 {
pub fn sliderBar(bounds: Rectangle, textLeft: ?[:0]const u8, textRight: ?[:0]const u8, value: ?*f32, minValue: f32, maxValue: f32) i32 {
return @as(i32, cdef.GuiSliderBar(bounds, @as([*c]const u8, @ptrCast(textLeft)), @as([*c]const u8, @ptrCast(textRight)), @as([*c]f32, @ptrCast(value)), minValue, maxValue));
}
/// Progress Bar control
pub fn progressBar(bounds: Rectangle, textLeft: [:0]const u8, textRight: [:0]const u8, value: *f32, minValue: f32, maxValue: f32) i32 {
pub fn progressBar(bounds: Rectangle, textLeft: ?[:0]const u8, textRight: ?[:0]const u8, value: ?*f32, minValue: f32, maxValue: f32) i32 {
return @as(i32, cdef.GuiProgressBar(bounds, @as([*c]const u8, @ptrCast(textLeft)), @as([*c]const u8, @ptrCast(textRight)), @as([*c]f32, @ptrCast(value)), minValue, maxValue));
}