1
General / sf::Sprites and std::lists
« on: May 29, 2014, 04:21:09 am »
Hi, I'm trying to do something fairly simple with my code, where if I right-click a tile it gets removed from the std::list of drawables I defined. Here's a snippet of my code:
I end up getting a long list of linker errors related to std::list and sf::Sprite. However, I have similar code that compiles fine relating to collisions, so I'm not sure what's wrong. Any help would be appreciated.
if (sf::Mouse::isButtonPressed(sf::Mouse::Right)){
for each(sf::Sprite Tile in BGCollTiles){
if(Tile.getGlobalBounds().contains(sf::Mouse::getPosition().x,sf::Mouse::getPosition().y)){
BGCollTiles.remove(Tile);}}}
for each(sf::Sprite Tile in BGCollTiles){
if(Tile.getGlobalBounds().contains(sf::Mouse::getPosition().x,sf::Mouse::getPosition().y)){
BGCollTiles.remove(Tile);}}}
I end up getting a long list of linker errors related to std::list and sf::Sprite. However, I have similar code that compiles fine relating to collisions, so I'm not sure what's wrong. Any help would be appreciated.