https://youtu.be/zH_omFPqMO4
소스코드: https://drive.google.com/uc?export=download&id=1naW_v6WAWYPgCIWNDskxtBsM84FoaOLh
공식문서에 나와있는 튜토리얼 중 하나:
#include <SFML/Graphics.hpp>
int main()
{
// create the window
sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
// run the program as long as the window is open
while (window.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event;
while (window.pollEvent(event))
{
// "close requested" event: we close the window
if (event.type == sf::Event::Closed)
window.close();
}
// clear the window with black color
window.clear(sf::Color::Black);
// draw everything here...
// window.draw(...);
// end the current frame
window.display();
}
return 0;
}
윈도우를 생성하고, 반복문에서 이벤트를 계속 처리하는 형태다.