Graphics Programs Reference
In-Depth Information
public void onSurfaceChanged(GL10 gl, int width, int
height) {
GLES20.glViewport(0, 0, width, height);
}
public void onDrawFrame(GL10 gl) {
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT |
GLES20.GL_DEPTH_BUFFER_BIT);
}
}
Note
In
Listing 1-4
,
you will see that the sequence of auto-gener-
ated methods for
GLES20Renderer
class is modified. This shows
the actual sequence in which these methods are called. If you closely
observe these methods, you might wonder what the purpose of
GL10
type for argument
gl
is.
GL10
is a public interface that im-
plements
GL
.
GLES20Renderer
class must implement the inher-
ited abstract methods of
GLSurfaceView.Renderer
interface,
and the methods of this interface use
GL10
type for arguments.
After removing all errors and warnings, run the application. A blank, blue colored
OpenGL surface view, similar to
Figure 1-20
, will appear.

Search WWH ::

Custom Search