2P11/src/Controllers/SFMLController/SFMLController.cpp

38 lines
466 B
C++
Raw Normal View History

#include "SFMLController.hpp"
SFMLController::SFMLController() : m_MainWindow(800,800, "2P11"){
}
SFMLController::~SFMLController(){
}
void SFMLController::run(){
while(m_MainWindow.isOpen()){
sf::Event event;
while (m_MainWindow.pollEvent(event))
{
// évènement "fermeture demandée" : on ferme la fenêtre
if (event.type == sf::Event::Closed)
m_MainWindow.close();
}
m_MainWindow.clearMW();
m_MainWindow.display();
}
}