DirectDraw

Overview of the DirectDraw technology.

To develop DirectDraw, you need these headers:

For programming guidance for this technology, see:

Functions

 
AddAttachedSurface

Attaches the specified z-buffer surface to this surface.
AddOverlayDirtyRect

The IDirectDrawSurface7::AddOverlayDirtyRect method is not currently implemented.
Blt

Performs a bit block transfer (bitblt). This method does not support z-buffering or alpha blending during bitblt operations.
BltBatch

The IDirectDrawSurface7::BltBatch method is not currently implemented.
BltFast

Performs a source copy bitblt or transparent bitblt by using a source color key or destination color key.
ChangeUniquenessValue

Manually updates the uniqueness value for this surface.
Compact

This method is not currently implemented. (IDirectDraw7.Compact)
CreateClipper

Creates a DirectDrawClipper object.
CreatePalette

Creates a DirectDrawPalette object for this DirectDraw object.
CreateSurface

Creates a DirectDrawSurface object for this DirectDraw object.
DeleteAttachedSurface

Detaches one or more attached surfaces.
DirectDrawCreate

Creates an instance of a DirectDraw object.
DirectDrawCreateClipper

Creates an instance of a DirectDrawClipper object that is not associated with a DirectDraw object.
DirectDrawCreateEx

Creates an instance of a DirectDraw object that supports the set of Direct3D interfaces in DirectX 7.0. To use the features of Direct3D in DirectX 7.0, create a DirectDraw object with this function.
DirectDrawEnumerateA

This function is superseded by the DirectDrawEnumerateEx function. (ANSI)
DirectDrawEnumerateExA

Enumerates all DirectDraw devices that are installed on the computer. The NULL entry always identifies the primary display device that is shared with GDI. (ANSI)
DirectDrawEnumerateExW

Enumerates all DirectDraw devices that are installed on the computer. The NULL entry always identifies the primary display device that is shared with GDI. (Unicode)
DirectDrawEnumerateW

This function is superseded by the DirectDrawEnumerateEx function. (Unicode)
DuplicateSurface

Duplicates a DirectDrawSurface object.
EnumAttachedSurfaces

Enumerates all the surfaces that are attached to this surface.
EnumDisplayModes

Enumerates all the display modes that the hardware exposes through the DirectDraw object and that are compatible with a provided surface description.
EnumOverlayZOrders

Enumerates the overlay surfaces on the specified destination. You can enumerate the overlays in front-to-back or back-to-front order.
EnumSurfaces

Enumerates all the existing or possible surfaces that meet the specified surface description.
EvaluateMode

Used after a call to IDirectDraw7::StartModeTest to pass or fail each mode that the test presents and to step through the modes until the test is complete.
Flip

Makes the surface memory that is associated with the DDSCAPS_BACKBUFFER surface become associated with the front-buffer surface.
FlipToGDISurface

Makes the surface that the GDI writes to the primary surface.
FreePrivateData

Frees the specified private data that is associated with this surface.
GetAttachedSurface

Obtains the attached surface that has the specified capabilities, and increments the reference count of the retrieved interface.
GetAvailableVidMem

Retrieves the total amount of display memory available and the amount of display memory currently free for a given type of surface.
GetBltStatus

Obtains status about a bit block transfer (bitblt) operation.
GetCaps

Retrieves the capabilities of the device driver for the hardware and the hardware emulation layer (HEL).
GetCaps

Retrieves the capabilities of the palette object.
GetCaps

Retrieves the capabilities of this surface. These capabilities are not necessarily related to the capabilities of the display device.
GetClipList

Retrieves a copy of the clip list that is associated with a DirectDrawClipper object. To select a subset of the clip list, you can pass a rectangle that clips the clip list.
GetClipper

Retrieves the DirectDrawClipper object that is associated with this surface, and increments the reference count of the returned clipper.
GetColorControls

Retrieves the current color-control settings that are associated with an overlay or a primary surface.
GetColorKey

Retrieves the color key value for this surface.
GetDC

Creates a GDI-compatible handle of a device context for this surface.
GetDDInterface

Retrieves an interface to the DirectDraw object that was used to create this surface.
GetDeviceIdentifier

Obtains information about the device driver. This method can be used, with caution, to recognize specific hardware installations to implement workarounds for poor driver or chipset behavior.
GetDisplayMode

Retrieves the current display mode.
GetEntries

Retrieves palette values from a DirectDrawPalette object.
GetFlipStatus

Retrieves status about whether this surface has finished its flipping process.
GetFourCCCodes

Retrieves the four-character codes (FOURCC) that are supported by the DirectDraw object. This method can also retrieve the number of codes that are supported.
GetGammaRamp

Retrieves the red, green, and blue gamma ramps for the primary surface.
GetGDISurface

Retrieves the DirectDrawSurface object that currently represents the surface memory that GDI is treating as the primary surface.
GetHWnd

