-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
45 lines (39 loc) · 1.06 KB
/
main.cpp
File metadata and controls
45 lines (39 loc) · 1.06 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include "minesweeper.h"
int main()
{
const static int windowSizeHeight = 720;
const static int windowSizeLength = 720;
sf::RenderWindow window(sf::VideoMode(windowSizeLength, windowSizeHeight), "SFML window");
minesweeper aGame(&window, 10, 25);
aGame.createRBoard();
aGame.printAnswer();
window.setFramerateLimit(60);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
switch (event.type)
{
case sf::Event::Closed:
window.close();
break;
case sf::Event::Resized:
break;
case sf::Event::MouseButtonPressed:
aGame.mouse(event);
break;
case sf::Event::KeyPressed:
aGame.keys(event);
break;
}
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
aGame.draw();
window.display();
}
return 0;
}