cocos2dx-GLProgram结合RenderTexture在安卓手机不能用

前端之家收集整理的这篇文章主要介绍了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();

猜你在找的Cocos2d-x相关文章