I simply call glEnableClientState()
once in the onSurfaceCreated()
method of the GLSurfaceView.Renderer
interface. For instance:
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 do not call them again. I never call the glDisableClientState()
method. But I see that many programmers call both methods, which often wrap them in all drawing calls.
Is there something wrong with my approach? Or is it a good practice, or perhaps a more efficient approach to wrapping them in all drawing calls?
source share