Hi. I'm writing a puzzle game using SFML2 for windowing and input, however my game's main loop looks like this
//at init
this->input = window->GetInput(); //oinoput of type const sf::Input&
while(//running) //while the current state is still running
{
stateManager->stateLoop(input);
this->window->Display();
}
stateManager::stateLoop(sf::Input& input)
{
//check various state flags
currentState->HandleInput(input); //<-Need access to sf::Input& here
}
I'm unsure how to hand down input handling to each state. I have tried passing an instance of sf::Input by reference down through the state manager to the state but I was getting compiler errors about the class being non copyable. Any help would be great