DD_CANCREATESURFACEDATA structure

The DD_CANCREATESURFACEDATA structure contains information necessary to indicate whether a surface--in the case of CanCreateD3DBuffer, a buffer--can be created.

Syntax


typedef struct _DD_CANCREATESURFACEDATA {
  PDD_DIRECTDRAW_GLOBAL lpDD;
  PDD_SURFACEDESC       lpDDSurfaceDesc;
  DWORD                 bIsDifferentPixelFormat;
  HRESULT               ddRVal;
  VOID                  *CanCreateSurface;
} DD_CANCREATESURFACEDATA;

Members

lpDD

Points to the DD_DIRECTDRAW_GLOBAL structure that describes the driver's device.

lpDDSurfaceDesc

Points to a DDSURFACEDESC structure that contains a description of the surface or buffer to be created. See the Remarks section for additional information about this member.

bIsDifferentPixelFormat

Indicates whether the pixel format of the surface to be created differs from that of the primary surface. For the CanCreateD3DBuffer D3DBuffer callback, this member is always set to FALSE because the driver is attempting to create a buffer that contains vertex data or commands, rather than pixel data.

ddRVal

Specifies the location in which the driver writes the return value of either the DdCanCreateSurface or CanCreateD3DBuffer callback. A return code of DD_OK indicates success. For more information, see Return Values for DirectDraw.

CanCreateSurface

Used by the Microsoft DirectDraw API and should not be filled in by the driver.

Remarks

The DirectDraw surface description pointed to by the lpDDSurfaceDesc member is actually a DDSURFACEDESC2 structure (rather than a DDSURFACEDESC structure) for DirectDraw 6.0 and later runtimes. Therefore, if you need information at surface-creation time from those members that are in the DDSURFACEDESC2 structure but not in the DDSURFACEDESC structure, you can simply cast the pointer to a DDSURFACEDESC structure to a pointer to a DDSURFACEDESC2 structure prior to use. The following example shows how the value of dwTextureStage (a member of the DDSURFACEDESC2 structure, but not also of the DDSURFACEDESC structure) can be obtained from a pointer to a DDSURFACEDESC structure.


DDSURFACEDESC2* pddsd = (DDSURFACEDESC2*)pccsd->lpDDSurfaceDesc;
DWORD dwStage = pddsd->dwTextureStage;

Requirements

Header

Ddrawint.h (include Winddi.h)

See also

CanCreateD3DBuffer
DdCanCreateSurface

 

 

Send comments about this topic to Microsoft

Show: