I made a similar post about this in the past and am revisiting the project after a hiatus.
I have a really simple android application demo using SDLActivity. I’m rendering a square using OpenGL onto the application window. The position of the square is updated each frame based on the user’s touch input. I see some occasional jitter that looks like dropped frames or lag. I think the source of this issue is that some frames don’t have any touch data events or that some frames have multiple touch inputs data events. I render the position data received from the last touch event each frame. The application is using vsync and I am looping in a busy-loop, rendering at the end of each iteration after draining all events.
My native source code is here:
The android-studio project dir is here:
Has anyone else noticed this in their own projects or is it just me?
If anyone’s willing to try out the APK on their device, do you see the same issue? I am testing on a Nexus 4. If you don’t trust the APK, the sources are all there in the AS project dir and the gist. I do not have another Android device to test this with.
If this isn’t a device-specific problem, does anyone know how to fix the jitter? I’ve tried to recreate a similar application (draw a square pinned to touch input position) using just the Android SDK framework stuff and I don’t see any lag / stuttering.