I've found this problem in my SFML2 RC... i'm using this code for test it:
int main(){
sf::RenderWindow window(sf::VideoMode(1024,768,32),"FPS: ");
window.setFramerateLimit(500);
//window.setVerticalSyncEnabled(true);
while (window.isOpen()){
window.setTitle("FPS: "+GetFrameRate());
sf::Event events;
while (window.pollEvent(events)){
if (events.type == sf::Event::KeyPressed && events.key.code == sf::Keyboard::Escape)
window.close();
}
window.clear(sf::Color::Blue);
window.display();
}
return EXIT_SUCCESS;
}
With VSync ON FPS are 59~61.
With or without setFramerateLimit(500) FPS are 980~991
I just tried this and it seems to happen to me as well. While vSynch works as intended, I get similar values as TheEnigmist in his last post.
Downloaded 2.0 RC something like 2-3 days ago and use all the libs as they are in the archive.
#include <SFML/Graphics.hpp>
#include <sstream>
int main()
{
sf::RenderWindow window(sf::VideoMode(300, 200), "fps");
window.setFramerateLimit(500);
sf::Text fps;
sf::Clock clock;
std::stringstream fpsstream;
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
fpsstream.str("");
fpsstream << 1.f/clock.getElapsedTime().asSeconds();
fps.setString(fpsstream.str());
clock.restart();
window.clear();
window.draw(fps);
window.display();
}
return 0;
}