From 2d10ac0a77720bb28de12668b2acef68418c5c3f Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 15 Oct 2022 11:29:25 -0700 Subject: [PATCH] opengl: setting buffer data with array must get proper pointer This finally gets the terminal compiling with the self-hosted Zig compiler! Wow! And this was one of those things that... should've never worked. --- src/opengl/Buffer.zig | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/opengl/Buffer.zig b/src/opengl/Buffer.zig index 60d3380e9..242e8a57c 100644 --- a/src/opengl/Buffer.zig +++ b/src/opengl/Buffer.zig @@ -40,7 +40,7 @@ pub const Binding = struct { data: anytype, usage: Usage, ) !void { - const info = dataInfo(data); + const info = dataInfo(&data); c.glBufferData(@enumToInt(b.target), info.size, info.ptr, @enumToInt(usage)); try errors.getError(); } @@ -84,10 +84,6 @@ pub const Binding = struct { ptr: *const anyopaque, } { return switch (@typeInfo(@TypeOf(data))) { - .Array => .{ - .size = @sizeOf(@TypeOf(data)), - .ptr = &data, - }, .Pointer => |ptr| switch (ptr.size) { .One => .{ .size = @sizeOf(ptr.child) * data.len,