Simple Android OpenGL App Lag

Posted by Eugene on Stack Overflow See other posts from Stack Overflow or by Eugene
Published on 2010-12-31T03:50:21Z Indexed on 2010/12/31 3:54 UTC
Read the original article Hit count: 326

Filed under:
|

Hi,

I have an Android OpenGL application which simply draws 2D squares (using 2 triangles) and animates them moving down the screen. I essentially do this by running: glLoadIdentity(), then glTranslatef, and finally glDrawElements all in a for loop. (The for loop is to draw all 10 blocks on the screen for every frame). In every drawFrame, the y-position of the blocks increments for the animation.

The problem I'm having is strange. I run the application and the animation is laggy and not smooth. Then I re-run the application and I get a smooth animation. If I run again, I may get a smooth animation, or possibly not. Is my method correct, or is there a better way of doing this animation? Thanks for the help!

© Stack Overflow or respective owner

Related posts about android

Related posts about opengl-es