I suggest you use STL and keep your names in a list and before adding a new name test if it already exists in the list !
I do this with my TextureManager so it never created the same texture 2 times.
If you know know about STL just tell me !
Zengar, you don’t need to make Leyder Dylan
feel like he’s stupid with your “God is it so difficult ?”
Everyone here is here to learn and help others.
Leyder Dylan STL is Standard Template Library I think
You can use it to create list very easily
like #include <vector> //A vector in STL is like an array
using namespace std;
vector< string* > vecTextureName;
vecTexture.push_back( your texturename here );
and to test if the texture you have to go throught your vector with an iterator
look for some doc about STL you’ll find it very useful ! I won’t give you all the code like that hehhehe I can only show you the path, you’re the one who must walk through it.
hehehee good luck man !
Hope you understand the code. I think it’s pretty string forward and easy to understand, but that might have to do with the fact that I know a little STL
Yepp, DFrey got it. s is a string object, the STL-component string. If you want to convert this string to a char *, you must use s.c_str().
Questions Burner, your code will not remove all duplicate entries. The definition of unique() is that it will remove any equal entries next to each other. unique only guaratees that (*I) != (*I+1) for any value of I, where I is an iterator of the proper type. Meaning, if two entries are separated by another entry, none of them will be removed. You must sort the list before calling unique() to remove ALL duplicate entries.