Share via


IDirectDraw4::CreateSurface (Windows CE 5.0)

Send Feedback

This method creates a DirectDrawSurface object for this DirectDraw object.

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

Parameters

  • lpDDSurfaceDesc2
    Address of a DDSURFACEDESC2 structure that describes the requested surface. You should set any unused members of the DDSURFACEDESC2 structure to zero before calling this method. A DDSCAPS2 structure is a member of DDSURFACEDESC2.

  • lplpDDSurface
    Address of a variable that will be set to a valid IDirectDrawSurface4 interface pointer if the call succeeds.

    In all cases, call IDirectDrawSurface4::QueryInterface to obtain a pointer to an IDirectDrawSurface5 interface and then use the IDirectDrawSurface5 interface for all of your DirectDraw programming in Windows CE.

  • pUnkOuter
    Allows for future compatibility with COM aggregation functionality.

    Presently, however, this method will return an error if this parameter is anything but NULL.

Remarks

DirectDraw does not support emulated surface flipping. Surface flipping in DirectDraw requires hardware support.

If your device does not support hardware flipping and you specify DDSCAPS_FLIP, the operation will fail with the DDERR_NOFLIPHW error code.

Return Values

If the method succeeds, the return value is DD_OK.

If the method fails, the return value may be 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

OS Versions: Windows CE 2.12 and later. Version 2.12 requires DXPAK 1.0 or later.
Header: Ddraw.h.
Link Library: Ddraw.lib.

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.