Hello Laurent,
Not to my surprise, I ended up recreating the problem with minimal code, the results are pretty daunting:
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <iostream>
#include <sstream>
int main()
{
sf::Clock clock;
sf::RenderWindow App(sf::VideoMode(1280, 800, 32), "window");
App.setFramerateLimit(60);
App.setVerticalSyncEnabled(true);
//Intro Resources
//Important global variables
//Menu sequence variables
//Game sequence variables
//Text data
int timer =0;
int frames =0;
//GAME STARTS
while (App.isOpen())
{
if (clock.getElapsedTime().asSeconds() >= .5)
{
std::cout<<frames*2<< "\n";
frames=0;
clock.restart();
}
App.clear();
sf::Event Event;
if (App.pollEvent(Event))
{
if (Event.type == sf::Event::Closed)
App.close();
}
frames++;
App.display();
}
return 0;
}
It basically is a "hello world" program for SFML, it makes a render window, and nothing else. The frames don't spike to 100s, but it stays around 50s much like what the old broken program did when idle. Here's an output of FPS:
http://i.imgur.com/VkqRJ.jpg
Capped at 60 it should return something like 63ish from experience, and without the limit it goes to the 1000s so I know it's not a hardware issue.
Like I said, this issue comes and goes, it's quite unstable and I'm really not sure what's going on anymore. using the same exact code in another project, it would work fine.