Archived

This topic is now archived and is closed to further replies.

loseredkimo

A question about Surface & BackBuffer

Recommended Posts

Nairb    766
Essentially, a surface is a block of memory that holds pixel data and other attributes. This surface can either be stored in hardware (video memory) or software, each of which having its own advantages. You can write pixels to/from surfaces swiftly using direct memory access or "blitting" - bit block transfer - entire sections of memory at a time. You use them by creating them in DirectX and then copying data to them.

A backbuffer is just another surface. When you render something, you don''t render it straight to the screen (generally) - you render it to the backbuffer. When you''ve finished rendering everything, you wait for a vertical retrace and then place the backbuffer on the screen using either page flipping or copying. This method insures that there is no flickering, and back in the day (I believe) it was actually faster than writing straight to the screen. It also eliminates an effect called tearing.

There''s a lot of vocab there, and I''m not going to go through all of it. Keep in mind, though, that the version of DirectX you use will change terminology a bit. In DirectX 7 using DirectDraw, a surface is called a surface. In DirectX9, you have to use DirectGraphics and the way you use surfaces is a bit different.

Anyhow, I hope that helped.
--Brian

Share this post


Link to post
Share on other sites