Code example for GLSurfaceView

Methods: requestFocus, setEGLContextClientVersion, setFocusable, setOnTouchListener, setRenderer

0
		 * OpenGL ES が 2.0 以上であるか調べて 
		 * 2.0以上ならば、それに対応したレンダラーを使用する 
		 */ 
		ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
        ConfigurationInfo info = am.getDeviceConfigurationInfo();
		glSurfaceView = new GLSurfaceView(this);
		if( info.reqGlEsVersion >= 0x20000){
			glSurfaceView.setEGLContextClientVersion(2);
			ES20Renderer renderer = new ES20Renderer(this);
			glSurfaceView.setRenderer(renderer);
			simulator = new Simulator(renderer);
		}else{ 
			ES11Renderer renderer = new ES11Renderer( this);
			glSurfaceView.setRenderer(renderer);
			simulator = new Simulator(renderer);
		}	 
		glSurfaceView.setOnTouchListener(this);
		glSurfaceView.setFocusable(true);
		glSurfaceView.requestFocus();
		setContentView(glSurfaceView);
	} 
 
    @Override 
    protected void onResume() {