package edu.cs4730.opengl30pyramid; import android.app.Activity; import android.app.ActivityManager; import android.content.Context; import android.content.pm.ConfigurationInfo; import android.os.Bundle; import android.util.Log; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (detectOpenGLES30()) { //so we know it a opengl 3.0 and use our extended GLsurfaceview. setContentView(new myGlSurfaceView(this)); } else { // This is where you could create an OpenGL ES 2.0 and/or 1.x compatible // renderer if you wanted to support both ES 1 and ES 2. Log.e("openglcube", "OpenGL ES 3.0 not supported on device. Exiting..."); finish(); } } private boolean detectOpenGLES30() { ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); ConfigurationInfo info = am.getDeviceConfigurationInfo(); return (info.reqGlEsVersion >= 0x30000); } }