title: GL version of GLsurfaceview
body: <p>I need GLSurfaceView to render something, here is something that make me confusing:
  I call the setEGLContextClientVersion(2) at first, but in the onSurfaceCreated(), I call the gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST), only to get a glError, as follow:</p>
  
  <p>here is the code:</p>
  
  <pre><code>public void onSurfaceCreated(GL10 gl, EGLConfig config) {
  
      gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);
  
      gl.glClearColor(0.5f, 0.5f, 0.5f, 1);
      gl.glShadeModel(GL10.GL_FLAT);
      gl.glDisable(GL10.GL_DEPTH_TEST);
      gl.glEnable(GL10.GL_TEXTURE_2D);
      gl.glDisable(GL10.GL_DITHER);
      gl.glDisable(GL10.GL_LIGHTING);
  
      gl.glEnable(GL10.GL_TEXTURE_2D);
      gl.glGenTextures(1, mTextureNameWorkspace, 0);
  
      int textureName = mTextureNameWorkspace[0];
      gl.glBindTexture(GL10.GL_TEXTURE_2D, textureName);
  
      gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);
      gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
  
      gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
      gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);
  
      gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_REPLACE);
  
      final int internalFormat = GL10.GL_RGBA;
      final int type = GL10.GL_UNSIGNED_BYTE;
      gl.glTexImage2D(GL11.GL_TEXTURE_2D, 0, internalFormat, mCameraPreviewSprite.textureWidth, mCameraPreviewSprite.textureHeight, 0, internalFormat, type, (ByteBuffer) null);
  
      mCameraPreviewSprite.setTextureName(textureName);
  }
  </code></pre>
  
  <p>here are the error messages:</p>
  
  <pre><code>E/MALI(22964): gles_state_set_error_internal:57: GLES error code:0x500
  E/MeizuSource_Algo_Af(239): DEBUG: gyroinform(0, 0, 0)
  E/AndroidRuntime(22964): FATAL EXCEPTION: GLThread 1335
  E/AndroidRuntime(22964): Process: de.renard.glcamera, PID: 22964
  E/AndroidRuntime(22964): android.opengl.GLException: invalid enum
  E/AndroidRuntime(22964):    at          android.opengl.GLErrorWrapper.checkError(GLErrorWrapper.java:62)
  E/AndroidRuntime(22964):    at android.opengl.GLErrorWrapper.glHint(GLErrorWrapper.java:387)
  E/AndroidRuntime(22964):    at de.renard.glcamera.CameraPreviewRenderer.onSurfaceCreated(CameraPreviewRenderer.java:75)
  E/AndroidRuntime(22964):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1547)
  E/AndroidRuntime(22964):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1285)
  </code></pre>
  
  <p>however, other similar errors of the following gl call occur when I delete the glHint, is that caused by the version of gl es version? Thank you!</p>
  
  <p>Here is the code in the <code>onCreate()</code> function in the Activity:</p>
  
  <pre><code>if(supportsEs2)
     mGlSurfaceView.setEGLContextClientVersion(2);
  mGlSurfaceView.setRenderer(mRenderer); 
  mGlSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY); 
  mGlSurfaceView.setDebugFlags(GLSurfaceView.DEBUG_CHECK_GL_ERROR); 
  setContentView(mGlSurfaceView);
  </code></pre>