home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / next / hardware / 1444 < prev    next >
Encoding:
Text File  |  1992-08-20  |  4.5 KB  |  110 lines

  1. Newsgroups: comp.sys.next.hardware
  2. Path: sparky!uunet!caen!hellgate.utah.edu!fcom.cc.utah.edu!news
  3. From: burchard@horizon.math.utah.edu (Paul Burchard)
  4. Subject: Re: video flicker
  5. Message-ID: <1992Aug20.174209.27087@fcom.cc.utah.edu>
  6. Followup-To: comp.sys.next.programmer
  7. Sender: news@fcom.cc.utah.edu
  8. Organization: University of Utah Computer Center
  9. References: <1992Aug20.133400.21569@ppgfr.uucp>
  10. Date: Thu, 20 Aug 92 17:42:09 GMT
  11. Lines: 97
  12.  
  13. In article <1992Aug20.133400.21569@ppgfr.uucp> wolpert@mars (Florian Wolpert)  
  14. writes:
  15. > rabjab@golem.ucsd.edu (Jeff Bytof) writes:
  16. > : I wrote a short program to send image files to the
  17. > : screen in real time for animation purposes.  It works great except
  18. > : there is some flickering of the image.  Perhaps not being synched with
  19. > : the natural refresh rate of the screen is causing the flickering.
  20. > : Is there a register I should poll for the event of screen refresh?
  21. > Yes, this would be of interest for me too. Is there something like
  22. > a vsync-call (or is this a general problem of no-realtime-
  23. > no-singletask-unix) ?
  24.  
  25. This discussion belongs in comp.sys.next.programmer.
  26. It has NOTHING to do with low-level hardware issues---you just
  27. need to use the software capabilities NeXT has provided, such as
  28. NXImage compositing and flushWindow control.
  29.  
  30. Here are some articles on this forwarded from c.s.n.p (please direct
  31. all further discussion there.
  32.  
  33. PB
  34.  
  35. -------------------------------------------------------------------
  36. From: sam_s@NeXT.com (Sam Streeper)
  37. Subject: Re: Animating lots of small bitmaps
  38. Date: 13 Aug 92 01:20:02 GMT
  39. Sender: news@NeXT.COM
  40. Reply-To: sam_s@NeXT.com
  41.  
  42. In article <22171@venera.isi.edu> dstrout@isi.edu (David Strout) writes:
  43. > I need to animate many (up to 40) small (48>x>20) bitmaps in a view
  44. > under 3.0.  (Think what the X game netrek looks like)  
  45.  
  46. Use NXImages to store your sprites, and then lockFocus on the appropriate
  47. View or NXImage to composite them in.  Also note whether your window
  48. is retained or buffered; if it's buffered you may need to flush frequently
  49. to prevent the dirty rect from getting too big; when this happens, flushing
  50. will become slower than necessary.  If it's retained you may need to pull
  51. some tricks so that the display doesn't flicker.
  52.  
  53. For an interesting experiment, run BoinkOut from the command line like this:
  54.  
  55. BoinkOut -NXShowAllWindows
  56.  
  57. This unsupported feature will show you what how the window server is cacheing
  58. all the images an app uses, and can be very edifying.  In the case
  59. of BoinkOut, I use a retained window and buffer everything myself in an
  60. NXImage.  Once the buffer is fully constructed, I can output the changed
  61. pieces of it without worrying about accumulating a large dirty rect.
  62. (This probably won't make any sense until you program something like it)
  63. You can get BoinkOut via ftp from (nova.cc.purdue.edu) or on the 3.0
  64. NeXTSTEP release.
  65.  
  66. > I tried doing
  67. > it with a subview per bitmap, but that flashed badly.
  68.  
  69. No doubt.  Not a good approach for fast animation.
  70.  
  71. > I tried putting
  72. > them all in the drawSelf:: of the main view, but that makes the whole
  73. > view flash.  
  74.  
  75. I recommend using your own optimized animation display methods that
  76. draw as little as possible.
  77.  
  78. > Current idea is to define a Type 3 font with my bitmaps,
  79. > then use xyshow to draw them.  This seems really gross.  If I wanted
  80. > to do graphics with fonts, I'd program (pick one: X, TI99/4a, IBM PCs)
  81.  
  82. This is fast, but is a big pain, and you can only output 1 color at a time.
  83. NXImage is much more appropriate.
  84.  
  85. -sam
  86.  
  87. ---------------------------------------------------------------------------
  88. From: andrew@cubetech.com (Andrew Loewenstern)
  89. Subject: Re: Animating lots of small bitmaps
  90. Organization: Cube Technologies, Inc.
  91. Date: Wed, 12 Aug 1992 04:09:12 GMT
  92.  
  93. In article <22171@venera.isi.edu> dstrout@darpa.mil (David Strout) writes:
  94. >I need to animate many (up to 40) small (48>x>20) bitmaps in a view
  95. >under 3.0.  (Think what the X game netrek looks like)  I tried doing
  96. >it with a subview per bitmap, but that flashed badly.  I tried putting
  97. >them all in the drawSelf:: of the main view, but that makes the whole
  98. >view flash.  Current idea is to define a Type 3 font with my bitmaps,
  99. >then use xyshow to draw them.  This seems really gross.  If I wanted
  100. >to do graphics with fonts, I'd program (pick one: X, TI99/4a, IBM PCs)
  101. >etc.  Does anyone have a better method?  Ideas welcome, example code 
  102. >even better.
  103.  
  104. turning flushWindow off before drawing will hide the flashing, but
  105. compositing may be too slow...  Fonts are really fast though.
  106.  
  107.  
  108. andrew
  109.