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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.