ios - Is there frame rate limit on the iPhone? -
i test, setup opengl game's update() , render() functions in while loop on separate nsthread. runs @ 60fps. how possible? it's want actually, why doing that? thought nsthread run fast could...? seems v-synced.
func setupgl(){ glthread = nsthread(target: self, selector: "glrun", object: nil); glthread.start(); } func glrun(){ //start , run opengl on separate thread setuplayer(); setupcontext(); setuprenderbuffer(); //setupdepthbuffer(); setupframebuffer(); engine.setupengine(glfloat(self.frame.size.width) * glfloat(scale), screenheight: glfloat(self.frame.size.height) * glfloat(scale)); //setupdisplaylink(); print("thread started!"); while(true){ update() render(); logger.logframe(); } }
it's because ios reduces usage of hardware reasonable levels. truth not need more 60fps because screen not refresh faster, frame rate limited. in way battery life extended.
your use of nsthread
not matter in case because limits in opengl layer.
you can control frame rate setting cadisplaylink
, it's frameinterval
value.
Comments
Post a Comment