package toyo.jungle.magicdoodoo;
import android.app.Activity;
import android.content.Intent;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.view.View;

public class MyGLActivity extends Activity {
   
   private GLSurfaceView glView;   				// use GLSurfaceView

   // Call back when the activity is started, to initialize the view
   @Override
   protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      glView = new GLSurfaceView(this);           // Allocate a GLSurfaceView
      glView.setRenderer(new MyGLRenderer(this)); // Use a custom renderer
      this.setContentView(glView);                // This activity sets to GLSurfaceView
      glView.setOnClickListener(new View.OnClickListener() { //open a second activity on click of GLSurfaceView

      @Override
      public void onClick(View v) {

          Intent i = new Intent(MyGLActivity.this,MainActivity.class);
          startActivity(i);
      }
  });
           
/*      Button gl = new Button(this);
		this.addContentView(gl, new LayoutParams(
				LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
		gl.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {

                Intent i = new Intent(getApplicationContext(),MagicForestActivity.class);
                startActivity(i);
            }
        });*/
	}
   
   // Call back when the activity is going into the background
   @Override
   protected void onPause() {
      super.onPause();
      glView.onPause();
   }
   
   // Call back after onPause()
   @Override
   protected void onResume() {
      super.onResume();
      glView.onResume();
   }
}
