I found the problem. I have an OC droid and SetCPU was set to "on demand". The app must have been on the edge of CPU use so SetCPU was speeding up/ slowing down the CPU randomly. If I set SetCPU to performance than the animation is 100% smooth. That's also probably why touching the screen and moving my finger caused it to run smooth - it forced it to use more CPU cycles. I think that shows how fast OpenGL is! It was fast enough to not use enough CPU when only doing one textured quad.
-niko On May 21, 5:34 pm, niko20 <nikolatesl...@yahoo.com> wrote: > Hi > > I've been experimenting with the NDK san-angeles example in android- > ndk-r5b for doingOpenGL. However, I've trimmed out all code in the > sample and instead changed it to simply display one texture mapped > cube that rotates (to learnOpenGLES). > > I have aOpenGL"window" of 480x320. I do a simple glClearColor, and > then draw a textured quad using a triangle strip and Vertex Arrays. I > also have a texture array too of course. The texture is Alpha-blended > so I can mask the image out. I then rotate the quad in the Render > loop. > > I've noticed on my original Droid the quad sort of "stutters" in the > sense that it will start out rotating normally, and then slow down a > bit, speed up, slow down, and just act weird. > > I thought this was possibly a artifact of the frame rate changing a > lot, so I rearranged my code to average the frame rate and adjust the > rotation of the quad based on real time. > > However, on the Droid this doesn't seem to make any difference. It > still randomly "slows down". The other strange thing is I can smooth > it out by simply touching the screen and "rubbing" my finger on it > back and forth. As long as I'm rubbing the screen the animation is > nice and smooth. It's weird like some sort of thread priority thing or > something. > > I also tested the same exact APK on a Motorola XOOM and on a Samsung > Galaxy Tablet, and they do not exhibit this behavoir. The quad rotates > nice a smooth continously and without and lag/stutter. > > Does anybody have any tips or ideas of what may be causing this to > occur? > > The slowdown happens even when I disable the texture and only display > the quad (as a white quad). > > I've uploaded the code I used to test this if anyone had the time to > check it out: > > https://rapidshare.com/files/488012630/san-angeles.zip > > Thanks! > > -niko -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en