So, I looked around but couldn't find a similar thread. This may be an issue with my hardware...
OS: Windows 7
GPU: Radeon HD 5800
Static version of SFML 2.0
Description: So, as you can see from the code, I draw two Rectangle objects at 0,0. Then, I try and layer a sf::Text object on top ... this makes the text completely garbled. If I only draw ONE of those RectangleShapes, the text shows up fine, so this is only an issue when two or more RectangleShapes are drawn at this location.
You should be able to paste this code right into a main file with just the SFML library as a header.
sf::RectangleShape back;
sf::RectangleShape front;
sf::Font font;
int main()
{
sf::RenderWindow window(sf::VideoMode(1600, 900), "Tile Game"); //Set up the main Window
font.loadFromFile("arial.ttf");
while(window.isOpen()){
back.setFillColor(sf::Color::Blue);
back.setPosition(0, 0);
back.setSize(sf::Vector2f(400,400));
window.draw(back); //draw one large Rectangle
front.setFillColor(sf::Color::Red);
front.setPosition(0, 0);
front.setSize(sf::Vector2f(200,200));
window.draw(front); //draw a smaller rectangle
sf::Text text("test", font, 25);
window.draw(text); //draw some text
window.display();
}
return 0;
}
Notice, if you comment out one of the window.draw() from a Rectangle, the font shows up. Please see the attachment for a picture of what the font is showing up as on my screen.
[attachment deleted by admin]