From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,fa6c530d33b0384 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1993-06-07 09:42:11 PST Newsgroups: comp.sys.dec Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!ux1.cso.uiuc.edu!newsrelay.iastate.edu!news.iastate.edu!help.cc.iastate.edu!leolore From: leolore@iastate.edu (Jason Schmidt) Subject: Re: Xlib/Pixmap Problem Message-ID: Sender: news@news.iastate.edu (USENET News System) Organization: Iowa State University, Ames IA References: <1993Jun7.114545.1@cc.newcastle.edu.au> Date: Mon, 7 Jun 1993 15:38:18 GMT In <1993Jun7.114545.1@cc.newcastle.edu.au> outias@cc.newcastle.edu.au writes: > I have some odd behaviour of the Xlib graphics routines in conjunction >with a pixmap. A friend of mine and I were trying to generate an "animated" >mimic display by writing Xlib graphics data to a pixmap, then using >X$COPY_AREA to move it from the pixmap to a visible window. The picture >had to be updated and recopied on a 250 millisecond cycle time. Instead >of a smooth sequence of updates, we would get a pause, then a rapid burst >of updates, then a pause again, and so on in the visible window. The problem lies in the fact that the X server caches drawing. If you have 5 XCopyArea calls for the same area, and the gc function is set to GXCopy, it can safely ignore the first four. > The first reaction was that it was either an X$COPY_AREA limitation >or an Ethernet limitation. To test this, we modified the program to write >the data direct to the visible window, then use X$COPY_AREA to copy the >finished version to another section of the window. Interestingly enough, >this one worked perfectly; the updates occurred at constant intervals >and the animation looked quite good. We then tried a test program involving >writing data to the pixmap once, then using X$COPY_AREA to generate multiple >copies in the visble window. That also worked normally, as far as we >could tell. We eventually decided that the problem lay in writing the >graphics data to the pixmap; either the writes themselves were causing >delays, or the operation of X$FLUSH wasn't standard. Writing to different areas of the window may cause the XServer to perform the previous copies because it can't be combined with the previous request. XFlush forces all the communication that gets sent to the server to be performed before continuing, but it does not force the server to actually process them. Use XSync (probably X$SYNC) instead. { X$SYNC(Display *,False) /* Don't throw away other events */ } > The system we're running consists of a MicroVAX 3100/80 with VMS 5.5-2. >The monitors are Tektronix XP330 series, using their TekXpress X-Windows >software (Version 6.0, I _think_), connected via thinwire Ethernet using >the DECNet protocol. > Can anyone offer any comments, suggestions, remarks or (best of all) >fixes for this? Failing that, can anyone state definitively that what we're >trying to do is impossible for some reason? Well, for more details, you should probably post to comp.windows.x (if you haven't already) One other thing that it could be, is the fact that an unpredictable number of events happen in between when you do the drawing, and so it is taking too long to get through the event handler to where you do the XCopyArea, in that case, the way to insure that the animation is smooth is to set up an alarm signal (I'm used to using Ultrix, dont' know if this applies to VMS). Just ideas, I haven't tried out any of 'em ;) > Thanks in advance > Andrew Hide > Systems Engineer, Industrial Automation Services Pty Ltd > Newscastle, NSW, AUSTRALIA > Ph: (049) 58 7200 > Fax: (049) 58 1395 > outias@cc.newcastle.edu.au Jason -- ================================================================ Jason Schmidt Genesis 1:1 - Revelation 22:21 Guitarist for His Honor Help Room Staff - Iowa State University opinions in this message are solely my own