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

who reads the subject anyway?

Sign in to follow this  
mozie

77 views

Today, the texture manager got its face lift and moved into a hash table design. I like it better, its much cleaner. I pretty much copied the tutor on this site, except I didnt want to make each entry a linked list. I did use the recommended values of 383 for a prime and a multiplier of 5. I only have 2 textures that I loaded into the table, so its working great! :) Anyways, I didn't really see a reason to use the linked lists together with the hash table. It just seemed like an extra layer of junk, all I am storing in it now is the name of the texture, and the pointer to its memory. I have enough layers of that I think.

So I'm pleased that the hashing is so simple, I am going to make the meshes and materials use them next. I like that I dont have to walk the linked list to get my pointer, and the hashing is just multiplication and addition, so its cheap. I don't like having to have a fixed size array, for each table. However the size of the table isn't really that big, an 41 char string, and a 32bit pointer. I could even shorten the string length to something like 16 I bet.

I have been trying to impliment a way to reload all the pointers on Invalidate/RestoreDeviceObjects, but I only have the textures doing it right now. So it crashes when it trys to render the mesh that was released, but the pointer is still pointing to the released mesh, blah blah its not done so I didn't upload any new source.

Yup its late, time for bed.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

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!