mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 03:52:01 +00:00
parent
3615d437a7
commit
d0e8d06d95
@ -40,8 +40,8 @@ static CVReturn displayLinkCallback(CVDisplayLinkRef displayLink,
|
|||||||
{
|
{
|
||||||
_GLFWwindow* window = (_GLFWwindow *) userInfo;
|
_GLFWwindow* window = (_GLFWwindow *) userInfo;
|
||||||
|
|
||||||
const int setting = atomic_load(&window->context.nsgl.swapInterval);
|
const int interval = atomic_load(&window->context.nsgl.swapInterval);
|
||||||
if (setting > 0)
|
if (interval > 0)
|
||||||
{
|
{
|
||||||
[window->context.nsgl.swapIntervalCond lock];
|
[window->context.nsgl.swapIntervalCond lock];
|
||||||
window->context.nsgl.swapIntervalsPassed++;
|
window->context.nsgl.swapIntervalsPassed++;
|
||||||
@ -70,14 +70,14 @@ static void swapBuffersNSGL(_GLFWwindow* window)
|
|||||||
{
|
{
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
|
|
||||||
const int setting = atomic_load(&window->context.nsgl.swapInterval);
|
const int interval = atomic_load(&window->context.nsgl.swapInterval);
|
||||||
if (setting > 0)
|
if (interval > 0)
|
||||||
{
|
{
|
||||||
[window->context.nsgl.swapIntervalCond lock];
|
[window->context.nsgl.swapIntervalCond lock];
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
[window->context.nsgl.swapIntervalCond wait];
|
[window->context.nsgl.swapIntervalCond wait];
|
||||||
} while (window->context.nsgl.swapIntervalsPassed % setting != 0);
|
} while (window->context.nsgl.swapIntervalsPassed % interval != 0);
|
||||||
window->context.nsgl.swapIntervalsPassed = 0;
|
window->context.nsgl.swapIntervalsPassed = 0;
|
||||||
[window->context.nsgl.swapIntervalCond unlock];
|
[window->context.nsgl.swapIntervalCond unlock];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user