Jump to content
  • Advertisement


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


Image Indexing HOW?

This topic is 6781 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 have all the image loading functions in my engine now. Now I am needing a way to index my images in some type of Image Manager. I need an easy way for my Actors,Textures,and Entitites to get a pointer to an image easely. I saw a previous post were someone suggested indexing then and getting them through a filename but I am lost with that. If anyone has done this before or knows how to do it. Please Help!! Thanks

Share this post

Link to post
Share on other sites
I made an index-class for textures in one of my applications that was based on a hash table with separate chaining. I then associated each texture with a unique number through the use of global #define (or enum{}). The combination of unique numbers and hash-table made the insertion, deletion and most important the lookup very fast and easy.

You could also make your indexing based on the filename of each image. The penalty you then have to pay on each operation is the calculation of the hash-key. If you use a relatively easy hash-key such as adding the characters together and then using it as a hash-value it will be quite fast anyway but perhaps does not give the best possible hashing.

Edited by - Kjell Andersson on 3/29/00 3:17:12 PM

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!