title: Cocos2d 2.0: meaning and usage of CC_ENABLE_GL_STATE_CACHE
body: <p>I was wondering when I <a href="http://www.cocos2d-iphone.org/forum/topic/28610" rel="nofollow">should</a> enable <strong>CC_ENABLE_GL_STATE_CACHE</strong> and what are the limitations in using this. I found some <a href="http://www.cocos2d-iphone.org/forum/topic/48831" rel="nofollow">posts</a> that indicate potential problems on certain devices with certain OpenGL operations</p>
  
  <p>EDIT: That's what I read from the config file. The main reason to keep this disabled is if I am using previous code using OpenGL 1.x ES functions, hence, starting this project from scratch with OpenGL 2.0 ES I should be fine.</p>
  
  <pre><code>/** @def CC_ENABLE_GL_STATE_CACHE
   If enabled, cocos2d will maintain an OpenGL state cache internally to avoid unnecessary switches.
   In order to use them, you have to use the following functions, insead of the the GL ones:
      - ccGLUseProgram() instead of glUseProgram()
      - ccGLDeleteProgram() instead of glDeleteProgram()
      - ccGLBlendFunc() instead of glBlendFunc()
  
   If this functionality is disabled, then ccGLUseProgram(), ccGLDeleteProgram(), ccGLBlendFunc() will call the GL ones, without using the cache.
  
   It is recommened to enable it whenever possible to improve speed.
   If you are migrating your code from GL ES 1.1, then keep it disabled. Once all your code works as expected, turn it on.
  
   Default value: Disabled by default
  
   @since v2.0.0
   */
  </code></pre>