mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
Merge pull request #1123 from mitchellh/opengl-version
renderer/opengl: error if OpenGL version is too old
This commit is contained in:
@ -412,11 +412,16 @@ pub fn surfaceInit(surface: *apprt.Surface) !void {
|
|||||||
apprt.gtk => {
|
apprt.gtk => {
|
||||||
// GTK uses global OpenGL context so we load from null.
|
// GTK uses global OpenGL context so we load from null.
|
||||||
const version = try gl.glad.load(null);
|
const version = try gl.glad.load(null);
|
||||||
|
const major = gl.glad.versionMajor(@intCast(version));
|
||||||
|
const minor = gl.glad.versionMinor(@intCast(version));
|
||||||
errdefer gl.glad.unload();
|
errdefer gl.glad.unload();
|
||||||
log.info("loaded OpenGL {}.{}", .{
|
log.info("loaded OpenGL {}.{}", .{ major, minor });
|
||||||
gl.glad.versionMajor(@intCast(version)),
|
|
||||||
gl.glad.versionMinor(@intCast(version)),
|
// We require at least OpenGL 3.3
|
||||||
});
|
if (major < 3 or minor < 3) {
|
||||||
|
log.warn("OpenGL version is too old. Ghostty requires OpenGL 3.3", .{});
|
||||||
|
return error.OpenGLOutdated;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
apprt.glfw => try self.threadEnter(surface),
|
apprt.glfw => try self.threadEnter(surface),
|
||||||
|
Reference in New Issue
Block a user