iPhone OpenGL and NSTimer issues
Posted
by Kyle
on Stack Overflow
See other posts from Stack Overflow
or by Kyle
Published on 2010-04-28T00:59:43Z
Indexed on
2010/04/28
1:03 UTC
Read the original article
Hit count: 385
I have an NSTimer that runs at 60hz. With an OpenGL scene loaded and rendering, my game can get 60fps, solid, all day long.. Then if I go and recompile the app, or reload it, it will get 40fps. Same resources loaded. I've been running into this problem for years, and I just want to know why. It's crazy, and I want to know if I should just abandon this stupid Timer. Conditions are not different on my 3GS between loads. It will just get 40fps sometimes. Obviously the clockrate is not different between loads, so the performance figures should be constant given a constant scene. Here is a log of my framerates:
A good load: :-)
FrameRate: 61 FrameRate: 61 FrameRate: 61 FrameRate: 60 FrameRate: 60 FrameRate: 61 FrameRate: 60 FrameRate: 60 FrameRate: 61 FrameRate: 60 FrameRate: 61
Now, I'll go ahead and do nothing, recompile, and run:
FrameRate: 43 FrameRate: 50 FrameRate: 45 FrameRate: 48 FrameRate: 40 FrameRate: 45 FrameRate: 42 FrameRate: 41 FrameRate: 42 FrameRate: 44 FrameRate: 41 FrameRate: 46
^- Massive difference visually. What the flying heck could cause this?
SAME area of the scene, SAME camera setup. No variables are different.
© Stack Overflow or respective owner