home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / sgi / 13081 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  2.2 KB

  1. Path: sparky!uunet!munnari.oz.au!mips!decwrl!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!ricci.geom.umn.edu!slevy
  2. From: slevy@ricci.geom.umn.edu (Stuart Levy)
  3. Newsgroups: comp.sys.sgi
  4. Subject: winpop(): executed immediately or ...?
  5. Message-ID: <1992Aug31.161217.25495@news2.cis.umn.edu>
  6. Date: 31 Aug 92 16:12:17 GMT
  7. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  8. Distribution: na
  9. Organization: Geometry Center, University of Minnesota
  10. Lines: 42
  11. Nntp-Posting-Host: ricci.geom.umn.edu
  12.  
  13. I've been playing with taking snapshots (using system("scrsave ..."))
  14. of our program's graphics windows.  In order to ensure that the window
  15. isn't obscured when its snapshot is taken, I call winpop(), then
  16. force the window to be redrawn, then invoke scrsave.
  17.  
  18. (This is all using old-style GL, not GLX.  The program is linked under 3.3.2.)
  19.  
  20. I've had several problems with this:
  21.     scrsave often seems to snap the *back* buffer, not the
  22.     front buffer, in double-buffered mode (under 4.0.1).
  23.     I'm not certain whether it always does this.
  24.  
  25.     I can tell it's doing that by looking at the snapshotted
  26.     SGI image and comparing it with (a) the stuff visible in the
  27.     running program's window and (b) the data shown by
  28.     /usr/demos/bin/snoop in front- and back-buffer modes.
  29.  
  30.     So now I switch to singlebuffered mode (singlebuffer(); gconfig();),
  31.     draw the image, then use scrsave.  This is a Good Thing anyway on
  32.     machines which have to dither in RGB mode.
  33.  
  34.     Unfortunately, now I'm finding that even the sequence
  35.     winpop();
  36.     singlebuffer(); gconfig();
  37.     <draw world>
  38.     gflush();
  39.     system("scrsave ...");
  40.     often doesn't effectively pop the window to the top before drawing.
  41.     A ghost of the old topmost window remains.  If I stop in the debugger after
  42.     winpopping but before drawing, the window seems to be popped correctly.
  43.  
  44.     I imagine the winpop() is sending a hint to the window manager,
  45.     so the window will be popped at some indefinite near-future time.
  46.  
  47. Is there any reliable way to know when the window has been popped?
  48. (I could await the REDRAW event, but if the window was already unobscured,
  49. would I ever get one?)
  50.  
  51. Thanks for any advice,
  52.  
  53.    Stuart Levy, Geometry Center, University of Minnesota
  54.    slevy@geom.umn.edu
  55.