diff --git a/sfmldemo/main.cpp b/sfmldemo/main.cpp index f1d14ff..0492ee0 100644 --- a/sfmldemo/main.cpp +++ b/sfmldemo/main.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include void ImGui_setup(sf::RenderWindow &window) { @@ -48,6 +48,16 @@ int main() { sf::Clock clock; sf::Time tick = clock.getElapsedTime(); + // very cool, c++11 lambdas doing a 1 second slept thread + sf::Thread thread([](){ + for(int i = 0; i < 10; i++) { + fmt::print("I'm a thread. {}\n", i); + sf::sleep(sf::seconds(1)); + } + }); + + thread.launch(); + while (window.isOpen()) { sf::Event event;