I am making this game using open gl es 2.0 on android using c/c++ (NDK)
As the most imp thing in game I laid out two schemes for the game loop!
Scheme 1 serial scheme:
step a. Game reads input and updates states and physics
step b. After step a is complete it draws the graphics using the data set in step a
scheme 2 parallel scheme:
step a. A thread (Thread A) keeps reading input and updating game state and physics continuosly
step b. Another thread (Thread B) draws from data generated by thread A using the open GL draw calls (at a maximum of set fps)
Problems Scheme 1:
The problem with scheme 1 is that I dont know what will happen in the case when there are lot of objects in the scene and hence the actual draw operation in the GPU (not the GL api calls) takes longer than desired frame time (say 1/60 seconds).
Since most openGL Api calls return immediately this may lead to the illusion that next frame can be drawn while actually the last frame draw will still be in progress while the loop issues next frame draw calls.
As such the draw calls will stack up and might reach a limit. What happens at that limit? will it block further api calls or just drop the calls or something else?
Scheme 2:
In scheme 2 the problem is similar . while you issue the draw calls you'll have to put the input/update thread to sleep so that the game state does not changes in the middle of a draw. So again when your draw operation is longer than the calculated frame delay how will you implement the frame drop since the draw calls will return immediately?
EDIT: There are lots of "may" "should" and "most" on this official page as such how can one be sure of anything?
It looks like openGL specification has no platform or implementation independent guidelines on how to make use of parallel processing or threading for synchronization at all! How can they miss it ?