iPhone 3GS OpenGL 奇怪的 bug
我正在使用 OpenGL ES 1.1 为 iPhone 和 iPod Touch 开发 2D 游戏。在 iPhone、iPhone 3G 和所有 iPod Touch 型号上一切正常。游戏通常以约 60 FPS 的速度渲染场景。
iPhone 3GS 上也会出现这种情况,但有时(完全随机)3GS 会将帧速率降至 40 FPS 左右,并且动画看起来不稳定。如果用户锁定手机并将其从睡眠模式恢复,也会发生这种情况。
我认为这与 NSTimer 有关,因为如果我将绘制触发模式更改为 SDK 3.1+ 中提供的新 CADisplayLink 类,则在所有设备上一切正常......在 3GS 上也是如此。
我不知道如何解决这个问题,并且我不想发布带有 3.1+ 限制的应用程序。仍然有很多用户使用 3.0 设备。
iPhone 3GS 上有人也遇到这个问题吗?如果是这样,请帮助我找到解决方法。
谢谢你!
I am developing a 2D game for the iPhone and iPod Touch using OpenGL ES 1.1. Everything works ok on the iPhone, iPhone 3G and all iPod Touch models. The game usually renders the scenes at ~60 FPS.
This happens on the iPhone 3GS also, but sometimes (it's completely random) the 3GS drops the framerate to around 40 FPS and the animation seems choppy. This also happens if the user locks the phone and resumes it from sleep mode.
I think it has someting to do with the NSTimer because if I change the draw trigger mode to the new CADisplayLink class available from SDK 3.1+, everything is OK on all devices... and on the 3GS too.
I don't know how to solve this issue and I don't want to post my app with the 3.1+ restriction. There are still a lot of users out there with 3.0 devices.
Anyone having this issue with the iPhone 3GS too? If so, please help me with a workaround.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用这两个库并在 3.0 或 3.1 设备上获得最佳结果。
这很好,因为 AppStore 使用的 iPhone 操作系统最低版本包含在应用程序的 Info.plist 文件中。
iPhone OS 版本可使用 Apple 的 UI 设备类参考:
但是,您还应该确保将 Xcode 中的部署目标设置为 3.0 或您希望运行的任何最低版本。
You can use both libraries and get the best result on either 3.0 or 3.1 devices.
This would be fine since the iPhone OS minimum version that the AppStore uses is contained in your application's Info.plist file.
The iPhone OS version is retreivable using the following code from Apple's UI Device Class Reference:
However you should also make sure you set your deployment target in Xcode to 3.0 or whatever minimum version you wish to run on.