Skip to main content
GameDev.net gamedev.net
🔒 Locked

Comparing 2 Textures

Started by GremlinX Sep 27, 2005 at 9:35 PM 0 replies 750+ views
Original Post
GremlinX
GremlinX
I have 2 textures loaded, and I want to see if they are the same. Is there any way to do this in DirectX 9? Thanks!
Binary Fortress Softwarehttp://www.binaryfortress.com
njpaul
njpaul
First off, I don't know if you can do that with DX9, but here's my way:

I write a texture manager class that wraps the loading of textures. When I create the textures, I put them into an stl hash_map with name of the texture as the key. That way you can't load the same texture twice. Then you can make a class to wrap around the texture that keeps the name and just compare it to another texture object's name. If you don't want to do the manager thing, you don't have to and can just wrap the texture in a class, but the manager will save you from loading the texture twice.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.