-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (25 loc) · 830 Bytes
/
main.cpp
File metadata and controls
33 lines (25 loc) · 830 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
29
30
31
32
#include "SortingAlgorithms.h"
const uint32_t resolutionWidth = 1280.f;
const uint32_t resolutionHeight = 720.f;
const uint32_t framerateLimit = 1500;
const float columnNumber = 1000;
int main() {
sf::RenderWindow window(sf::VideoMode(resolutionWidth, resolutionHeight), "SortingAlgorithms");
window.setFramerateLimit(framerateLimit);
Field field(columnNumber, 0, 0, resolutionWidth, resolutionHeight);
while (window.isOpen())
{
sf::Event event{};
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
field.randomizeColumns();
SortingAlgorithms::BubbleSort(field, window, event);
field.drawAllColumns(window);
window.display();
}
return 0;
}