Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 CGRectMake 将矩形结构提供给图像(图像 drawInRect:rect)。问题是,这个矩形的位置和大小会动态改变。每个“游戏循环帧”调用 CGRectMake 是否会影响性能?
谢谢!
如果你看一下CGRectMake的定义(在Xcode中控制点击函数名并选择“跳转到定义”),你会看到它是一个内联函数。 因此,如果您更改结构的所有字段,您不会失去任何性能。 如果您只修改一些字段,我会“手动”进行。