Use one of Android OpenGL ES 2.0 plotting: Build an OpenGL ES Environment

Source: Internet
Author: User

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"/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.