mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-23 03:10:01 +08:00
Update example homescreen. Wait for the thread to join. (#129)
This commit is contained in:
parent
8e98928c0c
commit
2ea480f4f6
@ -360,8 +360,9 @@ int main(int argc, const char* argv[]) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
std::thread update([&screen, &shift]() {
|
bool refresh_ui_continue = true;
|
||||||
for (;;) {
|
std::thread refresh_ui([&] {
|
||||||
|
while(refresh_ui_continue) {
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
std::this_thread::sleep_for(0.05s);
|
std::this_thread::sleep_for(0.05s);
|
||||||
shift++;
|
shift++;
|
||||||
@ -370,6 +371,8 @@ int main(int argc, const char* argv[]) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
screen.Loop(main_renderer);
|
screen.Loop(main_renderer);
|
||||||
|
refresh_ui_continue = false;
|
||||||
|
refresh_ui.join();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user