Jump to content
  • Advertisement
Sign in to follow this  
chillypacman

OpenGL Trying to learn loading models, question about tutorial (NeHe)

This topic is 3815 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've been following the tutorial on NeHe (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=31) to better understand how to load 3D models in OpenGL. It was going fine-ish until this part:
MS3DHeader *pHeader = ( MS3DHeader* )pPtr;
I don't understand what this part means, could someone please explain? Thanks. [Edited by - chillypacman on January 14, 2008 6:32:57 AM]

Share this post


Link to post
Share on other sites
Advertisement
The address you provided doesn't work, but I guess you mean tutorial 31.

pPtr points to memory that holds the MS3DHeader data at the start of that memory. Therefore, it is possible to create a pointer to a MS3DHeader and point it to that location, by assigning it the value of pPtr. Since pPtr isn't declared as a pointer to a MS3DHeader, this assignment requires a cast.

Please note that this sort of thing is usually dangerous and is best avoided.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!