本文主要是介绍cocos2dx-GLProgram结合RenderTexture在安卓手机不能用,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
glProgram1 = new CCGLProgram();glProgram1->retain();glProgram1->initWithVertexShaderFilename("test.vsh", "test.fsh");glProgram1->addAttribute(kCCAttributeNameTexCoord, kCCVertexAttrib_TexCoords);//要设置一下三行属性,否则在安卓上画不出来glProgram1->bindAttribLocation(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);glProgram1->bindAttribLocation(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);glProgram1->bindAttribLocation(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);glProgram1->link();glProgram1->updateUniforms();
这篇关于cocos2dx-GLProgram结合RenderTexture在安卓手机不能用的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!