home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / rec / games / programm / 5182 < prev    next >
Encoding:
Internet Message Format  |  1992-12-24  |  1.7 KB

  1. Path: sparky!uunet!mcsun!julienas!loria!loria.fr!eker
  2. From: eker@loria.fr (Steven Eker)
  3. Newsgroups: rec.games.programmer
  4. Subject: Page flipping (was What motion blur does for you)
  5. Message-ID: <709@muller.loria.fr>
  6. Date: 24 Dec 92 10:35:09 GMT
  7. References: <1992Dec21.171731.26731@midway.uchicago.edu> <1992Dec22.202057.18233@blkbox>
  8. Sender: news@news.loria.fr
  9. Organization: CRIN (CNRS) Nancy - INRIA Lorraine
  10. Lines: 28
  11.  
  12. In article <1992Dec22.202057.18233@blkbox>, collins@blkbox (Chad R. Collins) writes:
  13. [stuff deleted]
  14. |> 
  15. |>     Is there no other way to accomplish this? What you described in your
  16. |> previous post really isnt practical for me- there will be too many objects
  17. |> moving over an irregular background. My other choices have left me in a bit
  18. |> of a quandry- if I use page flipping, waiting for the vertical retrace slows
  19. |> things down too much, but if I dont, the animation is of course poor.
  20. |> 
  21.  
  22. If your frame redraw code takes longer than one video frame, one way of speeding
  23. things up is to use triple buffering rather than double buffering.
  24.  
  25. With double buffering once your redraw is complete you have to waste cpu time
  26. waiting for the next vertical retrace so that you can flip pages.
  27.  
  28. With triple buffering once your redraw is complete, you start drawing the next
  29. frame in the third buffer.
  30. You have an interupt routine tied to the vertical retrace which checks
  31. if the next frame is ready and does the page flip if so. Thus the extra buffer
  32. allows you to have complete synchronisation of page flipping without
  33. syncing (& therefore slowing) your redraw code.
  34.  
  35. This is easy to do on ataris/amigas but I don't know about PCs. Incidently
  36. triple buffering also works well for sound generation if you're synthesizing/
  37. pitch shifting your waveforms on the fly.
  38.  
  39. Steven
  40.