Hello! This is my first post on the SFML forum, so I hope it doesn't break any rules.
I'm making a test application in C++ with Visual Studio and SFML, and for some reason, the text fails to show up and I have no idea why.
It compiles perfectly and the font (munro.ttf) is in the same folder as main.cpp.
Here's my main function (Yes, it is just one file with one function, and it includes SFML/Graphics.hpp and windows.h):
sf::RenderWindow window(sf::VideoMode(1280, 720), "Example App");
window.display();
sf::Font font;
sf::Text text;
if (!font.loadFromFile("munro.ttf")) {
return 1;
}
font.loadFromFile("munro.ttf");
text.setCharacterSize(24);
text.setStyle(0x02); // (Bold. Not important since it doesn't show up with it set to bold or not.)
text.setFont(font);
text.setString("Testing text");
window.draw(text);
Sleep(4000); // This is why windows.h is needed.
I'm on Windows 10 and use a GTX 950 GPU with the proper drivers. However, before SFML could display text perfectly with the exact same settings, so I don't understand what's going on.
I'm using the static version of SFML, and as expected, it only produces a .exe and .pdb file (debug information, like symbols in gdb) that works perfectly. I am using the static version of SFML for both debug and release versions, and do use the correct .lib's (like sfml-audio-s-d.lib for Debug and sfml-audio-s.lib for Release).
There is no part in the log that even mentions anything about an error in SFML, so I won't include it. The only errors is the amount of "no .pdb file available" which is expected because it's Visual Studio.
Thank you for any help!
EDIT: window.display(); needed to be after window.draw(text);. Thanks for helping me!