Hello. How to solve this error ?!
Mistake:
In member function 'void Blocks::SetCube(std::vector<Texture2f>*, std::vector<Vector3f>*, std::vector<unsigned int>*, char)': /home/hays/program/WorldMap/Blocks.cpp:112:55: error: base operand of '->' has non-pointer type 'std::vector<Texture2f>' TextureBuffer[TextureBuffer->size()-1]->u = CubeGrass.TextureData[i].u; ^ /home/hays/program/WorldMap/Blocks.cpp:113:55: base operand of '->' has non-pointer type 'std::vector<Texture2f>' TextureBuffer[TextureBuffer->size()-1]->v = CubeGrass.TextureData[i].v; ^ /home/hays/program/WorldMap/Blocks.cpp:119:54: base operand of '->' has non-pointer type 'std::vector<Vector3f>' VertexBuffer[TextureBuffer->size()-1]->x = CubeGrass.VertexData[i].x; ^ /home/hays/program/WorldMap/Blocks.cpp:120:54: base operand of '->' has non-pointer type 'std::vector<Vector3f>' VertexBuffer[TextureBuffer->size()-1]->y = CubeGrass.VertexData[i].y; ^ /home/hays/program/WorldMap/Blocks.cpp:121:54: base operand of '->' has non-pointer type 'std::vector<Vector3f>' VertexBuffer[TextureBuffer->size()-1]->z = CubeGrass.VertexData[i].z; ^ /home/hays/program/WorldMap/Blocks.cpp:128:50: no match for 'operator=' (operand types are 'std::vector<unsigned int>' and 'unsigned int')[/COLOR] IndexBuffer[TextureBuffer->size()-1] = CubeGrass.IndexData[i]; Structures:
typedef float Scalar; struct Vector3f { Scalar x, y, z; }; struct Texture2f { Scalar u, v; }; Function:
using namespace std; void Blocks::SetCube(vector <Texture2f> *TextureBuffer,vector <Vector3f> *VertexBuffer, vector <GLuint> *IndexBuffer,char type) { switch(type) { case 0: for(int i(0);i<24;i++) { TextureBuffer->push_back(Texture2f()); TextureBuffer[TextureBuffer->size()-1]->u = CubeGrass.TextureData[i].u; TextureBuffer[TextureBuffer->size()-1]->v = CubeGrass.TextureData[i].v; } for( int i(0);i<24;i++) { VertexBuffer->push_back(Vector3f()); VertexBuffer[TextureBuffer->size()-1]->x = CubeGrass.VertexData[i].x; VertexBuffer[TextureBuffer->size()-1]->y = CubeGrass.VertexData[i].y; VertexBuffer[TextureBuffer->size()-1]->z = CubeGrass.VertexData[i].z; } for(int i(0);i<36;i++) { IndexBuffer->push_back(GLuint()); IndexBuffer[TextureBuffer->size()-1] = CubeGrass.IndexData[i]; } break; } }