// 检测系统是否支持 OpenGL ES 2.0
final ActivityManager activityManager = (ActivityManager) getSystemService(Context. ACTIVITY_SERVICE);
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;
if (supportsEs2)
{
mGLSurfaceView.setEGLContextClientVersion(2);
mGLSurfaceView.setRenderer(new LessonOneRenderer());
}
else
{
return;
}
setContentView(mGLSurfaceView);
}