mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 07:34:35 +00:00
parent
82ca58da04
commit
3615d437a7
@ -37,7 +37,7 @@
|
|||||||
typedef struct _GLFWcontextNSGL
|
typedef struct _GLFWcontextNSGL
|
||||||
{
|
{
|
||||||
id pixelFormat;
|
id pixelFormat;
|
||||||
id object;
|
id object;
|
||||||
CVDisplayLinkRef displayLink;
|
CVDisplayLinkRef displayLink;
|
||||||
atomic_int swapInterval;
|
atomic_int swapInterval;
|
||||||
int swapIntervalsPassed;
|
int swapIntervalsPassed;
|
||||||
|
@ -38,18 +38,18 @@ static CVReturn displayLinkCallback(CVDisplayLinkRef displayLink,
|
|||||||
CVOptionFlags* flagsOut,
|
CVOptionFlags* flagsOut,
|
||||||
void* userInfo)
|
void* userInfo)
|
||||||
{
|
{
|
||||||
_GLFWwindow* window = (_GLFWwindow *) userInfo;
|
_GLFWwindow* window = (_GLFWwindow *) userInfo;
|
||||||
|
|
||||||
const int setting = atomic_load(&window->context.nsgl.swapInterval);
|
const int setting = atomic_load(&window->context.nsgl.swapInterval);
|
||||||
if (setting > 0)
|
if (setting > 0)
|
||||||
{
|
{
|
||||||
[window->context.nsgl.swapIntervalCond lock];
|
[window->context.nsgl.swapIntervalCond lock];
|
||||||
window->context.nsgl.swapIntervalsPassed++;
|
window->context.nsgl.swapIntervalsPassed++;
|
||||||
[window->context.nsgl.swapIntervalCond signal];
|
[window->context.nsgl.swapIntervalCond signal];
|
||||||
[window->context.nsgl.swapIntervalCond unlock];
|
[window->context.nsgl.swapIntervalCond unlock];
|
||||||
}
|
}
|
||||||
|
|
||||||
return kCVReturnSuccess;
|
return kCVReturnSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void makeContextCurrentNSGL(_GLFWwindow* window)
|
static void makeContextCurrentNSGL(_GLFWwindow* window)
|
||||||
|
Loading…
Reference in New Issue
Block a user