I'm coding a memory/image manager in C++ and SDL, and am running into trouble. AFter debugging I"ve figured out that my class is working properly, but it has soemthing to do with the vectors I"m using.
Currently, I have a vector of sTexture structs, that are declared as follows:
struct sTexture
{
SDL_Surface*;
int width;
int height;
}
Where SDL_Surface* is used to store image data.
and in my initialization:
sTexture newTexture; newTexture.width = w; newTexture.height = h; newTexture.surface = textureSurface; m_Textures.push_back(newTexture);
The following code above was addressed in a function where the width, height, and surface was passed.
My problem is when I'm trying to draw it, I use the surface from the texture I've pushed back onto the vector using m_Textures[whateverNumber].surface
The memory instance is not there. What's wrong? I explicitly call the appropriate functions. It's as if a vector can not store pointer data.
Jason












