From 304a8f19274ca908ad8824be7e7824b4511ad2fc Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Wed, 2 Sep 2015 22:09:24 +0200 Subject: [PATCH] Demo app flush the screen when needed --- src/hello.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hello.cpp b/src/hello.cpp index 66fc629bd..9f9213f2e 100644 --- a/src/hello.cpp +++ b/src/hello.cpp @@ -8,14 +8,6 @@ extern "C" { #include void hello() { - - KDFillRect((KDRect){ - .x = 0, - .y = 0, - .width = 320, - .height = 240}, - 0x7F); - char input[255]; int index = 0; @@ -26,6 +18,14 @@ void hello() { index = 0; CreateFromString(input); } else { + if (index == 0) { + KDFillRect((KDRect){ + .x = 0, + .y = 0, + .width = 320, + .height = 240}, + 0x7F); + } input[index++] = character; input[index] = 0; KDDrawString(input, (KDPoint){.x = 40, .y = 40});