ofMesh on Android

I have some code to make a grid using ofMesh, I use it to render a texture on a deformable grid with adjustable vertices. It seems to work ok on desktop (linux, win and mac), but on Android and openGL ES, I can draw the grid in wireframe mode calling ofMesh.drawWireframe() perfectly, but I’m not able to get it showing anything in textured mode with ofMesh.drawFaces(). I’m surely doing something wrong, but I can’t find out what, any tip? Am I doing something I am not supposed to do in openGL ES?

header

  
bool bGrid;  
    vector<vector<vector<float> > > gridPoints;  
    //vector<GLfloat> gridCtrlPoints;  
    int gridRows;  
    int gridColumns;  
    void gridSurfaceSetup();  
    void gridSurfaceUpdate();  
    void drawGridMarkers();  
  
    ofMesh gridMesh;  
  

grid setup function

  
// Grid helpers --------------------------------------  
// grid setup -------------------------------------  
void quad::gridSurfaceSetup()  
{  
  
    gridMesh.clearVertices();  
    gridMesh.clearIndices();  
    gridMesh.clearTexCoords();  
  
    for(int i=0; i<=gridRows; i++)  
    {  
        vector<vector<float> > row;  
        for(int j=0; j<=gridColumns; j++)  
        {  
            vector<float> column;  
            column.push_back((float)(1.0/gridColumns*j));  
            column.push_back((float)(1.0/gridRows*i));  
            column.push_back(0.0);  
            row.push_back(column);  
        }  
        gridPoints.push_back(row);  
    }  
  
  
    for(int i=0; i<=gridRows; i++)  
    {  
        for(int j=0; j<=gridColumns; j++)  
        {  
            gridMesh.addTexCoord(ofVec2f((gridPoints[i][j][0]*ofGetWidth()), (gridPoints[i][j][1]*ofGetHeight())));  
        }  
    }  
  
  
    for(int i=0; i<=gridRows; i++)  
    {  
        for(int j=0; j<=gridColumns; j++)  
        {  
            gridMesh.addVertex(ofVec3f((gridPoints[i][j][0]*ofGetWidth()), (gridPoints[i][j][1]*ofGetHeight()), (0.0)));  
        }  
    }  
  
    for(int i=0; i<gridRows; i++)  
    {  
        for(int j=0; j<gridColumns; j++)  
        {  
  
            gridMesh.addIndex((i*(gridColumns+1)+j)); //a  
            gridMesh.addIndex((i*(gridColumns+1)+j+1)); //b  
            gridMesh.addIndex(((i+1)*(gridColumns+1)+j+1));  //c  
            gridMesh.addIndex(((i+1)*(gridColumns+1)+j+1)); //c  
            gridMesh.addIndex(((i+1)*(gridColumns+1)+j)); //d  
            gridMesh.addIndex((i*(gridColumns+1)+j)); //a  
  
        }  
    }  
}  

drawing mesh

  
if(bGrid)  
                        {  
                            quadFbo.getTextureReference().bind();  
                            gridMesh.drawFaces();  
                            quadFbo.getTextureReference().unbind();  
                            if(isTweakingGrid)  
                            {  
                                ofPushStyle();  
                                ofSetColor(255,255,255,200);  
                                gridMesh.drawWireframe();  
                                ofPopStyle();  
                            }  
                        }  

the texture coordinates in opengles have to be in 0…1 instead of pixels, i guess that’s the problem