Hello, I have a std::vector of pointers to my Tile class:
std::vector<Tile*> m_Map;
The tiles are added like so(depending on their id):
if(id == 0){
Tile temp(x * 32, y * 32, solid, border);
m_Map.push_back(&temp);
}
and when I render the tiles it does not even go to the function:
void Level::render(sf::RenderWindow& window, const sf::Vector2f& scrRegion, const sf::Vector2f& scrSize){
//render the tile if it is on the screen
for(auto iter = m_Map.begin(); iter != m_Map.end(); ++iter){
(*iter)->render(scrRegion, scrSize, window); //<- does not go to the function
}
}
I believe the problem is with (*iter)->render(scrRegion, scrSize, window). I looked online but I could not find a way to fix this. Thanks for any help.