Code example for GLSurfaceView

Methods: setEGLContextClientVersion, setOnTouchListener, setRenderer

0
        
        _topText = new TextView(this);
        _topText.setTextSize(14f);
        _topText.setText("Top Text");
         
        _surfaceView = new GLSurfaceView(this);
        _surfaceView.setEGLContextClientVersion(2);
         
        _bottomText = new TextView(this);
        _bottomText.setTextSize(10f);
        _bottomText .setText("Bottom Text");
         
        _layout = new LinearLayout(this);
        _layout.setOrientation(LinearLayout.VERTICAL);
        _layout.addView(_topText, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
        _layout.addView(_surfaceView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, 1f));
        _layout.addView(_bottomText, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
        setContentView(_layout);
         
        _renderer = new RajRenderer(this);
		_renderer.setSurfaceView(_surfaceView);
		_surfaceView.setRenderer(_renderer);
		 
		_surfaceView.setOnTouchListener(this);
    } 
     
    @Override 
    protected void onResume() { 
    	super.onResume();