PDD_SURFCB_DESTROYSURFACE callback function (ddrawint.h)

The DdDestroySurface callback function destroys a DirectDraw surface.

Syntax

PDD_SURFCB_DESTROYSURFACE PddSurfcbDestroysurface;

DWORD PddSurfcbDestroysurface(
  PDD_DESTROYSURFACEDATA unnamedParam1
)
{...}

Parameters

unnamedParam1

Points to a DD_DESTROYSURFACEDATA structure that contains the information needed to destroy a surface.

Return value

DdDestroySurface returns one of the following callback codes:

Remarks

If DirectDraw did the memory allocation at surface creation time and the driver was not involved in the allocation, DirectDraw does not call the driver's DdDestroySurface function to destroy the surface.

If the driver is performing the surface memory management itself, DdDestroySurface should free the surface memory and perform any other cleanup, such as freeing private data stored in the dwReserved1 members of the DD_SURFACE_GLOBAL and DD_SURFACE_LOCAL structures.

For a driver-managed surface, if the surface is persistent (that is, the DDSCAPS2_DONOTPERSIST flag in the dwCaps2 member of the DDSCAPS2 structure for the surface is not set), DdDestroySurface can be called with the purpose of evicting the surface from video memory. In this case, the display driver can continue to keep any private data in the dwReserved1 members until DdDestroySurface is called to actually destroy the surface.

DdDestroySurface can be called with a disabled PDEV. PDEV is disabled or enabled by calling the display driver's DrvAssertMode function. See Managing PDEVs for more information.

Requirements

Requirement Value
Target Platform Desktop
Header ddrawint.h (include Winddi.h)

See also

DDSCAPS2

DD_DESTROYSURFACEDATA

DdCreateSurface