安卓:SurfaceView和OpenGL(GLSurfaceView)的决定 [英] Android: Deciding between SurfaceView and OpenGL (GLSurfaceView)
问题描述
有没有一种方法的基础上,在规划阶段游戏/应用程序的预期的复杂性面前决定了是否使用普通帆布画在SurfaceView或OpenGL的去吗?
Is there a way to decide up front based on the expected complexity of a game/app in the planning phase whether to use regular Canvas drawing in a SurfaceView or to go with OpenGL?
我一直在玩弄一个画布,只需要2D运动,并在一个相当新的电话我得到pretty的不俗的表现与一群原始的对象,并在一个运行在屏幕上的几个位图坚实的背景。
I've been playing around with a Canvas and only need 2D movement, and on a fairly new phone I'm getting pretty decent performance with a bunch of primitive objects and a few bitmaps running around the screen on a solid background.
是公平地说,如果我要被绘制背景图片和增加对象的数量被移动和绘制在它们上面,我应该直接去的OpenGL?
Is it fair to say that if I'm going to be drawing background images and increasing the number of objects being moved and drawn on top of them that I should go straight to OpenGL?
推荐答案
所有我能说的是,这取决于你有多少精灵要去使用。克里斯PRUETT从谷歌也证明这部分非常好。
All I can say is that it depends on how many sprites you're gonna use. Chris Pruett from Google has also documented this part very well.
下面是他的幻灯片是与你的话题之一图片:
Below is a picture from one of his slides that are related to your topic:
通过这些知识,你应该用OpenGL使用 draw_texture
扩展走。请记住,查询出字符串,并检查 draw_texture
支持在实际设备上。
With that knowledge, you should go with OpenGL using the draw_texture
extension. Remember to query out the string and check if draw_texture
is supported on the actual device.
对于那些涉及到游戏开发的一般的详细信息,请参阅<一href="http://android-developers.blogspot.com/2010/06/game-development-for-android-quick.html">this.
For further information that are related to game development in general, see this.
这篇关于安卓:SurfaceView和OpenGL(GLSurfaceView)的决定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!