I have an IOS game that uses the accelorometer. My game renders at a good rate, 60 fps, but my input from the accelerometer is lagged. For example, after I tilt the game to the left, it takes a second before the game responds. The same occurs for Touch Events, the lag is about a second at times.
My game's render loop looks like this:
procedure RenderFrame
switch to "SpaceShips" texture
for each bad guy
update his location
render to OpenGLES
end loop
update good guy location
render him to OpenGLES
switch to "Particles" texture
for each particle
update the location
render to OpenGLES
end loop
end RenderFrame
To me this sounds similar to this question:
OpenGL ES 2.0 iPhone - Rendering on background thread block main thread
Does this sound like my main thread is blocked and I would benefit from concurrency? Can I remove the block on the main thread simply by moving that entire method off to another background thread, or do I have to do a more granular rewrite of the method above to achieve concurrency? I would like to do the minimal amount of concurrency to relieve the block on the main thread if possible.