Direct3D Surfaces


A surface represents a linear area of display memory. Surfaces usually reside in the display memory of the display card, although they can exist in system memory. They are managed by the Surface class.

Familiarity with the following terms is necessary to understand surfaces.

Getting a Surface

To create a surface, call any of the following methods.

Surface formats determine how data for each pixel in surface memory is interpreted. Direct3D uses the Format property of the SurfaceDescription structure to describe the surface format. The SurfaceDescription structure of an existing surface can be retrieved via its Surface.Description property.

Once a surface is created, a pointer to it can be obtained by calling any of the following methods.

The Surface class enables indirect access to memory through the UpdateSurface method. This method allows the copying of a rectangular region of pixels from one UpdateSurface class to another. The UpdateSurface class also has methods to directly access display memory. For example, the Surface.LockRectangle method can be used to lock a rectangular region of display memory. It is important to call Surface.UnlockRectangle after working with the locked rectangular region on the surface.

Additional Surface Topics

The following topics provide information about how to use surfaces.


Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center