-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (28 loc) · 734 Bytes
/
main.cpp
File metadata and controls
35 lines (28 loc) · 734 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
33
34
35
// library
#include <SFML/Graphics.hpp>
// main program
int main()
{
// create window
sf::RenderWindow window(sf::VideoMode({800, 600}), "Title");
// while window is still open
while (window.isOpen())
{
// handle events
while (std::optional event = window.pollEvent())
{
// when close button is clicked
if (event->is<sf::Event::Closed>())
{
// close window
window.close();
}
}
// fill window with color
window.clear(sf::Color(127, 127, 127));
// display
window.display();
}
// program end successfully
return 0;
}