Merge branch 'master' of github.com:matteodelabre/projet-cmi
This commit is contained in:
commit
e72f6eacbe
|
@ -36,6 +36,12 @@ void Engine::start() {
|
||||||
if (event.type == sf::Event::KeyReleased) {
|
if (event.type == sf::Event::KeyReleased) {
|
||||||
state.keys[event.key.code] = false;
|
state.keys[event.key.code] = false;
|
||||||
}
|
}
|
||||||
|
// lorsque la fenêtre est redimensionnée par l'utilisateur
|
||||||
|
if (event.type == sf::Event::Resized){
|
||||||
|
// mise à jour de la caméra en fonction de la taille de la fenêtre
|
||||||
|
sf::FloatRect visibleArea(0, 0, event.size.width, event.size.height);
|
||||||
|
window.setView(sf::View(visibleArea));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float frame = clock.restart().asSeconds();
|
float frame = clock.restart().asSeconds();
|
||||||
|
|
Loading…
Reference in New Issue