O'Reilly logo

OpenGL ES 2 for Android by Kevin Brothaler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Initializing OpenGL

Our next step is to go ahead and initialize OpenGL by using a special class called GLSurfaceView. GLSurfaceView takes care of the grittier aspects of OpenGL initialization, such as configuring the display and rendering on a background thread. This rendering is done on a special area of the display, called a surface; this is also sometimes referred to as a viewport.

The GLSurfaceView class also makes it easy to handle the standard Android activity life cycle. In Android, activities can be created and destroyed, and they are also paused and resumed when the user switches to another activity and later returns. In accordance with this life cycle, we need to release OpenGL’s resources when our activity is paused. GLSurfaceView ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required