From: Torquil M. <to...@gm...> - 2008-01-19 12:53:05
|
On Friday 18 January 2008, Werner Smekal wrote: > Hi, > > > the usual solution to avoid such flickering is using double-buffering. > > I am not sure if PLplot has any device drivers that support that. > > The wxWidgets driver does also support double buffering. > > Werner > My previous message got bounced. Let's see if this one goes through :-) Thanks four your suggestions regarding double-buffering, Arjen, Maurice and= =20 Werner. I'm using Debian Sid (kernel 2.6.23) with PLPlot 5.8.0-6. I have an IBM T42= =20 with ATI Mobility Radeon 9600 M10, using the open source radeon X-driver, b= ut=20 the problem is the same on my stationary machine (Debian Sid/kernel 2-6-22)= =20 with an NVIDIA FX5600 card using the driver from NVIDIA. The effect of using double-buffering with the xwin driver was that it did n= ot=20 plot anything until all the for-loop iterations were finished. Then it plot= ted=20 just the last frame. Using the TK driver gives the same result. It also onl= y=20 plots the last frame when using -db. I have made an example program with a rotating radial line that displays a= =20 comparable flickering problem as my simulation, with some comments for the= =20 three different drivers I tried: #include <plplot/plplot.h> #include <cmath> using namespace std; int main(int argc, char *argv[]) { double x[2], y[2]; // Coordinates to plot x[0] =3D 0; y[0] =3D 0; // These are fixed x[1] =3D 1; y[1] =3D 0; // Starting position plparseopts(&argc, argv, PL_PARSE_FULL); =20 /* Driver xwin: Fast. Lots of flickering. When using -db, the plot is black until the loop has finished. Then the last frame in the animation appears. */ // plsdev("xwin"); /* Driver xcairo: About twice as slow as xwin, but still fast enough for my needs. Less flickering but far from perfect. Using -db has no effect on the amount of flickering. */ // plsdev("xcairo"); /* Driver wxwidgets: Much slower than xcairo when not including plsetopt("drvopt", "smooth=3D0"), else about as as fast as xcairo, maybe a tad faster. With pgclear() as below: it only plots some of the box plus the tickmark-numbers, very flickering, with no lines inside the plot. Only the first frame has a clearly visible box (a different problem that is fixed using the smooth=3D0 option). Using -db has no effect. Without pgclear(): Makes a plot that filles a disk, but very slowly compared to xwin and xcairo. -db has no effect. Since pgclear() doesn't work, I found I could use pgadv(0) together with the -np option. Gives lots of flickering, more than xcairo */ plsdev("wxwidgets"); plsetopt("drvopt", "smooth=3D0"); plinit(); plenv(-1, 1, -1, 1, 1, -2); plbox("bcinst", 0, 0, "bcinst", 0, 0); plline(2, x, y); // Plot starting position for(int i =3D 0; i !=3D 1000; ++i) { // New position x[1] =3D cos(double(i)/100); y[1] =3D sin(double(i)/100); // Plot plclear(); // Doesn't work with wxwidgets. //pladv(0); plbox("bcinst", 0, 0, "bcinst", 0, 0); plline(2, x, y); } =20 plend(); return(0); } Best regards, Torquil S=F8rensen |