[linux-audio-dev] FLTK/X11 question

Frank Neumann Frank.Neumann at st.com
Wed Sep 25 15:16:23 UTC 2002


Hi,
Steve wrote:

> I'm hacking together a VU meter app for jack, using FLTK, and it works OK,
> except that when the update rate falls out of sync with the video refresh
> rate the window flickers. I'm pasting a bigass image as the background,
> see screenshot http://inanna.ecs.soton.ac.uk/~swh/vu-ss.png (apologies
> for the tacky brushed steel background, its a placholder, honest).
> 
> I seem to remeber that on the Amiga and in GL I could issue a call to wait
> for the next vertical blank, forcing the redraw to be in sync with the
> video hardware. Is there an equivalent in FLTK or X?
> 
> How do other people get round this?

I am not sure how exactly you are doing this, but my first guess would
be to ask if you are rendering into an off-screen pixmap (until
everything in there is finished) and then do one quick Blt() to bring
this to your on-screen window. That should at least keep the flickering
low.

I am not sure if there are still ways to wait for vertical retrace
nowadays, but even if there are, I imagine it would not make sense,
given the overhead/latency the X protocol will put between the beginning
of the VBL and your attempt to draw things onto the screen "right at
that moment".

Hope that helps,
Frank
-- 
      Frank Neumann (Frank.Neumann at st.com), VIONA Development Center
            STMicroelectronics, Karlstraße 27, 76133 Karlsruhe



More information about the Linux-audio-dev mailing list