Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Double Buffering

HI...any info, people????


Comments

  • : HI...any info, people????


    Hi,


    Any info? Well, double buffering means that you draw an animation frame to an off-screen buffer, and then blit the buffer to video memory all at once. It is used to make animations look smoother. You can also draw to a portion of video-memory which is at that time not displayed on screen, and then simply flip the page to that section of memory when the frame is done. This is called page flipping (... :), and is usually more efficient than a buffer in main memory (unless you draw a pixel more than, say, twice on average).

    As for QuickBasic, as far as I know you can only use page flipping in screen 9, unless you write your own graphics library in another language. A main-memory buffer is rather complicated and not very efficient, because you run into one or several of the following problems:

    - Without using the graphics PUT statement, you will probably not be able to blit to screen at an acceptable rate (even PUT itself is rather slow).

    - If you do use PUT, it is quite difficult to draw into the off-screen array, due to the different formats of these images and the limitations of QuickBasic.

    - With or without PUT, you are likely to bump into the 64k-size limit.


    If there is anything else you'd like to know, or some things are not clear yet, feel free to ask :)


    Greets,

    Mark


Sign In or Register to comment.