Platform SDK: DirectX

IDirectDraw7::CreateSurface

The IDirectDraw7::CreateSurface method creates a DirectDrawSurface object for this DirectDraw object.

HRESULT CreateSurface(
  LPDDSURFACEDESC2 lpDDSurfaceDesc2,        
  LPDIRECTDRAWSURFACE7 FAR *lplpDDSurface,  
  IUnknown FAR *pUnkOuter                  
);

Parameters

lpDDSurfaceDesc2
Address of a DDSURFACEDESC2 structure that describes the requested surface. Set any unused members of the DDSURFACEDESC2 structure to 0 before calling this method. A DDSCAPS2 structure is a member of DDSURFACEDESC2.
lplpDDSurface
Address of a variable to be set to a valid IDirectDrawSurface7 interface pointer if the call succeeds.
pUnkOuter
Allows for future compatibility with COM aggregation features. Presently, however, this method returns an error if this parameter is anything but NULL.

Return Values

If the method succeeds, the return value is DD_OK.

If it fails, the method can return one of the following error values:

DDERR_INCOMPATIBLEPRIMARY
DDERR_INVALIDCAPS
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_INVALIDPIXELFORMAT
DDERR_NOALPHAHW
DDERR_NOCOOPERATIVELEVELSET
DDERR_NODIRECTDRAWHW
DDERR_NOEMULATION
DDERR_NOEXCLUSIVEMODE
DDERR_NOFLIPHW
DDERR_NOMIPMAPHW
DDERR_NOOVERLAYHW
DDERR_NOZBUFFERHW
DDERR_OUTOFMEMORY
DDERR_OUTOFVIDEOMEMORY
DDERR_PRIMARYSURFACEALREADYEXISTS
DDERR_UNSUPPORTEDMODE

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in ddraw.h.