Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views


Sign in to follow this  


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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!