我想知道什么时候应该启用CC_ENABLE_GL_STATE_CACHE以及使用它有什么限制。我发现一些帖子表明某些设备上的某些 OpenGL 操作存在潜在问题
编辑:这就是我从配置文件中读取的内容。禁用此功能的主要原因是如果我使用以前的代码使用 OpenGL 1.x ES 函数,因此,使用 OpenGL 2.0 ES 从头开始这个项目应该没问题。
/** @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
*/