metal - 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)?
解决方案
您仍然可以drawInMTKView:
通过将视图paused
和enableSetNeedsDisplay
属性都设置为true
. 然后,每当您setNeedsDisplay
在视图上调用该方法时,draw 方法将作为普通显示更新循环的一部分被调用。
推荐阅读
- c# - 我想在不运行控制台应用程序的情况下获取存储在使用 Apache ignite 创建的缓存中的数据
- c++ - cv::rotate 似乎没有效果
- python - 纸浆找不到解决办法
- appkit - 在 NSStackView 中对齐控件
- android - 无法连接到配对的蓝牙设备
- html - 在 Urql clint 中打开 ssr 时,我收到以下错误: 没想到服务器 HTML包含
- python-3.x - 来自预先计算的统计数据的箱线图不显示框
- unity3d - Unity 2D 物理材料 2D 问题弹性
- typescript - 打字稿从不输入条件
- selenium - jmeter webdriver没有拾取vars值