Handmade Hero»Forums»Code
Mike
2 posts
One Dimention or Multi for Matrices Arrays?
Not really sure which would be easier to work with. I think creating math functions would be a little simpler if passed a multi dimensional array, but I think openGL likes it's arrays flat? Not sure. Would appreciate some advice.
Mārtiņš Možeiko
2568 posts / 2 projects
One Dimention or Multi for Matrices Arrays?
"float a[4][4]" and "float b[16]" has the same layout in memory, as long as you are accessing b array correctly.

So OpenGL doesn't care about what arrays you use. As long as memory layout is correct, it will work fine with multi dimensional array.
Mike
2 posts
One Dimention or Multi for Matrices Arrays?
Thanks