Help me with tutorial Tiny Wings OpenGl ES2.0 (Texture vertex)

Help me with tutorial Tiny Wings OpenGl ES2.0 (Texture vertex)
0.0 0


Hi guys,

I’m trying to run code from a tutorial
and so does not work (I use cocos2d-x v2.0 with OpenGL ES 2.0 ).
Earned shader, learned how to create a dynamic texture, but did not get to generate terariyu I think this is from for that something is wrong with the vertices. Below is a screenshot and code. I hope you will be able to help me:slight_smile:

void Terrain::resetHillVertices() {

    CCSize winSize = CCDirector::sharedDirector()->getWinSize();

    static int prevFromKeyPointI = -1;
    static int prevToKeyPointI = -1;

    // key points interval for drawing
    while (hillKeyPoints[fromKeyPointI+1].x < offsetX-winSize.width/this->getScale()) {
    while (hillKeyPoints[toKeyPointI].x < offsetX+winSize.width*3/2/this->getScale()) {

    if (prevFromKeyPointI != fromKeyPointI || prevToKeyPointI != toKeyPointI) {
        nHillVertices = 0;
        nBorderVertices = 0;
        CCPoint p0, p1, pt0, pt1;
        p0 = hillKeyPoints[fromKeyPointI];
        for (int i=fromKeyPointI+1; i

Screen Shot 2013-04-08 at 6.14.10 AM.png (216.6 KB)