When using multiple sf::Views, do they really have to be reset every frame?
When I don't call reset(), it won't work, but it feels a bit weird having to do that...
In my game I have a view that displays the UI and stuff (defaultView_), and another view that follows the player and shows a small part of the complete world around the player (camera_). I use this code in my draw function:
window_->clear();
// Player camera
camera_.reset(sf::FloatRect(0, 0, 640, 480));
camera_.setCenter(calculateNewCameraPosition());
window_->setView(camera_);
window_->draw(tileMap_);
window_->draw(player_);
// View for the UI
defaultView_.reset(sf::FloatRect(0, 0, 1024, 768));
window_->setView(defaultView_);
window_->draw(playerInfoText_);
window_->draw(fpsText_);
window_->display();
Is that the correct way to do it? I'm kind of starting a new project and I want to do everything right from the beginning!
Thanks