-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
28 lines (26 loc) · 729 Bytes
/
Main.cpp
File metadata and controls
28 lines (26 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "Controller.hpp"
#include "Model.hpp"
#include "View.hpp"
namespace {
constexpr auto f_windowTitle{"Minesweeper"};
constexpr auto f_windowStyle{sf::Style::Fullscreen};
constexpr auto f_antialiasing{4};
} // namespace
int main() {
sf::RenderWindow window{sf::VideoMode::getDesktopMode(), f_windowTitle,
f_windowStyle,
sf::ContextSettings{0, 0, f_antialiasing}};
window.setVerticalSyncEnabled(true);
Model model;
View view{window, model};
Controller controller{view, model};
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
controller.onEvent(event);
}
model.update();
view.update();
}
return 0;
}