Original Post
🔒 Locked
buffering?
Advertisement
Single buffering: whatever you draw, appears immediately on screen (assuming there is no batching). For example, Windows GDI works this way. If you call a Rectangle function, a rectangle appears on the screen right before that function returns.
Double buffering: drawing is performed on an "off-screen" surface, while the user watches "on-screen" surface. All drawing operations are invisible to the user, since pixels are written to one place and monitors shows pixels from another place.
How do you get the user to see the hidden off-screen surface?
Blit (short for bit block transfer, I believe): you copy the off-screen surface to the on-screen one. Takes some time, but is still faster than drawing all your stuff.
Flip: you make the video card take pixel data from a different place. Very little time is needed to do the flip, as opposed to the blit. However, flipping is not supported in windowed mode.
Why use blits/flips? Because they can be performed during vertical retrace, while it may take you the whole time between two retraces to actually draw the objects to whatever surface you choose.
To your question: you usually want to use double-buffering if it''s available, and you use either blit or flip, depending on whether you''re in windowed or fullscreen mode, to show the contents of the off-screen surface to which you draw stuff to the user.
Double buffering: drawing is performed on an "off-screen" surface, while the user watches "on-screen" surface. All drawing operations are invisible to the user, since pixels are written to one place and monitors shows pixels from another place.
How do you get the user to see the hidden off-screen surface?
Blit (short for bit block transfer, I believe): you copy the off-screen surface to the on-screen one. Takes some time, but is still faster than drawing all your stuff.
Flip: you make the video card take pixel data from a different place. Very little time is needed to do the flip, as opposed to the blit. However, flipping is not supported in windowed mode.
Why use blits/flips? Because they can be performed during vertical retrace, while it may take you the whole time between two retraces to actually draw the objects to whatever surface you choose.
To your question: you usually want to use double-buffering if it''s available, and you use either blit or flip, depending on whether you''re in windowed or fullscreen mode, to show the contents of the off-screen surface to which you draw stuff to the user.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement