Hello good sirs. I have a problem. I'm moving the sprite and as it moves it leaves a lite shade or trail behind as it moves.
Heres video, please watch it high quality. You can see the shade on the helmet of character.
Heres the code of main loop
sf::Clock clock;
sf::Time timeSinceLastUpdate = sf::Time::Zero;
while (isRunning)
{
timeSinceLastUpdate += clock.restart();
while (timeSinceLastUpdate > m_timePerFrame)
{
processEvents();
update(m_timePerFrame);
render();
timeSinceLastUpdate -= m_timePerFrame;
}
}
And this is the render method
m_window->beginDraw();
m_stateManager->currentState()->render();
m_window->endDraw();
void Window::beginDraw()
{
m_window.clear();
}
void Window::endDraw()
{
m_window.display();
}
void GameLevelState::render()
{
m_map->draw(m_window);
m_gameEngine->draw(m_window);
}
m_map drawing map tiles, and gameEngine using render system to draw character.
I tried different things, such as turning on and off framerate limit, vertical sync, moving the render method around the main loop. To use. The trail is still there. Please help. Thanks