The polygon texture is not rendering


#1

Hi,

I am using following code for rendering of texture over polygon.

cocos2d::CCTexture2D* mTexture = CCTextureCache::sharedTextureCache()>addImage;
void Structure::calculateTextureCoordinates {
if {
areaTrianglePoints = NULL;
}
if {
textureCoordinates = NULL;
}
Vector2dVector triangulatedPoints =
PRRatcliffTriangulator::triangulateVertices;
areaTrianglePointCount = triangulatedPoints.size;
CCLOG ("_______areaTrianglePointCount: %d", areaTrianglePointCount);
areaTrianglePoints = malloc * areaTrianglePointCount);
textureCoordinates = malloc * areaTrianglePointCount);
for {
textureCoordinates[j] = ccpMult);
}
}
if ) {
blendFunc.src = GL_SRC_ALPHA;
blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA;
//[self setOpacityModifyRGB:NO];
} else {
blendFunc.src = CC_BLEND_SRC;
blendFunc.dst = CC_BLEND_DST;
//[self setOpacityModifyRGB:YES];
}
// CC_NODE_DRAW_SETUP
// ;
ccGLBindTexture2D);
glTexParameteri;
glTexParameteri;
ccGLBlendFunc;
ccGLEnableVertexAttribs;
glVertexAttribPointer;
glVertexAttribPointer;
glDrawArrays;
*structure = CCSprite::createWithTexture;
*structure
>setPosition(ccp(x/2,h/2));

this->addChild(mStructres->_structure,1);

The above code is not rendering the texture over Polygon and show the square texture as it is. Even when I try to remove the comment from the line
“// CC_NODE_DRAW_SETUP()” then it is giving error identifier m_glServerState is not initialized. Can anyone help me out?