Jump to content
Sign in to follow this  
  • entries
    72
  • comments
    38
  • views
    22375

oops

Sign in to follow this  
mozie

148 views

Just had to share my learning experience on this one. I got my meshes, textures, and materials moved into hash tables for faster searching. I didn't want to rewrite a hash table for each one, so I made them derive from a solid hash table class. Well almost solid. Once I got it to store addresses, and everything compiled nicly, I tryed running it. Kept on getting access violations, when it called DrawSubset on the mesh. I tore my hear apart trying to figure out what was wrong. The data in the table was all 'real pointers', so things looked ok. I popped in a breakpoint, and looked at the data in the pointer. Strage stuff was in there. Kinda hard to explain, but anyway I decided to watch the data that gets put into the table by stepping thru the functions. Well folks, I was passing the address-of the argument in the function. Basically I was storing stack pointers into my hash tables. An extra & in my code looked like this: HashTable[hashed].pData = &pbuf; Yanked out the & symbol and no more crashing on DrawSubset. Stupid error, stupid programmer, I don't know why I thought I needed it in there.

Sign in to follow this  


1 Comment


Recommended Comments

Reminds me of the time I left a hot pocket in the microwave overnight. It wasn't hot in the morning, I can tell you that.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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!