iphone basic game loop

Posted by Mrigank Gupta on Stack Overflow See other posts from Stack Overflow or by Mrigank Gupta
Published on 2010-03-21T04:44:35Z Indexed on 2010/03/21 4:51 UTC
Read the original article Hit count: 729

Filed under:
|
|

I am little confused with my Opengl game loop. as I am skipping touch events some times. My game loop is some thing like this.. I have ScreenManager which draw and update all game screens who so ever has control.In update I am checking input of all screen also. if input state changes, then whichever screen has control, consume touches.

                      EaglView 
                   draw       update
                    |           |
       ScreenManager.draw   ScreenManager.update  -> handle input
   stack       ___________          ___________              
     of        ___________          ___________
   screen      ___________          ___________         

Problem comes..

I am changing input state as touch begun and end methods called. but sometimes In my game loop both touchbegun/end methods get called between two updates and I am missing events. I guess approach is not good. can you guys share your approach to this problem.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about touch