   Texture storage
  Hi guysI was after some advice about texture management.  I am writing a small app and currently it stores up to 20 textures in an array though of course it is easy to make that larger.  Geometry that uses these textures just contains a reference to the array element where the texture it uses resides...so the texture can be found instantly.  However if I want to make things scalable and have an unlimited number of textures i need something dynamic.  Obviously i could use a linked list, and i do this for my world objects, but i heard that binary search trees or even red-black trees are better for texture lookup beacuse traversal is so fast.  I was wondering what professional programs, or what you use for storing your textures, and what you would recommend.Thanks in advance 
  I just use a linked list for it. ;  Yeah i think i will. I have done BST''s before, but I think I will keep things simple.Thanks. ;  I personally use a std::map (C++), with each element being a structure holding a texture handle and a reference count so that I know when textures can be safely released. A linked list presents the problem (albeit a minor one, unless you have a _lot_ of textures) of having O(n) search time when looking for a specific texture.My texture handler will also report at program exit which textures were not properly released, and release them, to help debugging.   GolemBlender--The Gimp--Python--Lua--SDLNethack--Crawl--ADOM--Angband--Dungeondweller