Given this declaration:
pub fn drawSplineCatmullRom(points: []Vector2, pointCount: i32, thick: f32, color: Color) void {
I am testing this code:
const rl = @import("raylib");
const p0 = rl.Vector2{ .x = 0.0, .y = 0.0 };
const p1 = rl.Vector2{ .x = 160.0, .y = 220.0 };
const p2 = rl.Vector2{ .x = 340.0, .y = 380.0 };
const p3 = rl.Vector2{ .x = 480.0, .y = 90.0 };
const p4 = rl.Vector2{ .x = 700.0, .y = 60.0 };
const points = [_]rl.Vector2{p0, p1, p2, p3, p4};
rl.drawSplineCatmullRom(points, 5, 10, rl.Color.black);
and getting this error:
src/toolbox.zig:39:29: error: array literal requires address-of operator (&) to coerce to slice type '[]raylib.Vector2'
rl.drawSplineCatmullRom(points, 5, 10, rl.Color.black);
Then, modifying the call to this:
rl.drawSplineCatmullRom(&points, 5, 10, rl.Color.black);
I get that:
src/toolbox.zig:39:29: error: expected type '[]raylib.Vector2', found '*const [5]raylib.Vector2'
rl.drawSplineCatmullRom(&points, 5, 10, rl.Color.black);
^~~~~~~
src/toolbox.zig:39:29: note: cast discards const qualifier
lib/raylib.zig:2357:37: note: parameter type declared here
pub fn drawSplineCatmullRom(points: []Vector2, pointCount: i32, thick: f32, color: Color) void {
^~~~~~~~~
I am reading the documentation on arrays and slices but these error messages are confusing. What is my call missing ?