mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
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.
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user