Update to Zig 0.14.0 and raylib 5.6-dev

This commit is contained in:
Nikolas 2025-03-05 18:09:59 +01:00
parent ae7cb3fa93
commit 1b6a05ca3b
Failed to generate hash of commit
15 changed files with 586 additions and 321 deletions

View file

@ -58,7 +58,7 @@ pub const GuiControl = enum(c_int) {
dropdownbox,
textbox,
valuebox,
spinner,
control11,
listview,
colorpicker,
scrollbar,
@ -135,7 +135,7 @@ pub const GuiTextBoxProperty = enum(c_int) {
text_readonly = 16,
};
pub const GuiSpinnerProperty = enum(c_int) {
pub const GuiValueBoxProperty = enum(c_int) {
spin_button_width = 16,
spin_button_spacing,
};
@ -145,6 +145,7 @@ pub const GuiListViewProperty = enum(c_int) {
list_items_spacing,
scrollbar_width,
scrollbar_side,
list_items_border_normal,
list_items_border_width,
};

View file

@ -1843,6 +1843,7 @@ pub const ShaderLocationIndex = enum(c_int) {
vertex_boneids = 26,
vertex_boneweights = 27,
bone_matrices = 28,
shader_loc_vertex_instance_tx
};
pub const ShaderUniformDataType = enum(c_int) {
@ -1975,7 +1976,7 @@ pub const AudioCallback = ?*const fn (?*anyopaque, c_uint) callconv(.C) void;
pub const RAYLIB_VERSION_MAJOR = @as(i32, 5);
pub const RAYLIB_VERSION_MINOR = @as(i32, 5);
pub const RAYLIB_VERSION_PATCH = @as(i32, 0);
pub const RAYLIB_VERSION = "5.5";
pub const RAYLIB_VERSION = "5.6-devfn alloc(_: *anyopaque, len: usize, _: std.mem.Alignment, _: usize) ?[*]u8 {";
pub const MAX_TOUCH_POINTS = 10;
pub const MAX_MATERIAL_MAPS = 12;
@ -2518,8 +2519,8 @@ pub fn loadUTF8(codepoints: []const c_int) [*:0]u8 {
}
/// Join text strings with delimiter
pub fn textJoin(textList: [][*:0]const u8, delimiter: [*:0]const u8) [*:0]const u8 {
return std.mem.span(cdef.TextJoin(@as([*c][*c]const u8, @ptrCast(textList)), @as(c_int, @intCast(textList.len)), @as([*c]const u8, @ptrCast(delimiter))));
pub fn textJoin(textList: [][*:0]u8, delimiter: [*:0]const u8) [*:0]const u8 {
return std.mem.span(cdef.TextJoin(@as([*c][*c]u8, @ptrCast(textList)), @as(c_int, @intCast(textList.len)), @as([*c]const u8, @ptrCast(delimiter))));
}
/// Draw a triangle strip defined by points
@ -2528,24 +2529,34 @@ pub fn drawTriangleStrip3D(points: []const Vector3, color: Color) void {
}
/// Internal memory allocator
fn alloc(_: *anyopaque, len: usize, _: u8, _: usize) ?[*]u8 {
fn alloc(_: *anyopaque, len: usize, _: std.mem.Alignment, _: usize) ?[*]u8 {
std.debug.assert(len > 0);
return @ptrCast(cdef.MemAlloc(@intCast(len)));
}
fn resize(_: *anyopaque, buf: []u8, _: u8, new_len: usize, _: usize) bool {
fn resize(_: *anyopaque, buf: []u8, _: std.mem.Alignment, new_len: usize, _: usize) bool {
return (new_len <= buf.len);
}
/// Internal memory free
fn free(_: *anyopaque, buf: []u8, _: u8, _: usize) void {
fn free(_: *anyopaque, buf: []u8, _: std.mem.Alignment, _: usize) void {
cdef.MemFree(buf.ptr);
}
fn remap(_: *anyopaque, buf: []u8, _: std.mem.Alignment, new_len: usize, _: usize) ?[*]u8 {
if (new_len <= buf.len) {
return buf.ptr;
} else {
return null;
}
}
const mem_vtable = std.mem.Allocator.VTable{
.alloc = alloc,
.resize = resize,
.free = free,
.remap = remap,
};
pub const mem = std.mem.Allocator{

View file

@ -266,3 +266,7 @@ pub const rl_default_shader_attrib_location_normal = @as(i32, 2);
pub const rl_default_shader_attrib_location_color = @as(i32, 3);
pub const rl_default_shader_attrib_location_tangent = @as(i32, 4);
pub const rl_default_shader_attrib_location_texcoord2 = @as(i32, 5);
pub const rl_default_shader_attrib_location_indices = @as(i32, 6);
pub const rl_default_shader_attrib_location_boneids = @as(i32, 7);
pub const rl_default_shader_attrib_location_boneweights = @as(i32, 5);
pub const rl_default_shader_attrib_location_instance_tx = @as(i32, 9);