nsopengl

Draw from a separate thread with NSOpenGLLayer

此生再无相见时 提交于 2019-12-04 13:49:03
问题 I'm working on an app which needs to draw with OpengGL at a refresh rate at least equal to the refresh rate of the monitor. And I need to perform the drawing in a separate thread so that drawing is never locked by intense UI actions. Actually I'm using a NSOpenGLView in combination with CVDisplayLink and I'm able to achive 60-80FPS without any problem. Since I need also to display some cocoa controls on top of this view I tried to subclass NSOpenGLView and make it layer-backed, following

Draw from a separate thread with NSOpenGLLayer

帅比萌擦擦* 提交于 2019-12-03 08:48:09
I'm working on an app which needs to draw with OpengGL at a refresh rate at least equal to the refresh rate of the monitor. And I need to perform the drawing in a separate thread so that drawing is never locked by intense UI actions. Actually I'm using a NSOpenGLView in combination with CVDisplayLink and I'm able to achive 60-80FPS without any problem. Since I need also to display some cocoa controls on top of this view I tried to subclass NSOpenGLView and make it layer-backed, following LayerBackedOpenGLView Apple example. The result isn't satisfactory and I get a lot of artifacts. Therefore