views:

109

answers:

0

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.