From: authentic AT tip DOT nl (Rick) Newsgroups: comp.os.msdos.djgpp Subject: Re: dubble buffering Date: Wed, 04 Feb 1998 21:24:38 GMT Organization: NL-NIC Lines: 48 Message-ID: <6bdao9$okt$1@cadmium.aware.nl> References: <01bd30f9$1418c700$a23470c2 AT siddiqui> <34D7B522 DOT 6745 AT cs DOT com> Reply-To: authentic AT tip DOT nl NNTP-Posting-Host: nijmegen-014.std.pop.tip.nl To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk "John M. Aldrich" wrote: >Siddiqui wrote: >> >> sorry about the ignorance, but what is dubble buffering? >"Double buffering" (note spelling) is a graphical algorithm used to >reduce screen flicker. When you use double-buffering, your graphics >code does not write directly to the screen, but instead to a buffer in >memory with the same characteristics as the screen. Once a frame is >ready to display, the program waits for a vertical sync (the period of >time during which the electron ray is travelling from the bottom right >corner of the screen to the top left), and then "blits," or copies, the >data to screen memory. >-- >--------------------------------------------------------------------- >| John M. Aldrich | "Animals can be driven crazy by pla- | >| aka Fighteer I | cing too many in too small a pen. | >| mailto:fighteer AT cs DOT com | Homo sapiens is the only animal that | >| http://www.cs.com/fighteer | voluntarily does this to himself." | >--------------------------------------------------------------------- Also frequently used in texteditors, and in general in every program that handles large data. In fact besides the buffering to output I think you also can use buffering from the input side when you need large diskfiles( blockreading instead of characterreading from a file). Consider for instance that you want to do multiple operations on some paragraph of someones masterthesis. Probably you will read the whole paragraph from the file. Do your operations on the buffer. Then store back buffer to the file. Thats also double buffering( and indeed you need to store the filepointers, and even then the readback of the buffer is far from very easy to optimize), which is of course a lot better then updating your file on every change you make to the paragraph. For the graphix parts however its very specific because the buffer mirrors the videoram(which is slower then system RAM(see excellent explanation in allegro docs)). This is in fact incorparated in dmpi 10 specs (I think its function 800h) so that videoram can be, and in fact frequently is, mapped somewhere in the systemram by default)). Hoped this added something, Rick