So lets say I have a struct called 'Sprite.' Inside that struct is the member LPDIRECT3DTEXTURE9 texture.
Let's say I make an array of Sprite's that looks like: Sprite myArray.
I want the same image to be loaded to all 1000 of myArray texture members.
I could make a for loop that uses 'LoadTexture' (My texture loading function) to load an image to each texture member. But this is a very taxing process and takes a noticable amount of time to complete. At the end of my program I would then release() each texture via for loop.
So the other option is to create a LPDIRECT3DTEXTURE9 defaultImage. Load an image to defaultImage, then run a loop that:
myArray[i].texture = defaultImage;
The load time is unnoticible using this method.
So here's my question:
Do I have to release() all 1000 textures in myArray or do I only have to release() defaultImage?
For the record, I've tried realease()ing all 1000. Get the Unhandled exception at 0x00430906 error and have to break.
Does that mean I'm doing something wrong, or that I only have to release the one? An explination as to why would be nice as well.
Thanks for the help!