It's been a while since I've programmed, and so I though I'd get back into it. I noticed that SFML 2.1 came out so I downloaded it and decided to mess around a bit by doing some basic stuff like rendering text. However, for some reason the text does not draw at all in my window. Maybe someone can tell me what I'm doing wrong by taking a look at my code? Thanks
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window( sf::VideoMode( 800, 600 ), "Text Test" );
sf::Event ev;
sf::Text text;
text.setString( "Test String" );
text.setCharacterSize( 30 );
text.setPosition( 400, 300 );
text.setColor( sf::Color::Red );
while ( window.isOpen() )
{
while ( window.pollEvent( ev ) )
{
if ( ev.type == sf::Event::Closed )
{
window.close();
}
if ( sf::Keyboard::isKeyPressed( sf::Keyboard::Escape ) )
{
window.close();
}
}
window.clear();
window.draw( text );
window.display();
}
return 0;
}