Jump to Content
Register
Log in
Forgot your password?
Third-party login
Hand made
Handmade Hero
Forums
Episode Guide
twitter
Handmade Hero
»
Forums
»
Code
← Back to index
descartes2140
Mike
2 posts
#6053
One Dimention or Multi for Matrices Arrays?
8 years, 2 months ago
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.
mmozeiko
Mārtiņš Možeiko
2568 posts / 2 projects
#6054
One Dimention or Multi for Matrices Arrays?
8 years, 2 months ago
"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.
descartes2140
Mike
2 posts
#6055
One Dimention or Multi for Matrices Arrays?
8 years, 2 months ago
Thanks
← Back to index
Log in
to reply