|
The DDSURFACEDESC structure contains
a description of a surface. This structure is passed to the
IDirectDraw2::CreateSurface method. The relevant members differ for each
potential type of surface.
When using the IDirectDraw7 interface, this structure is superseded by the
DDSURFACEDESC2 structure.
'typedef struct _DDSURFACEDESC {
'DWORD dwSize;
'DWORD dwFlags;
'DWORD dwHeight;
'DWORD dwWidth;
'union
'{
'LONG lPitch;
'DWORD dwLinearSize;
'};
'DWORD dwBackBufferCount;
'union
'{
'DWORD dwMipMapCount;
'DWORD dwZBufferBitDepth;
'DWORD dwRefreshRate;
'};
'DWORD dwAlphaBitDepth;
'DWORD dwReserved;
'LPVOID lpSurface;
'DDCOLORKEY ddckCKDestOverlay;
'DDCOLORKEY ddckCKDestBlt;
'DDCOLORKEY ddckCKSrcOverlay;
'DDCOLORKEY ddckCKSrcBlt;
'DDPIXELFORMAT ddpfPixelFormat;
'DDSCAPS ddsCaps;
'} DDSURFACEDESC, FAR* LPDDSURFACEDESC;
TYPE DDCOLORKEY
dwColorSpaceLowValue AS DWORD
dwColorSpaceHighValue AS DWORD
END TYPE
TYPE DDSCAPS
dwCaps AS DWORD
END TYPE
UNION u1_DDPIXELFORMAT
dwRGBBitCount AS DWORD
dwYUVBitCount AS DWORD
dwZBufferBitDepth AS DWORD
dwAlphaBitDepth AS DWORD
' #IF %DIRECTX_VERSION >= &h0600
dwLuminanceBitCount AS DWORD
dwBumpBitCount AS DWORD
dwPrivateFormatBitCount AS DWORD
' #ENDIF
END UNION
UNION u2_DDPIXELFORMAT
dwRBitMask AS DWORD
dwYBitMask AS DWORD
' #IF %DIRECTX_VERSION >= &h0600
dwStencilBitDepth AS DWORD
dwLuminanceBitMask AS DWORD
dwBumpDuBitMask AS DWORD
dwOperations AS DWORD
' #ENDIF
END UNION
UNION u3_DDPIXELFORMAT
dwGBitMask AS DWORD
dwUBitMask AS DWORD
' #IF %DIRECTX_VERSION >= &h0600
dwZBitMask AS DWORD
dwBumpDvBitMask AS DWORD
wFlipMSTypes AS WORD
wBltMSTypes AS WORD
' #ENDIF
END UNION
UNION u4_DDPIXELFORMAT
dwBBitMask AS DWORD
dwVBitMask AS DWORD
' #IF %DIRECTX_VERSION >= &h0600
dwStencilBitMask AS DWORD
dwBumpLuminanceBitMask AS DWORD
' #ENDIF
END UNION
UNION u5_DDPIXELFORMAT
dwRGBAlphaBitMask AS DWORD
dwYUVAlphaBitMask AS DWORD
' #IF %DIRECTX_VERSION >= &h0600
dwLuminanceAlphaBitMask AS DWORD
' #ENDIF
dwRGBZBitMask AS DWORD
dwYUVZBitMask AS DWORD
END UNION
TYPE DDPIXELFORMAT
dwSize AS DWORD
dwFlags AS DWORD
dwFourCC AS DWORD
u1 AS u1_DDPIXELFORMAT
u2 AS u2_DDPIXELFORMAT
u3 AS u3_DDPIXELFORMAT
u4 AS u4_DDPIXELFORMAT
u5 AS u5_DDPIXELFORMAT
END TYPE
UNION u1_DDSURFACEDESC
lPitch AS LONG
dwLinearSize AS DWORD
END UNION
UNION u2_DDSURFACEDESC
dwMipMapCount AS DWORD
dwZBufferBitDepth AS DWORD
dwRefreshRate AS DWORD
END UNION
TYPE DDSURFACEDESC
dwSize AS DWORD
dwFlags AS DWORD
dwHeight AS DWORD
dwWidth AS DWORD
u1 AS u1_DDSURFACEDESC
dwBackBufferCount AS DWORD
u2 AS u2_DDSURFACEDESC
dwAlphaBitDepth AS DWORD
dwReserved AS DWORD
lpSurface AS DWORD
ddckCKDestOverlay AS DDCOLORKEY
ddckCKDestBlt AS DDCOLORKEY
ddckCKSrcOverlay AS DDCOLORKEY
ddckCKSrcBlt AS DDCOLORKEY
ddpfPixelFormat AS DDPIXELFORMAT
ddssurfCaps AS DDSCAPS
END TYPE
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
All input members are valid.
DDSD_ALPHABITDEPTH
The dwAlphaBitDepth member is valid.
DDSD_BACKBUFFERCOUNT
The dwBackBufferCount member is valid.
DDSD_CAPS
The ddsCaps member is valid.
DDSD_CKDESTBLT
The ddckCKDestBlt member is valid.
DDSD_CKDESTOVERLAY
The ddckCKDestOverlay member is valid.
DDSD_CKSRCBLT
The ddckCKSrcBlt member is valid.
DDSD_CKSRCOVERLAY
The ddckCKSrcOverlay member is valid.
DDSD_HEIGHT
The dwHeight member is valid.
DDSD_LINEARSIZE
The dwLinearSize member is valid.
DDSD_LPSURFACE
The lpSurface member is valid.
DDSD_MIPMAPCOUNT
The dwMipMapCount member is valid.
DDSD_PITCH
The lPitch member is valid.
DDSD_PIXELFORMAT
The ddpfPixelFormat member is valid.
DDSD_REFRESHRATE
The dwRefreshRate member is valid.
DDSD_WIDTH
The dwWidth member is valid.
DDSD_ZBUFFERBITDEPTH
The dwZBufferBitDepth member is valid.
dwHeight and dwWidth
Dimensions of the surface to be created, in pixels.
lPitch
Distance, in bytes, to the start of next line. When used with the
IDirectDrawSurface7::GetSurfaceDesc method, this is a return value. When
creating a surface from existing memory or when calling the
IDirectDrawSurface7::SetSurfaceDesc method, this is an input value that must
be a DWORD multiple.
dwLinearSize
Size of the buffer. Currently returned only for compressed texture
surfaces.
dwBackBufferCount
Number of back buffers.
dwMipMapCount
Number of mipmap levels.
dwZBufferBitDepth
Depth of the z-buffer. This member is obsolete for DirectX 6.0 and
later. Use the IDirect3D7::EnumZBufferFormats to retrieve information about
supported depth-buffer formats.
dwRefreshRate
Refresh rate (used when the display mode is described). The value of
0 indicates an adapter default.
dwAlphaBitDepth
Depth of the alpha buffer.
dwReserved
Reserved.
lpSurface
Address of the associated surface memory. When calling
IDirectDrawSurface7::Lock, this member contains a valid pointer to surface
memory after the call returns. When creating a surface from existing memory
or using the IDirectDrawSurface7::SetSurfaceDesc method, this member is an
input value that is the address of system memory allocated by the calling
application. Do not set this member if your application needs DirectDraw to
allocate and manage surface memory.
ddckCKDestOverlay
DDCOLORKEY structure that describes the destination color key for an
overlay surface.
ddckCKDestBlt
DDCOLORKEY structure that describes the destination color key for
blit operations.
ddckCKSrcOverlay
DDCOLORKEY structure that describes the source color key for an
overlay surface.
ddckCKSrcBlt
DDCOLORKEY structure that describes the source color key for blit
operations.
ddpfPixelFormat
DDPIXELFORMAT structure that describes the surface's pixel format.
ddsCaps
DDSCAPS structure that contains the surface's capabilities.
Remarks
This structure is similar to the DDSURFACEDESC2 structure, but contains a
DDSCAPS structure as the ddsCaps member, rather than a DDSCAPS2 structure.
Unlike DDSURFACEDESC2, this structure contains the dwZBufferBitDepth member.
Requirements
Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable
for Windows 95.
Header: Declared in ddraw.h.
|