mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-05-06 17:21:13 +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.
|
// The main loop.
|
||||||
while (!quit_) {
|
while (!quit_) {
|
||||||
std::cout << reset_cursor_position << ResetPosition();
|
if (!event_receiver_->HasPending()) {
|
||||||
Draw(component);
|
std::cout << reset_cursor_position << ResetPosition();
|
||||||
std::cout << ToString() << set_cursor_position << std::flush;
|
Draw(component);
|
||||||
Clear();
|
std::cout << ToString() << set_cursor_position << std::flush;
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
Event event;
|
Event event;
|
||||||
if (event_receiver_->Receive(&event))
|
if (event_receiver_->Receive(&event))
|
||||||
component->OnEvent(event);
|
component->OnEvent(event);
|
||||||
|
Loading…
Reference in New Issue
Block a user