int main(){ window.create(sf::VideoMode((unsigned int)windowWidth,(unsigned int)windowHeight),"MyWindow"); window.setFramerateLimit(60); Setup(); running=true; while(running){ while(window.pollEvent(event)){ if(event.type==sf::Event::Closed) running=false; else if(event.type==sf::Event::Resized) ReshapeWindow((float)event.size.width,(float)event.size.height); } if (currentState == MAIN) { cmain.HandleKeyboard(); cmain.mouseControl(); } else if (currentState == GAME) { cgame.HandleKeyboard(); handleKeyboard(); } Display(); window.display(); } return 0; }