1
Graphics / sf::String rendering issue
« on: December 30, 2011, 11:34:15 pm »
Tanks a lot! :-) Really made my day.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
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();
}
}
In debug mode, link to the SFML debug libraries. These end with the "-d" suffix. By the way, the Code::Blocks tutorial mentions that.
Quote-lsfml-system-sBoth configurations contain typing errors, or is that correct in your project?
-lsfml-window-s
-sfml-graphics-s
--sfml-system
-lsfml-graphics
-lsfml-window
Did you compile in Release mode when linking to sfml-system-s etc., and did you not define SFML_DYNAMIC in this configuration?