本文介绍了Android中SurfaceView和GLSurfaceView的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我 SurfaceView 和 GLSurfaceView 之间的基本区别是什么?什么时候应该使用 SurfaceView,什么时候应该使用 GLSurfaceView?

Can anyone tell me what the basic difference is between SurfaceView and GLSurfaceView? When should I use SurfaceView, and when should I use GLSurfaceView?

我在 Stack Overflow 上阅读了一些已经回答的问题,但它们不能满足我的查询.

I read some already answered questions on Stack Overflow, but they did not satisfy my queries.

任何帮助将不胜感激.

推荐答案

一个 GLSurfaceView 是一个 SurfaceView,您可以使用 OpenGL 进行渲染.在它们之间进行选择很简单:

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

  • 如果您熟悉 OpenGL 并需要它提供的功能,请使用 GLSurfaceView.
  • 否则,请使用 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.

这篇关于Android中SurfaceView和GLSurfaceView的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-02 21:31