Microsoft Windows CE 3.0  

DDSURFACEDESC2

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The DDSURFACEDESC2structure contains a description of a surface. This structure is used to pass surface parameters to the IDirectDraw4::CreateSurfaceand IDirectDrawSurface5::SetSurfaceDescmethods. It is also used to retrieve information about a surface in calls to IDirectDrawSurface5::Lockand IDirectDrawSurface5::GetSurfaceDesc. The relevant members differ for each potential type of surface.

typedef struct _DDSURFACEDESC2 { DWORD
dwSize
;
DWORD
dwFlags
;
DWORD
dwHeight
;
DWORD
dwWidth
;
union
{
LONG
lPitch
;
DWORD
dwLinearSize
;
} DUMMYUNIONNAMEN(1);
DWORD
dwBackBufferCount
;
union
{
DWORD
dwMipMapCount
;
DWORD
dwRefreshRate
;
} DUMMYUNIONNAMEN(2);
DWORD
dwAlphaBitDepth
;
DWORD
dwReserved
;
LPVOID
lpSurface
;
DDCOLORKEY
ddckCKDestOverlay
;
DDCOLORKEY
ddckCKDestBlt
;
DDCOLORKEY
ddckCKSrcOverlay
;
DDCOLORKEY
ddckCKSrcBlt
;
DDPIXELFORMAT
ddpfPixelFormat
;
DDSCAPS2
ddsCaps
;
DWORD
dwTextureStage
;
} DDSURFACEDESC2, FAR* LPDDSURFACEDESC2;

Members

dwSize
Size of the structure in bytes. This member must be initialized before the structure is used.
dwFlags
Optional control flags. One or more of the following flags:
DDSD_ALL Indicates that all input members are valid.
DDSD_ALPHABITDEPTH Indicates that the dwAlphaBitDepthmember is valid.
DDSD_BACKBUFFERCOUNT Indicates that the dwBackBufferCountmember is valid.
DDSD_CAPS Indicates that the ddsCapsmember is valid.
DDSD_CKDESTBLT Indicates that the ddckCKDestBltmember is valid.
DDSD_CKDESTOVERLAY Indicates that the ddckCKDestOverlaymember is valid.
DDSD_CKSRCBLT Indicates that the ddckCKSrcBltmember is valid.
DDSD_CKSRCOVERLAY Indicates that the ddckCKSrcOverlaymember is valid.
DDSD_HEIGHT Indicates that the dwHeightmember is valid.
DDSD_LINEARSIZE Indicates that the dwLinearSizemember is valid.
DDSD_LPSURFACE Indicates that the lpSurfacemember is valid.
DDSD_MIPMAPCOUNT Indicates that the dwMipMapCountmember is valid.
DDSD_PITCH Indicates that the lPitchmember is valid.
DDSD_PIXELFORMAT Indicates that the ddpfPixelFormatmember is valid.
DDSD_REFRESHRATE Indicates that the dwRefreshRatemember is valid.
DDSD_TEXTURESTAGE Indicates that the dwTextureStagemember is valid.
DDSD_WIDTH Indicates that the dwWidthmember is valid.
DDSD_ZBUFFERBITDEPTH Obsolete; see remarks.
dwHeightand dwWidth
Dimensions, in pixels, of the surface to be created.
lPitch
Distance, in bytes, to the start of next line. When used with the IDirectDrawSurface5::GetSurfaceDescmethod, this is a return value. When used with the IDirectDrawSurface5::SetSurfaceDescmethod, this is an input value that must be a DWORDmultiple. See remarks for more information.
dwLinearSize
The size of the buffer. Currently returned only for compressed texture surfaces.
dwBackBufferCount
Number of back buffers.
dwMipMapCount
Number of mipmap levels.
dwRefreshRate
Refresh rate (used when the display mode is described). The value of zero indicates an adapter fault.
dwAlphaBitDepth
Depth of alpha buffer.
dwReserved
Reserved.
lpSurface
Address of the associated surface memory. When calling IDirectDrawSurface5::Lock, this member is a valid pointer to surface memory. When calling IDirectDrawSurface5::SetSurfaceDesc, this member is a pointer to system memory that the caller explicitly allocates for the DirectDrawSurface object. See remarks for more information.
ddckCKDestOverlay
DDCOLORKEYstructure that describes the destination color key to be used for an overlay surface.
ddckCKDestBlt
DDCOLORKEYstructure that describes the destination color key for blit operations.
ddckCKSrcOverlay
DDCOLORKEYstructure that describes the source color key to be used for an overlay surface.
ddckCKSrcBlt
DDCOLORKEYstructure that describes the source color key for blit operations.
ddpfPixelFormat
DDPIXELFORMATstructure that describes the surface's pixel format.
ddsCaps
DDSCAPS2structure containing the surface's capabilities.
dwTextureStage
Stage identifier used to bind a texture to a specific stage in 3-D device's multitexture cascade. Although not required for all hardware, setting this member is recommended for best performance on the largest variety of 3-D accelerators. Hardware that requires explicitly assigned textures will expose the D3DDEVCAPS_SEPARATETEXTUREMEMORIES 3-D device capability in the D3DDEVICEDESCstructure that is filled by the IDirect3DDevice3::GetCapsmethod.

Remarks

The lPitchand lpSurfacemembers are output values when calling the IDirectDrawSurface5::GetSurfaceDescmethod. When creating surfaces from existing memory, or updating surface characteristics, these members are input values that describe the pitch and location of memory allocated by the calling application for use by DirectDraw. DirectDraw does not attempt to manage or free memory allocated by the application.

This structure is nearly identical to the DDSURFACEDESCstructure, but contains a DDSCAPS2structure as the ddsCapsmember. Unlike DDSURFACEDESC, this structure doesn't contain the dwZBufferBitDepthmember. Z-buffer depth is provided in the ddpfPixelFormatmember.

The unions in this structure were written to work with compilers that don't support nameless unions. If your compiler doesn't support nameless unions, define the NONAMELESSUNION token before including the Ddraw.h header file.

Requirements

Runs on Versions Declared in
Windows CE OS 2.12 or later. Version 2.12 requires DXPAK 1.0 or later. ddraw.h