Drawing 2D Graphics and applying transforms with the OpenGL ES 1.x API

This recipe covers 2D drawing in OpenGL ES 1.x by example. In order to draw 2D objects, we'll also describe the OpenGL rendering display through GLSurfaceView, adding colors to them, and transformation.

Getting ready

Readers are recommended to read the introduction of this chapter, which is essential to understand some of the content in this recipe.

How to do it...

The following steps create our sample Android NDK project:

  1. Create an Android application named TwoDG1. Set the package name as cookbook.chapter4.gl1x. Please refer to the Loading native libraries and registering native methods recipe in Chapter 2, Java Native Interface, if you want more detailed instructions.
  2. Right-click ...

Get Android Native Development Kit Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.