[comp.windows.x] How to display exactly n frames of an image?

bmh@tigger.cs.unc.edu (Brad Hemminger) (07/06/90)

  For some vision experiments we would like to do I need to be able to
display a blank screen, then exactly n frames of a image, then blank 
screen, etc, etc.  Question:  is there any way to have this fine a level
of control under X11?  E.g. some machines might allow me to see a
vertical retrace interrupt, but so far under X I don't see anything at
that level (e.g. no X events that indicate vertical retrace, etc).
  If anyone has any answers, or hints on how to do this I would greatly
appreciate it.  The best I have come up with so far is to use gettimeofday
to delay for the amount of time equal to n*(time each frame is displayed);
however, this may in certain cases cause the display of n-1 or n+1 frames
instead of n.


thanks, 
  Brad Hemminger
  Dept of Radiology
  UNC
  bmh@rad.unc.edu

jch@Stardent.COM (Jan Hardenbergh @stardent) (07/12/90)

> From: uunet!mcnc.org!thorin!tigger!bmh  (Brad Hemminger)
> Subject: How to display exactly n frames of an image?

>   For some vision experiments we would like to do I need to be able to
> display a blank screen, then exactly n frames of a image, then blank
> screen, etc, etc.  Question:  is there any way to have this fine a level
> of control under X11?  E.g. some machines might allow me to see a
> vertical retrace interrupt, but so far under X I don't see anything at
> that level (e.g. no X events that indicate vertical retrace, etc).
>   If anyone has any answers, or hints on how to do this I would greatly
> appreciate it.  The best I have come up with so far is to use gettimeofday
> to delay for the amount of time equal to n*(time each frame is displayed);
> however, this may in certain cases cause the display of n-1 or n+1 frames
> instead of n.

You are looking for the multibuffering extension. See
X11R4/mit/doc/extensions/buffer.text for a description. 
Here's one of the goals.

> o    Display a series of buffers in a window in  rapid  suc-
>      cession to achieve a smooth animation.


It does have an implementation for the sample server - see
X11R4/mit/extensions/server/multibuf.c. As far as I know it is not
a blessed extension, yet. But it seems to have no serious oposition.

-- 
-Jan "YON" Hardenbergh - jch@stardent.com                uunet!stardent!jch
Stardent Computer, Inc.,  95 Wells Ave., Newton, MA 02159 (617)964-6228x261