I'm currently experiencing a very strange and annoying problem:
When using SFML, one frame every second is very slow.
What I did:
- I make a new Visual Studio 2015 C++ Application and add SFML 2.3.2 as a dependency.
- I'm using the new nuget package manager to achieve this and never had any problems before.
- Afterwards I copy the example code in the main.cpp file, add some frame time measurement logic
and print it. No custom code or whatsoever.
main.cpp:
int main() {
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
sf::Clock clock;
while(window.isOpen()) {
sf::Event event;
while(window.pollEvent(event)) {
if(event.type == sf::Event::Closed)
window.close();
}
float elapsedTime = clock.getElapsedTime().asSeconds();
if(elapsedTime > 0.040) {
printf("%f\n", elapsedTime);
}
clock.restart();
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
The slow frame usually needs between 60 and 100ms and appears (exacly) once every second. I'm using sfml since 3 years and never had this issue before. The problem also appears when I comment everything except the
window.displace() command.
I'm using Windows 10 and there are no other processes running in the background that might cause this issue. It also happens on other PCs.