I’m still having trouble getting a really stable smooth framerate on Android devices and I wondered if anyone has got it right? I’m using Android 1.5 with OpenGLES. I use two threads - logic thread and render thread (part of GLSurfaceView). I render with RENDER_ON_DIRTY. Essentially logic loop is:
- calculateWhenTheFrameShouldEnd
- doLogic
- requestRender
- waitTilTheFrameShouldEnd
Render, doesn’t do anything exciting, just splatting a few quads to the screen.
While this runs pretty smoothly it still glitches regularly. I’ve observed this behavior in any GL based animation game that I’ve tried (including the ones here). They run ok, but it doesn’t feel really smooth. To illustrate I knocked a silly game together the last few nights:
http://www.cokeandcode.com/applets/defend/tapattack.png
Applet: http://www.cokeandcode.com/applets/defend/
Android: http://www.cokeandcode.com/applets/defend/defend-2.apk
While it’s just about playable (from a game play point of view) the jitters are still fairly evident. The game creates zero garbage outside of the Android SDK and the logic going is really pretty simple.
Bit confused, not sure why it should be bad, has anyone got a simple example of something that runs really smoothly on the handset and uses GL?
Kev