在Android中SurfaceView和GLSurfaceView的区别区别、Android、SurfaceView、GLSurfaceView

2023-09-06 02:51:27 作者:积极废人

谁能告诉我什么是SurfaceView和GLSurfaceView之间的基本区别。当使用SurfaceView,何时使用GLSurfaceView?

Can anyone tell me what is the basic difference between SurfaceView and GLSurfaceView. When to use SurfaceView and when to use GLSurfaceView?

我读了一些在计算器已经回答问题,但并不能满足我的查询。

I read some already answered questions in stackoverflow but did not satisfy my queries.

任何帮助将是AP preciated。

Any help would be appreciated.

推荐答案

A GLSurfaceView SurfaceView 你可以呈现与OpenGL的。它们之间的选择很简单:

A GLSurfaceView is a SurfaceView that you can render into with OpenGL. Choosing between them is simple:

如果您熟悉OpenGL和需要的东西提供,使用 GLSurfaceView 。 否则,使用 SurfaceView 。 If you're familiar with OpenGL and need what it provides, use a GLSurfaceView. Otherwise, use a SurfaceView.

OpenGL是低层次的。如果您还不熟悉它,这是一个承诺学习。如果你只需要2D绘图, SurfaceView 采用了高层次的,合理的高性能的画布。这是非常容易使用。

OpenGL is low-level. If you're not already familiar with it, it's an undertaking to learn. If you only need 2D drawing, SurfaceView uses the high-level, reasonably high-performance Canvas. It's very easy to work with.

除非你有一个强有力的理由来使用 GLSurfaceView ,你应该使用普通的 SurfaceView 。我建议,如果你还不知道,你需要GL,那么你可能不知道。

Unless you have a strong reason to use a GLSurfaceView, you should use a regular SurfaceView. I would suggest that if you don't already know that you need GL, then you probably don't.