I just call glEnableClientState()
once in onSurfaceCreated()
method of GLSurfaceView.Renderer
interface. Eg:
public class GLRenderer implements GLSurfaceView.Renderer {
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
...
}
After that I don't invoke them again. I never invoke the glDisableClientState()
method. But I see many programmers call both methods often wrapping them around all drawing calls.
Is anything wrong with my approach? Or is it a good practice or maybe more efficient to use the approach of wrapping them around all drawing calls?