For a rather complex and strange reason that I won't explain right now, I need to have this going on in my program.
1 2 3 4 5 6
|
class FVF{
private:
vector<vector<float>> data; //Contains fvf data for Direct3D stuff
public:
//Various get/set functions for the actual data, and structure
};
|
The idea is that this can contain ANY format of D3D-FVF styles (for compatibility with file handling things I've got set up).
1 2 3 4 5 6
|
class Model3D{
private:
vector<FVF> vertex; //Implies vector<vector<vector<float>>>
vector<uint> index;
//Other stuffs
};
|
The FVF allows this Model3D class to also be compatible with file handling methods I've got, but here's the problem.
D3D buffers require an array to feed them the information, and I know that for a single dimension of vector I can use vec.data(), I haven't got a clue how to do this for multiple dimensions.
I think the best Idea I've got so far is to set the vector within the Model3D class as a pointer, then I can union it with a float pointer... Once I can guarantee the information is correct and complete, manually transfer the contents of the vectors into the float pointer...
(The union is to reduce memory needed instead of having the data repeated in vectors and arrays)
Any ideas how I could just pass these as arrays, or any other better ideas?