Bump raylib/zig versions

This commit is contained in:
Nikolas 2026-04-03 18:13:05 +02:00
parent aa9ee05f22
commit 8e04b7098a
Failed to generate hash of commit
20 changed files with 1383 additions and 1027 deletions

View file

@ -4,7 +4,7 @@ const std = @import("std");
pub const cdef = @import("raygui-ext.zig");
test {
std.testing.refAllDeclsRecursive(@This());
std.testing.refAllDecls(@This());
}
pub const RayguiError = error{GetIcons};
@ -120,6 +120,7 @@ pub const SliderProperty = enum(c_int) {
pub const ProgressBarProperty = enum(c_int) {
progress_padding = 16,
progress_side,
};
pub const ScrollBarProperty = enum(c_int) {
@ -411,22 +412,22 @@ pub const IconName = enum(c_int) {
slicing = 231,
manual_control = 232,
collision = 233,
icon_234 = 234,
icon_235 = 235,
icon_236 = 236,
icon_237 = 237,
icon_238 = 238,
icon_239 = 239,
icon_240 = 240,
icon_241 = 241,
icon_242 = 242,
icon_243 = 243,
icon_244 = 244,
icon_245 = 245,
icon_246 = 246,
icon_247 = 247,
icon_248 = 248,
icon_249 = 249,
circle_add = 234,
circle_add_fill = 235,
circle_warning = 236,
circle_warning_fill = 237,
box_more = 238,
box_more_fill = 239,
box_minus = 240,
box_minus_fill = 241,
union_ = 242,
intersection = 243,
difference = 244,
sphere = 245,
cylinder = 246,
cone = 247,
ellipsoid = 248,
capsule = 249,
icon_250 = 250,
icon_251 = 251,
icon_252 = 252,
@ -472,13 +473,13 @@ pub fn loadIcons(fileName: [*c]const u8, loadIconsName: bool) [*c][*c]u8 {
}
/// Tab Bar control, returns TAB to be closed or -1
pub fn tabBar(bounds: Rectangle, text: [][*:0]const u8, active: *i32) i32 {
return @as(i32, cdef.GuiTabBar(bounds, @as([*c][*c]const u8, @ptrCast(text)), @as(c_int, @intCast(text.len)), @as([*c]c_int, @ptrCast(active))));
pub fn tabBar(bounds: Rectangle, text: [][*:0]u8, active: *i32) i32 {
return @as(i32, cdef.GuiTabBar(bounds, @as([*c][*c]u8, @ptrCast(text)), @as(c_int, @intCast(text.len)), @as([*c]c_int, @ptrCast(active))));
}
/// List View with extended parameters
pub fn listViewEx(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 listViewEx(bounds: Rectangle, text: [][*:0]u8, scrollIndex: *i32, active: *i32, focus: *i32) i32 {
return @as(i32, cdef.GuiListViewEx(bounds, @as([*c][*c]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))));
}
/// Panel control, useful to group controls

View file

@ -11,7 +11,7 @@ pub const math = @import("raymath.zig");
const C = std.builtin.CallingConvention.c;
test {
std.testing.refAllDeclsRecursive(@This());
std.testing.refAllDecls(@This());
}
pub const RaylibError = error{
@ -1401,6 +1401,8 @@ pub const Camera2D = extern struct {
pub const Mesh = extern struct {
vertexCount: c_int,
triangleCount: c_int,
// Vertex attributes data
vertices: [*c]f32,
texcoords: [*c]f32,
texcoords2: [*c]f32,
@ -1408,12 +1410,18 @@ pub const Mesh = extern struct {
tangents: [*c]f32,
colors: [*c]u8,
indices: [*c]c_ushort,
// Skin data for animation
boneCount: c_int,
boneIndices: [*c]u16,
boneWeights: [*c]f32,
// Runtime animation vertex data (CPU skinning)
// NOTE: In case of GPU skinning, not used, pointers are NULL
animVertices: [*c]f32,
animNormals: [*c]f32,
boneIds: [*c]u8,
boneWeights: [*c]f32,
boneMatrices: [*c]Matrix,
boneCount: c_int,
// OpenGL identifiers
vaoId: c_int,
vboId: [*c]c_int,
@ -1476,11 +1484,19 @@ pub const Transform = extern struct {
scale: Vector3,
};
pub const ModelAnimPose = [*c]Transform;
pub const BoneInfo = extern struct {
name: [32]u8,
parent: c_int,
};
pub const ModelSkeleton = extern struct {
boneCount: c_int,
bones: [*c]BoneInfo,
bindPose: ModelAnimPose
};
pub const Model = extern struct {
transform: Matrix,
meshCount: c_int,
@ -1488,9 +1504,11 @@ pub const Model = extern struct {
meshes: [*c]Mesh,
materials: [*c]Material,
meshMaterial: [*c]c_int,
boneCount: c_int,
bones: [*c]BoneInfo,
bindPose: [*c]Transform,
// Animation data
skeleton: ModelSkeleton,
currentPose: ModelAnimPose,
boneMatrices: [*c]Matrix,
/// Load model from file (meshes and materials)
pub fn init(fileName: [:0]const u8) RaylibError!Model {
@ -1529,12 +1547,12 @@ pub const Model = extern struct {
};
pub const ModelAnimation = extern struct {
boneCount: c_int,
frameCount: c_int,
bones: [*c]BoneInfo,
framePoses: [*c][*c]Transform,
name: [32]u8,
boneCount: c_int,
keyframeCount: c_int,
keyframePoses: [*c]ModelAnimPose,
/// Unload animation data
pub fn unload(self: ModelAnimation) void {
rl.unloadModelAnimation(self);
@ -1640,7 +1658,6 @@ pub const VrStereoConfig = extern struct {
};
pub const FilePathList = extern struct {
capacity: c_uint,
count: c_uint,
paths: [*c][*c]u8,
};
@ -1662,7 +1679,7 @@ pub const AutomationEventList = extern struct {
}
};
pub const ConfigFlags = packed struct {
pub const ConfigFlags = packed struct(u32) {
__reserved: bool = false,
fullscreen_mode: bool = false,
window_resizable: bool = false,
@ -1918,8 +1935,8 @@ pub const ShaderLocationIndex = enum(c_int) {
map_brdf = 25,
vertex_boneids = 26,
vertex_boneweights = 27,
bone_matrices = 28,
shader_loc_vertex_instance_tx = 29,
matrix_bonetransforms = 28,
matrix_instancetransforms = 29,
//
};
@ -2010,7 +2027,7 @@ pub const BlendMode = enum(c_int) {
custom_separate = 7,
};
pub const Gesture = packed struct {
pub const Gesture = packed struct(u16) {
tap: bool = false,
doubletap: bool = false,
hold: bool = false,
@ -2138,6 +2155,11 @@ pub fn computeSHA1(data: []u8) [5]u32 {
return res[0..5].*;
}
pub fn computeSHA256(data: []u8) [8]u32 {
const res: [*]c_uint = cdef.ComputeSHA256(@as([*c]u8, @ptrCast(data)), @as(c_int, @intCast(data.len)));
return res[0..8].*;
}
/// Load image from file into CPU memory (RAM)
pub fn loadImage(fileName: [:0]const u8) RaylibError!Image {
const image = cdef.LoadImage(@as([*c]const u8, @ptrCast(fileName)));

View file

@ -6,7 +6,7 @@ const std = @import("std");
pub const cdef = @import("raymath-ext.zig");
test {
std.testing.refAllDeclsRecursive(@This());
std.testing.refAllDecls(@This());
}
const Matrix = rl.Matrix;

View file

@ -6,7 +6,7 @@ const std = @import("std");
pub const cdef = @import("rlgl-ext.zig");
test {
std.testing.refAllDeclsRecursive(@This());
std.testing.refAllDecls(@This());
}
const Matrix = rl.Matrix;
@ -39,7 +39,7 @@ pub const rlRenderBatch = extern struct {
};
pub const rlGlVersion = enum(c_int) {
rl_opengl_11_software = 0,
rl_opengl_software = 0,
rl_opengl_11 = 1,
rl_opengl_21 = 2,
rl_opengl_33 = 3,
@ -268,6 +268,6 @@ 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);
pub const rl_default_shader_attrib_location_boneindices = @as(i32, 7);
pub const rl_default_shader_attrib_location_boneweights = @as(i32, 8);
pub const rl_default_shader_attrib_location_instancetransform = @as(i32, 9);