Greetings! I've been trying desperately to fix this issue myself, but after 4 hours, I'm admitting defeat and asking for help.
The error I'm experiencing is that the entire window turns black - with the exception of the string - after the string has been rendered. I've played around (A LOT) with attempting to render the string on top of the existing stuff by calling Display() twice per loop, and a billion other smaller unsuccessful tweaks.
This leads be to believe that the issue is caused by an OpenGL-state floating around inside the machine - which renders (get it? ho ho) me useless, should this be the case.
The minimal code required is:
int main (int argc, char** argv)
{
sf::RenderWindow App;
App.Create(sf::VideoMode(1280, 720, 32), "snb", sf::Style::Resize | sf::Style::Close);
sf::Font font;
font.LoadFromFile("Times New Roman.ttf");
sf::String str("This is a string.", font);
while (App.IsOpened())
{
App.Clear();
glColor3f(1, 1, 1);
glLineWidth(10.f);
glBegin(GL_TRIANGLE_FAN);
glVertex2f(0, 0);
glVertex2f(1280, 0);
glVertex2f(1280, 720);
glVertex2f(0, 720);
glEnd();
//Comment this line, and behold the beautiful white background
App.Draw(str);
App.Display();
}
}
I've tried setting glMatrixMode's, glOrtho, glLoadIdentity and all other glFunctions I use from time to time without luck.
Also, as a side issue : I can only load external resources (sprites etc) when running in admin mode. Is there a way around this? Know that this is not what is causing the rendering to fail.