void RuntimeScene::ManageRenderTargetEvents() { if (!renderWindow) return; inputManager.NextFrame(); sf::Event event; while (renderWindow->pollEvent(event)) { if ( event.type == sf::Event::Closed ) { //Handle window closing RequestChange(SceneChange::STOP_GAME); renderWindow->close(); } else if (event.type == sf::Event::Resized) { //Resetup OpenGL when window is resized SetupOpenGLProjection(); } else { //Most events will be input related and should be forwarded //to the InputManager: inputManager.HandleEvent(event); } } }
void RuntimeScene::ChangeRenderWindow(sf::RenderWindow * newWindow) { renderWindow = newWindow; inputManager.SetWindow(newWindow); if (!renderWindow) return; renderWindow->setTitle(GetWindowDefaultTitle()); SetupOpenGLProjection(); }
void RuntimeScene::ChangeRenderWindow(sf::RenderWindow * newWindow) { renderWindow = newWindow; inputManager.SetWindow(newWindow); if (!renderWindow) return; renderWindow->setTitle(GetWindowDefaultTitle()); if(game) { renderWindow->setFramerateLimit(game->GetMaximumFPS()); renderWindow->setVerticalSyncEnabled(game->IsVerticalSynchronizationEnabledByDefault()); } SetupOpenGLProjection(); }