mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-05-06 09:13:48 +08:00
Improve performance.
Read all the input before drawing anything on the screen.
This commit is contained in:
parent
0b6fd0c895
commit
3490d56662
@ -272,10 +272,12 @@ void ScreenInteractive::Loop(Component* component) {
|
||||
|
||||
// The main loop.
|
||||
while (!quit_) {
|
||||
std::cout << reset_cursor_position << ResetPosition();
|
||||
Draw(component);
|
||||
std::cout << ToString() << set_cursor_position << std::flush;
|
||||
Clear();
|
||||
if (!event_receiver_->HasPending()) {
|
||||
std::cout << reset_cursor_position << ResetPosition();
|
||||
Draw(component);
|
||||
std::cout << ToString() << set_cursor_position << std::flush;
|
||||
Clear();
|
||||
}
|
||||
Event event;
|
||||
if (event_receiver_->Receive(&event))
|
||||
component->OnEvent(event);
|
||||
|
Loading…
Reference in New Issue
Block a user