Add loadRandomSequence

This commit is contained in:
Nikolas 2025-03-30 18:05:41 +02:00
parent a00552ea79
commit c30197911a
No known key found for this signature in database
GPG Key ID: E95F679E3CDD9784
2 changed files with 20 additions and 0 deletions

View File

@ -2022,6 +2022,16 @@ pub fn loadShaderFromMemory(vsCode: ?[:0]const u8, fsCode: ?[:0]const u8) Raylib
return if (isValid) shader else RaylibError.LoadShader;
}
pub fn loadRandomSequence(count: u32, min: i32, max: i32) []i32 {
var res: []i32 = undefined;
const ptr = cdef.LoadRandomSequence(@as(c_uint, @intCast(count)), @as(c_int, @intCast(min)), @as(c_int, @intCast(max)));
res.ptr = @as([*]i32, @ptrCast(ptr));
res.len = @as(usize, @intCast(count));
return res;
}
/// Load file data as byte array (read)
pub fn loadFileData(fileName: [:0]const u8) RaylibError![]u8 {
var bytesRead: i32 = 0;

View File

@ -2022,6 +2022,16 @@ pub fn loadShaderFromMemory(vsCode: ?[:0]const u8, fsCode: ?[:0]const u8) Raylib
return if (isValid) shader else RaylibError.LoadShader;
}
pub fn loadRandomSequence(count: u32, min: i32, max: i32) []i32 {
var res: []i32 = undefined;
const ptr = cdef.LoadRandomSequence(@as(c_uint, @intCast(count)), @as(c_int, @intCast(min)), @as(c_int, @intCast(max)));
res.ptr = @as([*]i32, @ptrCast(ptr));
res.len = @as(usize, @intCast(count));
return res;
}
/// Load file data as byte array (read)
pub fn loadFileData(fileName: [:0]const u8) RaylibError![]u8 {
var bytesRead: i32 = 0;