Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Dyn. 2 dim array same as float[x][y]??

This topic is 6178 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was recently trying to make a 2 dim array for use with glMap2f(OpenGL) and making all its values same as the array float[4][4][3]. E.g I made typedef float glVertex3fv[3]; Then, I do: glVertex3fv **Grid; Then I allocate 2 dim array as 4x4 Grid = new glVertex3fv*[4]; for (int i=0;i<4;i++) Grid = new glVertex3fv[4]; And here I just assign all values of float[4][4][3] to Grid[x][y][0,1,2]. When I go to glMap2f and pass it not as &float[0][0](starting array value), but as (float *)&Grid[0][0], it draws some buggy things, not the patch I had with float[4][4][3].. Why? Someone help please? Thanks.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!