To use OpenGL ES to draw images in Android applications, you must create a view as a container. The more direct method is to derive an implementation class from GLSurfaceView and GLSurfaceView. Renderer. GLSurfaceView is a container drawn using OpenGL. GLSurfaceView. Renderer is used to control the drawing action. For more information about these classes, see the OpenGL ES developer guide.
Using GLSurfaceView is almost the only way to integrate OpenGL ES into your application. A full screen or near-Screen Image view is a reasonable choice. If developers only want to use OpenGL ES to draw a small part of a layout, they should consider using TextureView. If you think you are a "Daniel", you can use SurfaceView to create an OpenGL ES view. However, you need to write a considerable amount of additional code.
This section describes how to implement the smallest GLSurfaceView and GLSurfaceView. Renderer in a simple application activity.
I. Declare the use of OpenGL ES in the Manifest File
To use the OpenGL ES 2.0 API, you must add the following statement to the manifest file:
[Html]
<Uses-feature android: glsversion = "0x00020000" android: required = "true"/>
<Uses-feature android: glEsVersion = "0x00020000" android: required = "true"/> if your application requires texture compression, it also states the compression formats that the device needs to support:
[Html]
<Supports-gl-texture android: name = "GL_OES_compressed_ETC1_RGB8_texture"/>
<Supports-gl-texture android: name = "GL_OES_compressed_paletted_texture"/>
<Supports-gl-texture android: name = "GL_OES_compressed_ETC1_RGB8_texture"/>
<Supports-gl-texture android: name = "GL_OES_compressed_paletted_texture"/>