问题
In my app it was working fine in Cocos2D version 1.1. When I upgraded to 2.0rc0a, I just see a black screen now and I get the following 4 errors nonstop until I quit the application:
OpenGL error 0x0506 in -[CCSprite draw] 532
OpenGL error 0x0506 in -[CCParticleSystemQuad draw] 461
OpenGL error 0x0506 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 543
OpenGL error 0x0506 in -[CCGLView swapBuffers] 280
So I googled this a bit and it seems that the app cannot find the shader files. What shader files? Is there a specific name or is it ALL Cocos2D files?
Also how would I fix this issue? I currently have no warnings or errors in my project.
Thanks!
回答1:
The shader files are now header files (.h), in previous beta versions they were resource files (.vsh/.fsh).
I suppose that you did not add these newly added cocos2d files to your project. When upgrading cocos2d in an existing project, always delete the entire cocos2d folder and replace it with the new one, then remove any missing (red) files in Xcode and also add any new files that might have been added.
来源:https://stackoverflow.com/questions/9914914/cocos2d-2-0-opengl-errors