const glfw = @import("zglfw");
const zopengl = @import("zopengl");
const std = @import("std");
pub fn main() !void {
try glfw.init();
defer glfw.terminate();
const window = try glfw.createWindow(600, 600, "main", null);
defer glfw.destroyWindow(window);
glfw.makeContextCurrent(window);
try zopengl.loadCoreProfile(getProcAddress, 4, 0);
const gl = zopengl.bindings;
while (!window.shouldClose()) {
glfw.pollEvents();
gl.clearColor(0.1, 0.1, 0.1, 1);
gl.clear(gl.COLOR_BUFFER_BIT);
window.swapBuffers();
}
}
fn getProcAddress(name: [*:0]const u8) callconv(.c) ?*const anyopaque {
return glfw.getProcAddress(name);
}
is giving this error
Segmentation fault at address 0x0
???:?:?: 0x0 in ??? (???)
zsh: IOT instruction (core dumped) ./zig-out/bin/opengl