Microsoft DirectX 8.1 (Visual Basic)

Surfaces

A surface represents a linear area of display memory. A surface usually resides in the display memory of the display card, although surfaces can exist in system memory. Surface objects are contained in the Direct3DSurface8 object.

A Direct3DSurface8 class is obtained by calling one of the following methods.

  • Direct3DTexture8.GetSurfaceLevel
  • The Direct3DSurface8 object enables you to indirectly access memory through the Direct3DDevice8.CopyRects method. This method allows you to copy a rectangular region of pixels from one Direct3DSurface8 object to another specified rectangular region on another Direct3DSurface8 object. The surface object also has methods to directly access display memory. For example, you can use the Direct3DSurface8.LockRect method to lock a rectangular region of display memory. It is important to call Direct3DSurface8.UnlockRect after you are done working with the locked rectangular region on the surface.

    Surface formats dictate how data for each pixel in surface memory is interpreted. Microsoft® Direct3D® uses the CONST_D3DFORMAT member of the D3DSURFACE_DESC type to describe a surface format. You can retrieve the format of an existing surface by calling the Direct3DSurface8.GetDesc method.

    Additional information can be found in the following topics.