Graphics Programs Reference
In-Depth Information
Creating the OpenGL Surface
Once you create a new Android application (
Figure 1-14
)
, open the
Main.java
file. Replace the contents of this file with the code given in
Listing 1-3
.
Table 1-1
gives the description of lines in this code.
Figure 1-14
.
Creating new Android application for OpenGL surface view application
Listing 1-3.
GL SURFACE/src/com/apress/android/glsurface/Main.java
public class Main extends Activity {
private GLSurfaceView _surfaceView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
_surfaceView = new GLSurfaceView(this);
_surfaceView.setEGLContextClientVersion(2);
_surfaceView.setRenderer(new GLES20Renderer());

Search WWH ::

Custom Search