Marian Jancar writes:
 > 
 > Create a window with backing pixmap, read the image into it and call
 > XClearArea - most compatible, with good accelerated xserver also fastest.
 > Mmap will not help here, it would only make things more dificult.// gcc -O2 -s x.c 
 >-o x -I/usr/X11/include -L/usr/X11/lib -lX11 -lXext -Wall



Do you have something that would work without shm ?

I just want to display remotely....
wes



 > 
 > #include <X11/Xlib.h>
 > #include <X11/extensions/XShm.h>
 > #include <sys/ipc.h>
 > #include <sys/shm.h>
 > #include <unistd.h>
 > #include <fcntl.h>
 > 
 > 
 > int main (int argc, char **argv)
 > {
 >      Display *d;
 >      Window w, r;
 >      Pixmap b_p;
 >      XShmSegmentInfo i;
 >      XSetWindowAttributes a;
 >      char *buff;
 >      int depth, width, height, image_size, v, fd;
 > 
 > 
 >      depth = 16;
 >      width = 768;
 >      height= 576;
 >      
 >      image_size = width * height * (depth / 8);
 >      
 >      
 >      i.shmid = shmget (IPC_PRIVATE, image_size, IPC_CREAT | 0777);
 >      i.shmaddr = shmat (i.shmid, 0, 0);
 >      i.readOnly=False;
 >      buff = i.shmaddr;
 > 
 >      d = XOpenDisplay (NULL);
 >      XShmAttach (d, &i);
 >      r = DefaultRootWindow (d);
 >      b_p = XShmCreatePixmap (d, r, buff, &i, width, height, depth);
 >      a.background_pixmap = b_p;
 >      v = CWBackPixmap;
 >      w = XCreateWindow (d, r, 0, 0, width, height, 0, depth, InputOutput, 
 >CopyFromParent, v, &a);
 >      XMapWindow(d, w);
 >      
 >      fd = open("./video.raw", O_RDONLY);
 >      while(read(fd, buff, image_size)) {
 >              XClearWindow(d, w);
 >              XFlush(d);
 >              usleep(40000);
 >      }
 > 
 >      return 0;
 > }


-- 
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to