Using OpenGL ES

This section is dedicated to helping you understand the concepts behind OpenGL and the OpenGL ES API. We'll explain all the key APIs, after which you'll put them to use in the next section when you develop a test harness for OpenGL ES. First we'll discuss the basics of OpenGL and then we'll show you how Android interfaces with the OpenGL ES API.

To supplement the information from this chapter, you might want to bookmark the online resources we mentioned earlier. Here they are again:

• OpenGL Programming Guide (the "red book"): http://www.glprogramming.com/red/

• Documentation for JSR 239 (Java Binding for the OpenGL ES API): http://java.sun. com/javame/reference/apis/jsr239/

• The Khronos Group's OpenGL ES Reference Manual: http://www.khronos.org/opengles/ documentation/opengles1_0/html/index.html

Note As you start using the OpenGL resources, you'll notice that some of the APIs are not available in OpenGL ES. This is where The Khronos Group's OpenGL ES Reference Manual comes in handy.

We will cover the following APIs in a fair amount of detail because they're central to understanding OpenGL and OpenGL ES:

• glVertexPointer

• glDrawElements

• glViewport

As we cover these APIs, you'll learn how to

• Use the essential OpenGL ES drawing APIs

• Clear the palette

• Specify colors

• Understand the camera and coordinates

• Interact with an Android view to draw using OpenGL ES

0 0

Post a comment