Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker.mit.edu!bloom-beacon!LIGHTNING.MCRCIM.MCGILL.EDU!mouse From: mouse@LIGHTNING.MCRCIM.MCGILL.EDU Newsgroups: comp.windows.x Subject: Re: strip-chart display Message-ID: <9012310023.AA01768@lightning.McRCIM.McGill.EDU> Date: 31 Dec 90 00:23:54 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 35 > I'm writing a simple strip-chart application to display various > real-time data streams under X. I'm [...] using Xlib calls for > display functions. I've tried two approaches to "scroll" the > display: 1) copy an area of the drawable then draw one new line to > connect the new data point; 2) xor the old polyline to clear then xor > the updated polyline. > The bitblt approach gives the smoothest scrolling. The xor polyline > approach runs about 4 times faster on a SPARC-GX, but flickers > annoyingly [...]. > 2) XOR POLYLINE > XGrabServer( dpy ); > /* clear last displayed polyline */ > XDrawLines( dpy, xwin, xorgc, points, num_points, CoordModeOrigin ); > /* code omitted here to shift y values in array of points */ > XDrawLines( dpy, xwin, xorgc, points, num_points, CoordModeOrigin ); > XFlush( dpy ); > XUngrabServer( dpy ); You might try doing the polylines a bit differently. It would mean a little reworking of your code, but it should produce much less flicker to shift the lines one line at a time instead of erasing the old thing completely before drawing any of the new lines. You would need to use XDrawSegments for this, since the lines would no longer be connected, but I would expect it to reduce the flickering drastically. (I haven't tried it. You didn't provide enough to build a compilable program and I am not up to building a test program for it just now.) der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu