I was wondering if anyone could tell me if I should do it this way and why it works
I have two classes, class A and class B in two differently headers.
in class A header I have
and in class B Header I have
if I do it this way, the compiler gonna complains about alot of stuffs >.<,
but instead of including I somehow(accidently) got
and I was wondering how this worked? is it like extern/global variables? or is it more of a function prototype, but how would class a inside b.h, knows that it got defined inside a.h? and how come those two doesnt clash in name if it doesnt work as a prototype?
Oh, Sorry It was late at night >.< (Around 4 in the morning XD) Let me try it again.
What am trying to do is to avoid loading more than one of each texture file, so I made a std::map wtih the texture name as the key and the value would be a ID3D11ShaderResourceView* that contain the texture.
Each time I "Load" a model with materials it would check if the material would already exist inside the map, to avoid loading multipile time of the same texture.
if the texture already had been loaded i would get it by calling RequestTexture which looks like this
The ReqeustTexture returns a shader resource which I assign and insert into a seperate class which I would call the "Model", the model class have its own map which looks like the same except the only texture that gets inserted there would be the materials that the model use, the reason why I try to do this is to avoid unnecessary looping inside the bigger map.
This is how I do it inside my LoadModel
Its works great, my Testing does indeed get the same adress as the loaded texture from the map
int vEnityMax = 10;
int vEnitySize = 0;
vEnitySize = vEnity.size();
vEnityEnd = vEnity.end();
if(vEnitySize < vEnityMax)
//MessageBox(0,"Lets hope this work","Enity have NOT Increased by 1 yet!",MB_OK);
TestComp = &eFactory.InstantiateEnity(Enity); <- error of illegal use of this type as an expression
MessageBox(0,"Screw This","Enity Increased by 1!",MB_OK);