So I built SFML 2.0 straight from the GitHub repo, and I'm trying to run this
sf::RenderWindow window(sf::VideoMode(300,200), "SFML Test");
sf::Text text;
text.setString("Hello");
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();
}
First of all, I think the sample code in the tutorial (under 2.0 node) as well as the example in the documentation for sf::Text needs to be updated as there is no constructor for sf::Text that takes in a string directly. I tried
sf::Text text("Hello"); and got a compiler error
Anyway, running the above code I just get a window with no text displayed. Is there something I'm missing? Do I need to specify extra parameter to the Text object (font, color, etc?) before it will show up in the window? I got the impression from the docs that it comes with a default font, so I didn't think I needed to.