What I meant is, if I had a struct with attributes, as below:
struct fluidProperties1{
float foo;
float bar;
};
Once I've created my array using boost multiarray with the fluidProperties1 as the template arguments, i.e.,
boost::multi_array<fluidProperties1, 2> grid1;
Then, I would have to:
float *fooArray;
for (int i = 0; i != grid1.size(); ++i)
fooArray[i] = grid1[i].foo;
in order to extract the array, to then pass onto glTexImage2D:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, gridW, gridH, 0, GL_RGBA, GL_UNSIGNED_BYTE, fooArray);
which I feel might defeat the object of what I was trying to do. I wanted to make this clear, but keep it efficient at the same time.
Initially, I had a separate array for each attribute in the fluidProperties1 structure. At that time, it was easy to just pass an array like fooArray straight to glTexImage2D.
I thought that by creating just one grid array, and having each element of this array store the attributes for the separate arrays I had earlier, would make the code clear. At the same time, I thought it would just be a case of passing grid1.foo to a function to pass an attribute of the object as a separate array. It's a lot more complicated than that it now seems. Do you think there is an efficient way of extracting the array, based on the way I've explained above?
I hope I've explained myself clearly. When you say I would have to use a C-type array, is that the same as what I had earlier, i.e., fooArray?