首页 > 解决方案 > Turn off framerate on metal api for ios

问题描述

I have an app that only needs to refresh the draw when panning on the screen is detected. For that reason I don't do the rendering in the drawInMTKView method, instead I have a method that is triggered when panning is detected and I do the required encoding there. How can I turn off the framerate (and with it the automatic calls on drawInMTKView)?

标签: metalmetalkit

解决方案


您仍然可以drawInMTKView:通过将视图pausedenableSetNeedsDisplay属性都设置为true. 然后,每当您setNeedsDisplay在视图上调用该方法时,draw 方法将作为普通显示更新循环的一部分被调用。


推荐阅读