After upgrading (I decided to after it still wasn't working), this is my code:
void AppStateManager::start(AppState* state){
changeAppState(state);
double frameTime = 1;
int startTime = 0;
SfmlFramework::Singleton()->window->setFramerateLimit(200);
while(!m_bShutdown){
sf::Clock clock;
if(!SfmlFramework::Singleton()->window->isOpen())m_bShutdown = true;
SfmlFramework::Singleton()->window->clear();
//capture input and handle application-wide events
sf::Event evt;
while(SfmlFramework::Singleton()->window->pollEvent(evt)){
switch(evt.type){
case sf::Event::KeyPressed:
m_ActiveStateStack.back()->keyPressed(evt.key.code);
break;
case sf::Event::KeyReleased:
m_ActiveStateStack.back()->keyReleased(evt.key.code);
break;
case sf::Event::MouseMoved:
m_ActiveStateStack.back()->mouseMoved(sf::Vector2f(evt.mouseMove.x,evt.mouseMove.y));
break;
case sf::Event::MouseButtonPressed:
m_ActiveStateStack.back()->mousePressed(evt.mouseButton.button);
break;
case sf::Event::MouseButtonReleased:
m_ActiveStateStack.back()->mouseReleased(evt.mouseButton.button);
break;
case sf::Event::Closed:
m_bShutdown = true;
break;
default:
break;
}
}
if(!m_bShutdown)
m_ActiveStateStack.back()->update(frameTime);
frameTime = clock.restart().asMilliseconds();
std::cout << frameTime << std::endl;
SfmlFramework::Singleton()->window->display();
}
SfmlFramework::Singleton()->window->close();
}
In release, it runs at 240 fps and prints 1 a lot. However, when standalone, it runs at the same fps and prints "0" over and over and the occasional "4". Have I done somethnig to cause this?... (presumably this is the same problem as before, so on some computers it would work standalone). Also, the rest of the program that is based on frameTime like movement is running slower even in release mode.