Retrieves the window handle that was previously associated with this DirectDrawClipper object by the IDirectDrawClipper::SetHWnd method.
GetLOD

Retrieves the maximum level of detail (LOD) currently set for a managed mipmap surface. This method succeeds only on managed textures.
GetMonitorFrequency

Retrieves the frequency of the monitor that the DirectDraw object controls.
GetOverlayPosition

Retrieves the display coordinates of this surface. This method is used on a visible, active overlay surface (that is, a surface that has the DDSCAPS_OVERLAY flag set).
GetPalette

Retrieves the DirectDrawPalette object that is associated with this surface, and increments the reference count of the returned palette.
GetPixelFormat

Retrieves the color and pixel format of this surface.
GetPriority

Retrieves the texture-management priority for this texture. This method succeeds only on managed textures.
GetPrivateData

Copies the private data that is associated with this surface to a provided buffer.
GetScanLine

Retrieves the scan line that is currently being drawn on the monitor.
GetSurfaceDesc

Retrieves a description of this surface in its current condition.
GetSurfaceFromDC

Retrieves the IDirectDrawSurface7 interface for a surface, based on its GDI device context handle.
GetUniquenessValue

Retrieves the current uniqueness value for this surface.
GetVerticalBlankStatus

Retrieves the status of the vertical blank.
Initialize

Initializes a DirectDraw object that was created by using the CoCreateInstance COM function.
Initialize

Initializes a DirectDrawClipper object that was created by using the CoCreateInstance COM function.
Initialize

Initializes the DirectDrawPalette object.
Initialize

Initializes a DirectDrawSurface object.
IsClipListChanged

Retrieves the status of the clip list if a window handle is associated with a DirectDrawClipper object.
IsLost

Determines whether the surface memory that is associated with a DirectDrawSurface object has been freed.
Lock

Obtains a pointer to the surface memory.
LPDDENUMCALLBACKA

The DDEnumCallback function is an application-defined callback function for the DirectDrawEnumerate function. (ANSI)
LPDDENUMCALLBACKEXA

The DDEnumCallbackEx function is an application-defined callback function for the DirectDrawEnumerateEx function. (ANSI)
LPDDENUMCALLBACKEXW

The DDEnumCallbackEx function is an application-defined callback function for the DirectDrawEnumerateEx function. (Unicode)
LPDDENUMCALLBACKW

The DDEnumCallback function is an application-defined callback function for the DirectDrawEnumerate function. (Unicode)
LPDDENUMMODESCALLBACK

Do not use. This callback function is superseded by the EnumModesCallback2 function that is used with the IDirectDraw7::EnumDisplayModes method.
LPDDENUMMODESCALLBACK2

The EnumModesCallback2 function is an application-defined callback function for the IDirectDraw7::EnumDisplayModes method.
LPDDENUMSURFACESCALLBACK

The LPDDENUMSURFACESCALLBACK function (ddraw.h) is superseded by the EnumSurfacesCallback7 function.
LPDDENUMSURFACESCALLBACK2

The LPDDENUMSURFACESCALLBACK2 function (ddraw.h) is superseded by the EnumSurfacesCallback7 function.
LPDDENUMSURFACESCALLBACK7

The EnumSurfacesCallback7 function is an application-defined callback function for the IDirectDrawSurface7::EnumAttachedSurfaces and IDirectDrawSurface7::EnumOverlayZOrders methods.
PageLock

Prevents a system-memory surface from being paged out while a bit block transfer (bitblt) operation that uses direct memory access (DMA) transfers to or from system memory is in progress.
PageUnlock

Unlocks a system-memory surface, which then allows it to be paged out.
ReleaseDC

Releases the handle of a device context that was previously obtained by using the IDirectDrawSurface7::GetDC method.
Restore

Restores a surface that has been lost. This occurs when the surface memory that is associated with the DirectDrawSurface object has been freed.
RestoreAllSurfaces

Restores all the surfaces that were created for the DirectDraw object, in the order that they were created.
RestoreDisplayMode

Resets the mode of the display device hardware for the primary surface to what it was before the IDirectDraw7::SetDisplayMode method was called. Exclusive-level access is required to use this method.
SetClipList

Sets or deletes the clip list that is used by the IDirectDrawSurface7::Blt, IDirectDrawSurface7::BltBatch, and IDirectDrawSurface7::UpdateOverlay methods on surfaces to which the parent DirectDrawClipper object is attached.
SetClipper

Attaches a clipper object to, or deletes one from, this surface.
SetColorControls

Sets the color-control options for an overlay or a primary surface.
SetColorKey

Sets the color key value for the DirectDrawSurface object if the hardware supports color keys on a per-surface basis.
SetCooperativeLevel

Determines the top-level behavior of the application.
SetDisplayMode

Sets the mode of the display-device hardware.
SetEntries

Changes entries in a DirectDrawPalette object immediately.
SetGammaRamp

