次の方法で共有


Front Buffers (Windows Embedded CE 6.0)

1/6/2010

A front buffer, also called a primary surface, represents the memory that is currently being displayed on screen. Microsoft® Direct3D® Mobile assumes that the front buffer has the same height and width as the display mode, and that it has a color format identified by a value from the D3DMFORMAT enumeration. When the driver receives a command from Direct3D Mobile middleware to create the front buffer, the driver should not allocate new memory. Instead, the driver should construct a wrapper around the current front buffer and return that to the middleware.

The driver must support creating front buffers. The D3DMSURFCAPS_SYSFRONTBUFFER capability bit indicates that the driver supports front buffers in system memory, which is typical of a UMA or shared memory architecture. The D3DMSURFCAPS_VIDFRONTBUFFER capability bit indicates that the front buffer is in video memory. These two capability bits are mutually exclusive.

The D3DM_CreateSurface call for the front buffer sets the SurfaceType member of the D3DM_CREATESURFACE_DATA structure to D3DMRTYPE_SURFACE. The D3DM_CREATESURFACE_DATA.SurfaceDesc parameter contains a D3DMSURFACE_DESC structure to describe the specific information about the front buffer. The Direct3D Mobile middleware sets the SurfaceDesc.Usage and also provide a value for SurfaceDesc.MultiSampleType. The value that describes the multisampling type is a hint to the driver that it should use the closest value to SurfaceDesc.MultiSampleType that the underlying hardware can support.

In addition to generating a wrapper and a unique surface handle for the wrapper, the driver must populate the Height, Width, Format, Size, and Pool members of the D3DMSURFACE_DESC structure.

The driver controls the locking policy for the front buffer. Usually, it is best for the driver to not allow the front buffer to be locked. The graphics hardware must be flushed to maintain pixel coherency when the front buffer is locked; the graphics hardware flush is an expensive operation. If the driver does allow the front buffer to be locked, the driver should set the D3DMSURFCAPS_LOCKFRONTBUFFER capability bit (see D3DMSURFCAPS Values).

See Also

Concepts

Surface Creation by Direct3D Mobile Drivers
Resources in Direct3D Mobile Drivers