At the Google I/O Android Game presentation, they suggested using 3 threads for a game:
- EDT (basically leave it alone to do user input).
- Draw loop, let it run flat out.
- Game logic loop.
I did that, and I got terrible performance. So I tried a wait/notify pattern where there draw loop would wait if there was no update from the game loop. Brilliant performance!
Well, it was brilliant on Android 1.1. My phone just updated to Android 1.5, and the performance is not so good any more (not terrible, but noticeably worse).
I tried upgrading my draw loop to use the new GLSurfaceView class, and that didn’t make any difference.
My question is, what do you guys do? Do you use 3 threads? Do you let the draw loop run flat out, or use a wait/notify pattern (GLSurfaceView.RENDERMODE_WHEN_DIRTY)? Any other advice?
Thanks!