sfml base program

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

showing results for - "sfml base program"
Silvia
11 Jan 2019
1#include <SFML/Graphics.hpp>
2
3int main()
4{
5    // create the window
6    sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
7
8    // run the program as long as the window is open
9    while (window.isOpen())
10    {
11        // check all the window's events that were triggered since the last iteration of the loop
12        sf::Event event;
13        while (window.pollEvent(event))
14        {
15            // "close requested" event: we close the window
16            if (event.type == sf::Event::Closed)
17                window.close();
18        }
19
20        // clear the window with black color
21        window.clear(sf::Color::Black);
22
23        // draw everything here...
24        // window.draw(...);
25
26        // end the current frame
27        window.display();
28    }
29
30    return 0;
31}