Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode NSTimer和V-sync如何获得超过60fps的速度_Xcode_Cocoa_Nstimer_Vsync - Fatal编程技术网

Xcode NSTimer和V-sync如何获得超过60fps的速度

Xcode NSTimer和V-sync如何获得超过60fps的速度,xcode,cocoa,nstimer,vsync,Xcode,Cocoa,Nstimer,Vsync,要在我的opengl Mac应用程序中创建mainloop,我使用的是NSTimer: [NSTimer scheduledTimerWithTimeInterval:.001 target:view selector:@selector(render:) userInfo:nil

要在我的opengl Mac应用程序中创建mainloop,我使用的是NSTimer:

  [NSTimer scheduledTimerWithTimeInterval:.001
                                 target:view
                               selector:@selector(render:)
                               userInfo:nil
                                repeats:YES];
但如果我尝试启用v-sync:

GLint vsync=0;
[[view openGLContext]  setValues:&vsync forParameter:NSOpenGLCPSwapInterval];
我的计时器会自动切换到每秒60帧的速度。它对绘图(swapbuffer、glFinish等)有好处,但我的程序中的某些过程需要更高的速度。我可以忽略定时器的vsync吗?我需要两个计时器-一个用于60 fps的绘图,第二个用于最大fps的循环。可能吗

p、 美国显示链接-不为我工作


谢谢。

您阅读了吗?是的,但是CVDisplayLink显示我的显示器出现严重错误,如果我在循环中使用vsync或调用SetNeedDisplay:Yes,则NSTimer将重置为60fps