mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
renderer/opengl: add comment explaning ogl lock on darwin
This commit is contained in:
@ -2030,6 +2030,12 @@ pub fn drawFrame(self: *OpenGL, surface: *apprt.Surface) !void {
|
||||
}
|
||||
}
|
||||
|
||||
// In the "OpenGL Programming Guide for Mac" it explains that: "When you
|
||||
// use an NSOpenGLView object with OpenGL calls that are issued from a
|
||||
// thread other than the main one, you must set up mutex locking."
|
||||
// This locks the context and avoids crashes that can happen due to
|
||||
// races with the underlying Metal layer that Apple is using to
|
||||
// implement OpenGL.
|
||||
const is_darwin = builtin.target.isDarwin();
|
||||
const ogl = if (comptime is_darwin) @cImport({
|
||||
@cInclude("OpenGL/OpenGL.h");
|
||||
|
Reference in New Issue
Block a user