sfml basic program

Solutions on MaxInterview for sfml basic program by the best coders in the world

showing results for - "sfml basic program"
Mordecai
24 Jun 2020
1#include <SFML/Window.hpp>
2
3int main()
4{
5    sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
6
7    // run the program as long as the window is open
8    while (window.isOpen())
9    {
10        // check all the window's events that were triggered since the last iteration of the loop
11        sf::Event event;
12        while (window.pollEvent(event))
13        {
14            // "close requested" event: we close the window
15            if (event.type == sf::Event::Closed)
16                window.close();
17        }
18    }
19
20    return 0;
21}