Search code examples
c++linuxx11embedded-linuxxlib

How to avoid flickering in Graphical drawings using X11


We are drawing graph in a window. We are updating the curves for every 50ms with the values received from hardware say like sensors. We need to display the values in graphical format. So we are updating the graph for every 50ms. This gives flickering issue. We are writing the code in X11. Is there a way to avoid flickering in graphical drawing in X11. Thanks in advance.


Solution

  • The keyword here is double-buffering. But I don't know if x11 offers this out-of-the-box or you need to implement it yourself, so I'll leave the google search for you ;)

    Apart from that you may consider updating less often. Perhaps it's enough to update with a 250, 500 or 1000ms period? That depends on your use-case of course.