-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
39 lines (31 loc) · 739 Bytes
/
main.cpp
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
#include "headers/Grid.hpp"
#include <SFML/Graphics.hpp>
int main()
{
int width = 800;
int height = 600;
int size = 40;
int x = width / size;
int y = height / size;
// Create the main window
sf::RenderWindow window(sf::VideoMode(width, height), "Game of Life");
Grid grid(size, x, y);
// Main Loop
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
// Close window
if (event.type == sf::Event::Closed)
{
window.close();
}
}
window.clear(sf::Color::Black);
grid.render(window);
// Display Stuff
window.display();
}
return 0;
}