Here is my issue. I have a std::vector<POINTFLOAT> Which stores verticies. The issue is that Vertex buffer objects take in a pointer to an array of float. Therein lies my problem. I cannot give it an array of pointfloat. Is there a way that I could instead push pointers to the individual components of each vertex without pushing in copies?
basically instead of it being:
vec[0].x
vec[0].y
vec[1].x
vec[1].y
It becomes
newvec[0]
newvec[1]
newvec[2]
newvec[3]
I thought of making a std::vector<float*> but I don’t think opengl would like this. Is there a way to do this without copying data?
Thanks
Instead of having to copy data for point.x, point.y, I want OpenGL to get its data from the original vector so basically when openGL would get vec[0] it would actually get pointvec[0].x but it needs to act like when passing by reference, no pointed members
so Opengl cant do *vec[0]
You can write something like this, ie you have a std::vector which you fill with vertices, and then you call a function (eg an openGL function) which takes a float*. Is that what you want?
EDIT: This will also work, because the floats are laid out the same in memory: