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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access