From ce3f721e16c779d519c04469e49a65f60546ab8d Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Sun, 3 May 2015 14:19:30 +0200 Subject: Add first version of SFMLController and View class --- src/Controllers/SFMLController/SFMLController.cpp | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/Controllers/SFMLController/SFMLController.cpp (limited to 'src/Controllers/SFMLController/SFMLController.cpp') diff --git a/src/Controllers/SFMLController/SFMLController.cpp b/src/Controllers/SFMLController/SFMLController.cpp new file mode 100644 index 0000000..09a3c25 --- /dev/null +++ b/src/Controllers/SFMLController/SFMLController.cpp @@ -0,0 +1,37 @@ +#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(); + } + + +} -- cgit v1.2.3