mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
output loaded OpenGL version
This commit is contained in:
12
src/App.zig
12
src/App.zig
@ -34,11 +34,17 @@ pub fn init(alloc: std.mem.Allocator) !App {
|
|||||||
try glfw.swapInterval(1);
|
try glfw.swapInterval(1);
|
||||||
|
|
||||||
// Load OpenGL bindings
|
// Load OpenGL bindings
|
||||||
if (gl.c.gladLoadGL(
|
const version = gl.c.gladLoadGL(@ptrCast(
|
||||||
@ptrCast(fn ([*c]const u8) callconv(.C) ?fn () callconv(.C) void, glfw.getProcAddress),
|
fn ([*c]const u8) callconv(.C) ?fn () callconv(.C) void,
|
||||||
) == 0) {
|
glfw.getProcAddress,
|
||||||
|
));
|
||||||
|
if (version == 0) {
|
||||||
return error.OpenGLInitFailed;
|
return error.OpenGLInitFailed;
|
||||||
}
|
}
|
||||||
|
log.info("loaded OpenGL {}.{}", .{
|
||||||
|
gl.c.GLAD_VERSION_MAJOR(@intCast(c_uint, version)),
|
||||||
|
gl.c.GLAD_VERSION_MINOR(@intCast(c_uint, version)),
|
||||||
|
});
|
||||||
|
|
||||||
// Blending for text
|
// Blending for text
|
||||||
gl.c.glEnable(gl.c.GL_CULL_FACE);
|
gl.c.glEnable(gl.c.GL_CULL_FACE);
|
||||||
|
Reference in New Issue
Block a user