Platform SDK: DirectX

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 this interface. For a conceptual overview, see The DirectDraw Object.

The methods of the IDirectDraw7 interface can be organized into the following groups:

Allocating memory Compact
  Initialize
Cooperative levels SetCooperativeLevel
  TestCooperativeLevel
Creating objects CreateClipper
  CreatePalette
CreateSurface
Device capabilities GetCaps
Display modes EnumDisplayModes
  GetDisplayMode
GetMonitorFrequency
RestoreDisplayMode
SetDisplayMode
WaitForVerticalBlank
Display status GetScanLine
  GetVerticalBlankStatus
Miscellaneous EvaluateMode
  GetAvailableVidMem
GetDeviceIdentifier
GetFourCCCodes
StartModeTest
Surface management DuplicateSurface
  EnumSurfaces
FlipToGDISurface
GetGDISurface
GetSurfaceFromDC
RestoreAllSurfaces

The IDirectDraw7 interface, like all COM interfaces, inherits the IUnknown interface methods. The IUnknown interface supports the following three methods:

IUnknown AddRef
  QueryInterface
Release

The IDirectDraw7 interface extends the features of previous versions of the interface by offering methods enabling more flexible surface management than previous versions. All the surface-related methods in the IDirectDraw7 interface accept slightly different parameters than their counterparts in the IDirectDraw2 interface. Wherever an IDirectDraw2 interface method might accept a DDSURFACEDESC structure and retrieve an IDirectDrawSurface3 interface, the methods in IDirectDraw7 accept a DDSURFACEDESC2 structure and retrieve an IDirectDrawSurface7 interface, instead.

IDirectDraw7 introduces improved compliance with COM rules dictating the lifetime of child objects. For more information, see Parent and Child Object Lifetimes.

Use the LPDIRECTDRAW, LPDIRECTDRAW2, LPDIRECTDRAW4 or LPDIRECTDRAW7 data types to declare a variable that contains a pointer to an IDirectDraw, IDirectDraw2, IDirectDraw4 or IDirectDraw7 interface. The Ddraw.h header file declares these data types with the following code:

typedef struct IDirectDraw     FAR *LPDIRECTDRAW;
typedef struct IDirectDraw2    FAR *LPDIRECTDRAW2;
typedef struct IDirectDraw4    FAR *LPDIRECTDRAW4;
typedef struct IDirectDraw7    FAR *LPDIRECTDRAW7;

Requirements

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