如何使用cocos2d中默认的shader
自己做的这么也没有任何效果,不知是什么问题
希望大神能介绍下默认shader的使用
self.shaderProgram = programForKey:kCCShader_PositionColor];ccGLEnableVertexAttribs(kCCVertexAttribFlag_Position|kCCVertexAttribFlag_Color); ; ; ccGLBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); ccVertex2F vertices; ccColor4F colors; int nVertices = 0; vertices = (ccVertex2F){0,0}; colors = (ccColor4F){0,0,0,1}; vertices = (ccVertex2F){10,0}; colors = (ccColor4F){0,0,0,1}; vertices = (ccVertex2F){0,10}; colors = (ccColor4F){0,0,0,1}; vertices = (ccVertex2F){10,10}; colors = (ccColor4F){0,0,0,1}; //glUniform4f(m_iColorLocation, 1.f, 1.f, 1.f, 1.f); glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices); glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_FLOAT, GL_FALSE, 0, colors); glDrawArrays(GL_TRIANGLE_STRIP, 0, (GLsizei)nVertices); CC_INCREMENT_GL_DRAWS(1); CHECK_GL_ERROR_DEBUG();<p> </p> </p>