OpenGL: Using VBO with std::vector
I'm trying to load an object and use VBO and glDrawArrays() to render it. The problem is that a simple float pointer like float f[]={...} does not work in my case, because I passed the limit of values that this pointer can store. So my solution was to use a vector. And it's not working... Here is my code: unsigned int vbo; vector<float*> vert; ... vert.push_back(new float(i*size)); vert.push_back(new float(height*h)); vert.push_back(new float(j*size)); ... glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, sizeof(vert), &vert, GL_STATIC_DRAW); glBindBuffer