Fix GL
This commit is contained in:
parent
a248749538
commit
52f35807d3
2
lib/zgl
2
lib/zgl
|
@ -1 +1 @@
|
|||
Subproject commit 32608da70ca057ec09438dbf6549834dcfbeb52c
|
||||
Subproject commit 9fc2524bbf2e1172a5cb218eca37dc99930a31db
|
2
lib/zlm
2
lib/zlm
|
@ -1 +1 @@
|
|||
Subproject commit e9da7f084055eb3fab0454ef4d5db0a103ff96df
|
||||
Subproject commit dff2959b5fff0aa7697fdf1a2843a15210aab695
|
|
@ -18,7 +18,7 @@ grid_pos_y: i32,
|
|||
pub fn init(renderer: *Renderer) Self {
|
||||
var wsize = renderer.getOutputSize();
|
||||
|
||||
const grid_cell_size = @divFloor(@minimum(wsize.width, wsize.height), 32);
|
||||
const grid_cell_size = @divFloor(@min(wsize.width, wsize.height), 32);
|
||||
const grid_pos_x = @divFloor(wsize.width, 2) - (grid_cell_size * @divFloor(Grid.ncolumns, 2));
|
||||
const grid_pos_y = @divFloor(wsize.height, 2) - (grid_cell_size * @divFloor(Grid.nrows + Grid.buffer, 2));
|
||||
return Self{
|
||||
|
|
|
@ -20,6 +20,12 @@ vbo_index: usize = 0,
|
|||
|
||||
const max_objects: usize = 16384;
|
||||
|
||||
fn glGetProcAddress(p: []const u8, proc: [:0]const u8) ?*const anyopaque {
|
||||
_ = p;
|
||||
return sdl.c.SDL_GL_GetProcAddress(@ptrCast([*c]const u8, proc));
|
||||
}
|
||||
|
||||
|
||||
pub fn init() !Self {
|
||||
try sdl.init(.{ .video = true, .audio = true, .events = true });
|
||||
|
||||
|
@ -42,6 +48,10 @@ pub fn init() !Self {
|
|||
std.debug.print("WARNING: Unable to configure the swap interval.\n", .{});
|
||||
};
|
||||
|
||||
const proc: []const u8 = undefined;
|
||||
try gl.loadExtensions(proc, glGetProcAddress);
|
||||
|
||||
|
||||
// Shader stuff
|
||||
var mvp_loc: u32 = undefined;
|
||||
//var color_loc: u32 = undefined;
|
||||
|
|
Loading…
Reference in New Issue