I tried to replicate the problem and had some success.
I got it to go from >1000 + FPS, plugged in my 360 wireless receiver, nothing happened, turned on the gamepad and a few seconds later, FPS dropped to 20ish, but then it jumped right back up to 1000+ and I haven't been able to get the framerate to drop like that again.
If I can make it 100% replicable, I will try to bug hunt it, but this intermittent stuff... that's irritating. Is there a way to make this 100% reproducable?
Right now I used:
int _tmain(int argc, _TCHAR* argv[])
{
sf::Window app = sf::Window(sf::VideoMode(800,600,32),"test");
sf::Event event;
for(;;)
{
while (app.PollEvent(event))
{
if (event.Type == sf::Event::Closed)
app.Close();
if (event.Type == sf::Event::KeyPressed)
{
if (event.Key.Code == sf::Keyboard::Key::Escape)
app.Close();
}
}
sf::Uint32 elapsedTime = app.GetFrameTime();
if(elapsedTime == 0.0f) app.SetTitle("Lots");
else
{
std::ostringstream ost;
ost << 1000.f / elapsedTime;
app.SetTitle(ost.str());
}
app.Display();
}
}
That should be sufficient to cause the problem, right?