Reputation: 105
I am using Canvas for basic 2D graphics in an Android app. I am implementing a drag and drop feature (just setting x/y coordinates of the sprite based on x/y coordinates of the touch event). It works fine, but when testing on my Android device, there can be a slight lag if I move my finger very fast on the screen. The bitmap just isn't keeping up with the touch/drag motion if done quickly.
Would this be improved if I were to move to OpenGL ES? Not wanting to rip out my code if it doesn't.
Upvotes: 1
Views: 1079
Reputation: 41749
OpenGL is slower on the phones with a software acceleration (e.g. without hardware acceleration). So... :)
Upvotes: 0
Reputation: 57672
This depends basically on the way you implement your drag&drop. A SurfaceView can be fast and there is no need for switching to OpenGL ES just to show 2D...
Find out what causes the lag. If the lag is caused by the touch events aren't fired often enough to be "lag free" that even OpenGL wont help...
Upvotes: 3