Android Open Source - OpenGLProject Main Activity






From Project

Back to project page OpenGLProject.

License

The source code is released under:

MIT License

If you think the Android project OpenGLProject listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.opengl2;
/*  w  w w . j  a  va2 s  .  co  m*/
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.Window;
import android.view.WindowManager;

import android.opengl.GLSurfaceView;


public class MainActivity extends Activity {

  /** The OpenGL View */
  private GLSurfaceView glSurface;
  
  /**
   * Initiate the OpenGL View and set our own
   * Renderer (@see Lesson02.java)
   */
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);    
    //Create an Instance with this Activity
    glSurface = new GLSurfaceView(this);
    //Set our own Renderer
    glSurface.setRenderer(new Render());
    //Set the GLSurface as View to this Activity
    setContentView(glSurface);
  }

  /**
   * Remember to resume the glSurface
   */
  @Override
  protected void onResume() {
    super.onResume();
    glSurface.onResume();
  }

  /**
   * Also pause the glSurface
   */
  @Override
  protected void onPause() {
    super.onPause();
    glSurface.onPause();
  }

}




Java Source Code List

com.example.opengl2.Casa.java
com.example.opengl2.Hojas.java
com.example.opengl2.MainActivity.java
com.example.opengl2.Puerta.java
com.example.opengl2.Render.java
com.example.opengl2.Square.java
com.example.opengl2.Techo.java
com.example.opengl2.Triangle.java
com.example.opengl2.Tronco.java