Pular para o conteúdo

Mais visitados

Visitados recentemente

navigation

Displaying Graphics with OpenGL ES

Dependencies and prerequisites

  • Android 2.2 (API Level 8) or higher
  • Experience building an Android app

You should also read

Try it out

Download the sample

OpenGLES.zip

The Android framework provides plenty of standard tools for creating attractive, functional graphical user interfaces. However, if you want more control of what your application draws on screen, or are venturing into three dimensional graphics, you need to use a different tool. The OpenGL ES APIs provided by the Android framework offers a set of tools for displaying high-end, animated graphics that are limited only by your imagination and can also benefit from the acceleration of graphics processing units (GPUs) provided on many Android devices.

This class walks you through the basics of developing applications that use OpenGL, including setup, drawing objects, moving drawn elements and responding to touch input.

The example code in this class uses the OpenGL ES 2.0 APIs, which is the recommended API version to use with current Android devices. For more information about versions of OpenGL ES, see the OpenGL developer guide.

Note: Be careful not to mix OpenGL ES 1.x API calls with OpenGL ES 2.0 methods! The two APIs are not interchangeable and trying to use them together only results in frustration and sadness.

Lessons

Building an OpenGL ES Environment
Learn how to set up an Android application to be able to draw OpenGL graphics.
Defining Shapes
Learn how to define shapes and why you need to know about faces and winding.
Drawing Shapes
Learn how to draw OpenGL shapes in your application.
Applying Projection and Camera Views
Learn how to use projection and camera views to get a new perspective on your drawn objects.
Adding Motion
Learn how to do basic movement and animation of drawn objects with OpenGL.
Responding to Touch Events
Learn how to do basic interaction with OpenGL graphics.

Additional sample code

To download NDK samples, see NDK Samples.

Este site usa cookies para armazenar suas preferências quanto às opções de idioma e exibição específicas ao site.

Receba as dicas e notícias mais recentes para desenvolvedores Android que ajudarão você a ter sucesso no Google Play.

* Campos obrigatórios

Uhu!

Siga o Google Developers no WeChat

Navegar neste site em ?

Você solicitou uma página em , mas sua preferência de idioma para este site está definida como .

Quer alterar sua preferência de idioma e navegar neste site em ? Para alterar a preferência de idioma depois, use o menu de idiomas na parte inferior de cada página.

É preciso ter o nível de API ou superior para esta aula

Este documento está oculto porque o nível de API selecionado para a documentação é o . Para alterar o nível, clique no seletor acima da barra de navegação esquerda.

Para mais informações sobre como especificar o nível de API que o seu app precisa, leia o artigo Compatibilidade com diferentes versões de plataforma.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)