iPhone 3GS OpenGL strange framerate bug

Posts: 7
Joined: 2009.08
Post: #1
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 from 60 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!
Quote this message in a reply
Posts: 86
Joined: 2006.08
Post: #2
The best way to work around this issue is to use CADisplayLink. You don't need to make your app 3.1 only: the OpenGL ES Application Template in Xcode provides an example of how to use CADisplayLink when the app is run on 3.1, and will use NSTimer otherwise.
Quote this message in a reply
Posts: 7
Joined: 2009.08
Post: #3
Everyone else having the same issue on iPhone 3GS? Maybe there is something wrong in my code... but... it can't be that cuz' it's working ok on any other device.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Strange OpenGl or NSBitmapImageRep error magnusrw 4 5,195 Apr 24, 2009 11:13 AM
Last Post: magnusrw
  GLUT consistant framerate? JeroMiya 2 6,189 Apr 30, 2007 02:25 AM
Last Post: OneSadCookie
  SDL Framerate Control joellevin 10 12,178 Jan 4, 2007 01:26 PM
Last Post: arekkusu
  Capping framerate unknown 18 12,678 Jul 19, 2005 04:57 AM
Last Post: unknown
  Weird framerate problem Jesse 4 4,698 Sep 1, 2003 01:01 AM
Last Post: Jesse