|
I don't know how far I want to get into this one but tvqpriqphh, I don't know if you've ever programmed OpenGL or even know why what you're doing is such a terrible idea.
What if the three dimensional array was dynamically allocated? It might be a cube structure as an array but there's no guarantee whatsoever that it will be linear in memory. Pass it around by casting and you'll read/write into parts of memory that don't belong to that array. You'll end up crashing or corrupting your own memory.
What you said is correct about how the dereferencing works, but it has no relevance on this question whatsoever. OpenGL requires linear chunks of memory and sending it a 3D array is not the correct way to use it. The compiler is not having any problems in this case, the op's code specifically shows a misunderstanding of the OpenGL function. It is pebkac and what you posted is nowhere near the solution and is just plain bad advice.
By the way, use i, j, and k when making examples on how dereferencing works -- seeing the three 0's is great but the ordering is not understood by the reader.
__________________
If you always think like an expert, you'll always be a beginner. | "A handful of knowledgeable people is more effective than an army of fools" -Writing Secure Code, 2nd Ed.
|