The frametime is always 0 and I cannot understand why.
I am using sfml 2.0.
while(!m_bShutdown){
if(!SfmlFramework::Singleton()->window->IsOpened())m_bShutdown = true;
//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;
}
}
std::cout << "AppStateManager update " << frameTime << std::endl;
m_ActiveStateStack.back()->update(frameTime);
frameTime = SfmlFramework::Singleton()->window->GetFrameTime();
}