"Game Programming Mode" 2.1-double buffering

Source: Internet
Author: User

Intent

Causes a sequence of sequential operations to occur instantaneously or synchronously.

Motivation

In their minds, computers are order beasts. Its power comes from dividing the big work into many small steps, one after the other. Although generally, our users see a single instantaneous task or multitasking at the same time.

A classic example, and every game engine will be involved in rendering. When the game draws the time, it has to do such a thing at once-distant mountains, undulating slopes, trees, these take turns. If the player sees an incremental drawing, the image of the coherent world will burst. The scene must be updated smoothly and quickly, showing a series of complete frames, each of which appears immediately.

Double buffering can solve this problem, but to understand how to solve it, we need to first review how the computer displays the graphics.

How computer graphics work (briefly)

A video display like a computer monitor can only draw one pixel at a time. It sweeps each row from left to right and then moves to the next line. When it reaches the lower-right corner, it goes back to the upper-left corner and repeats the previous action. It's done fast-about 60 times a second-so that our eyes don't see the scanning process. For us, it becomes a static area of colored pixels-a picture.


"Game Programming Mode" 2.1-double buffering

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.