开发者

Does "drag and drop" become faster under OpenGL ES vs. Canvas for Android?

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 impr开发者_如何学运维oved if I were to move to OpenGL ES? Not wanting to rip out my code if it doesn't.


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...


OpenGL is slower on the phones with a software acceleration (e.g. without hardware acceleration). So... :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