Sets the red, green, and blue gamma ramps for the primary surface.
SetHWnd

Sets the window handle that the clipper object uses to obtain clipping information.
SetLOD

Sets the maximum level of detail (LOD) for a managed mipmap surface. This method succeeds only on managed textures.
SetOverlayPosition

Changes the display coordinates of an overlay surface.
SetPalette

Attaches a palette object to (or detaches one from) a surface. The surface uses this palette for all subsequent operations. The palette change takes place immediately, without regard to refresh timing.
SetPriority

Assigns the texture-management priority for this texture. This method succeeds only on managed textures.
SetPrivateData

Associates data with the surface that is intended for use by the application, not by DirectDraw. Data is passed by value, and multiple sets of data can be associated with a single surface.
SetSurfaceDesc

Sets the characteristics of an existing surface.
StartModeTest

Initiates a test to update the system registry with refresh rate information for the current display adapter and monitor combination.
TestCooperativeLevel

Reports the current cooperative-level status of the DirectDraw device for a windowed or full-screen application.
Unlock

Notifies DirectDraw that the direct surface manipulations are complete.
UpdateOverlay

Repositions or modifies the visual attributes of an overlay surface. These surfaces must have the DDSCAPS_OVERLAY flag set.
UpdateOverlayDisplay

The IDirectDrawSurface7::UpdateOverlayDisplay method is not currently implemented.
UpdateOverlayZOrder

Sets the z-order of an overlay.
WaitForVerticalBlank

Helps the application synchronize itself with the vertical-blank interval.

Interfaces

 
IDirectDraw7

Applications use the methods of the IDirectDraw7 interface to create DirectDraw objects and work with system-level variables. This section is a reference to the methods of the IDirectDraw7 interface.
IDirectDrawClipper

Applications use the methods of the IDirectDrawClipper interface to manage clip lists. This section is a reference to the methods of this interface.
IDirectDrawColorControl

Applications use the methods of the IDirectDrawColorControl interface to get and set color controls.
IDirectDrawGammaControl

Applications use the methods of the IDirectDrawGammaControl interface to adjust the red, green, and blue gamma ramp levels of the primary surface. This section is a reference to the methods of this interface.
IDirectDrawPalette

Applications use the methods of the IDirectDrawPalette interface to create DirectDrawPalette objects and work with system-level variables. This section is a reference to the methods of this interface.
IDirectDrawSurface7

Applications use the methods of the IDirectDrawSurface7 interface to create DirectDrawSurface objects and work with system-level variables. This section is a reference to the methods of this interface.

Structures

 
DDCOLORCONTROL

The DDCOLORCONTROL structure defines the color controls associated with a Microsoft DirectDraw video port extensions (VPE) object.
DDSURFACEDESC

The DDSURFACEDESC structure contains a description of a surface to be created by the driver.
DDSURFACEDESC2

The DDSURFACEDESC2 structure contains a description of a surface to be created by the driver.
DDBLTBATCH

The DDBLTBATCH structure passes bit block transfer (bitblt) operations to the IDirectDrawSurface7::BltBatch method.
DDBLTFX

The DDBLTFX structure passes raster operations (ROPs), effects, and override information to the IDirectDrawSurface7::Blt method. This structure is also part of the DDBLTBATCH structure that is used with the IDirectDrawSurface7::BltBatch method.
DDCAPS_DX3

The DDCAPS_DX3 structure (ddraw.h) represents the capabilities of the hardware exposed through the DirectDraw object.
DDCAPS_DX5

The DDCAPS_DX5 structure (ddraw.h) represents the capabilities of the hardware exposed through the DirectDraw object.
DDCAPS_DX6

The DDCAPS_DX6 structure (ddraw.h) represents the capabilities of the hardware exposed through the DirectDraw object.
DDCAPS_DX7

The DDCAPS_DX7 structure (ddraw.h) represents the capabilities of the hardware exposed through the DirectDraw object.
DDCOLORKEY

The DDCOLORKEY structure describes a source color key, destination color key, or color space.
DDDEVICEIDENTIFIER2

The DDDEVICEIDENTIFIER2 structure is passed to the IDirectDraw7::GetDeviceIdentifier method to obtain information about a device.
DDGAMMARAMP

The DDGAMMARAMP structure contains red, green, and blue ramp data for the IDirectDrawGammaControl::GetGammaRamp and IDirectDrawGammaControl::SetGammaRamp methods.
DDOVERLAYFX

The DDOVERLAYFX structure passes overlay information to the IDirectDrawSurface7::UpdateOverlay method.
DDPIXELFORMAT

The DDPIXELFORMAT structure describes the pixel format of a DirectDrawSurface object for the IDirectDrawSurface7::GetPixelFormat method.
DDSCAPS

The DDSCAPS structure defines the capabilities of a Microsoft DirectDraw surface object.
DDSCAPS2

The DDSCAPS2 structure defines additional capabilities of a Microsoft DirectDraw surface object.