I created a font the same way as the wiki said and it just crashes with "whatever.exe Has Stopped Working". Is this a bug with SFML or am I just doing something wrong?
#include <iostream>
#include "SFML/Graphics.hpp"
using namespace std;
sf::Font font;
int main()
{
sf::RenderWindow window(sf::VideoMode(640, 480, 32), "Test Window");
if (!font.loadFromFile("AriBlk.ttf"))
cout << "Error Loading Font" << endl;
sf::Text text("Hello, World", font, 20);
text.setColor(sf::Color(100,100,100));
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 0;
}
And yes, it IS Font and not Text and the font file is in the same directory as the exe. I'm not using any IDE, just a text editor (Sublime Text 3 to be specific).