Hello !
Im drawing player position on top of screen and it's flickering, why ?
void RenderingThread(sf::RenderWindow* window)
{
// Rendering loop
cout << "Starting rendering loop"<< endl;
while(window->isOpen())
{
// Clear window
window->clear(sf::Color::White);
// draw...
window->draw(pSprite);
window->draw(StaticText);
// end current frame
window->display();
}
}
void InitSettings()
{
if(font.loadFromFile("Prototype.ttf")){
StaticText.setFont(font);
StaticText.setCharacterSize(20);
StaticText.setColor(sf::Color::Red);
StaticText.setPosition(0,0);
}
}
This line is inside my main loop
StaticText.setString("pPositionX: " + ToString(pPositionX) + " pPositionY: " + ToString(pPositionY) );