IDirectDraw7::CreateSurface method (ddraw.h)

Creates a DirectDrawSurface object for this DirectDraw object.

Syntax

HRESULT CreateSurface(
  [in]  LPDDSURFACEDESC2     unnamedParam1,
  [out] LPDIRECTDRAWSURFACE7 *unnamedParam2,
  [in]  IUnknown             *unnamedParam3
);

Parameters

[in] unnamedParam1

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.

[out] unnamedParam2

Address of a variable to be set to a valid IDirectDrawSurface7 interface pointer if the call succeeds.

[in] unnamedParam3

Allows for future compatibility with COM aggregation features. Currently, this method returns an error if this parameter is not NULL.

Return value

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

Requirement Value
Target Platform Windows
Header ddraw.h
Library Ddraw.lib
DLL Ddraw.dll

See also

IDirectDraw7