I have a vector, defined by std::vector<LPDIRECT3DTEXTURE9> textures;
Later, I am passing a LPDIRECT3DTEXTURE9
object to it, like so textures.push_back(texture);
Here is a sample of this:
void SpriteManager::AddSprite(float x, float y, float z, LPDIRECT3DTEXTURE9 texture)
{
//snip
textures.push_back(texture);
//snip
}
This is causing a runtime error. It is breaking in the vector class at the size()
function. Why might this happen?
Edit:
I also run into an identical problem performing the same operation on a vector of D3DXVECTOR3
objects. Since LPDIRECT3DTEXTURE9
is a pointer to an IDIRECT3DTEXTURE9
, should I be using that instead?