I then want multiple instances of this pointer added to a list:
exList.push_back(a);
The problem is as follows,
The example pointer is a glorified texture, I want lots of textures of the same type but in different positions. Is there anyway of taking the data from a pointer without having to reference the address itself? At the moment I can pass the pointer in and add multiple references, but they obviously all mirror one another in terms of data as they all point to the same address.
Unfortunately I said that example is a glorified texture, it is a class but contains a lot of information such as click information, texture information etc. I do not want to create a whole new class to encapsulate another class, I simply want two instances of this a ptr but without them affecting one another.
IIRC you want two instances of the same class, some information will be shared (the texture) because it doesn't make sense to copy it.
Probably the class already implements that behaviour. (I think that that is what sf::Sprite and sf::Image does *) or you will need to add something like a.set_texture( b.get_texture() ); //puaj
¿What library are you using?
*sf::Image store the texture in memory
sf::Sprite maintains the transformations (rotation, scale, position, colour), and a reference to the image.
Not sure of how SFML works, a big simplification