OpenGLTest HarnessActivityjava

OpenGLTestHarnessActvity is a driver class for the test harness. This is a simple Android activity that uses an implementation of the SurfaceView (OpenGLTestHarness) as its content view (see Listing 10-6).

Listing 10-6. Code for the OpenGLTestHarnessActivity Class

// filename: public class OpenGLTestHarnessActivity extends Activity { private OpenGLTestHarness mTestHarness;

^Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

mTestHarness = new OpenGLTestHarness(this); mTestHarness.setRenderer(new SimpleTriangleRenderer(this)); setContentView(mTestHarness);

^Override protected void onResume() { super.onResume(); mTestHarness.onResume();

^Override protected void onPause() { super.onPause(); mTestHarness.onPause();

As you come up with new OpenGL renderers, all you have to do is instantiate an

OpenGLTestHarness and set it into this activity as a renderable view.

0 0

Post a comment