I figured that the constructor of sf::Text no longer has Font::getDefaultFont() as its second default argument.
so I just put sf::Text("...", sf::Font()), but this throws an exception.
But when I predefine a font object with its default constructor, it doesn't throw an exception. why?
I also just realized that either way doesn't render any text onto the screen.
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
//Exception
sf::Text text("Exception thrown because of this->", sf::Font());
//no exception
//sf::Font font;
//sf::Text text("Exception not thrown here", font);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(text);
window.display();
}
return EXIT_SUCCESS;
}