Applications use the methods of the IDirectDraw4 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 IDirectDraw4 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 | GetAvailableVidMem |
GetDeviceIdentifier | |
GetFourCCCodes | |
Surface management | DuplicateSurface |
EnumSurfaces | |
FlipToGDISurface | |
GetGDISurface | |
GetSurfaceFromDC | |
RestoreAllSurfaces |
The IDirectDraw4 interface, like all COM interfaces, inherits the IUnknown interface methods. The IUnknown interface supports the following three methods:
IUnknown | AddRef |
QueryInterface | |
Release |
The IDirectDraw4 interface extends the features of previous versions of the interface by offering methods enabling more flexible surface management than previous versions. Note that all of the surface-related methods in the IDirectDraw4 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 IDirectDraw4 accept a DDSURFACEDESC2 structure and retrieve an IDirectDrawSurface4 interface instead.
IDirectDraw4 introduces improved compliance with COM rules dictating the lifetimes of child objects. For more information, see Parent and Child Object Lifetimes.
You can use the LPDIRECTDRAW, LPDIRECTDRAW2, or LPDIRECTDRAW4 data types to declare a variable that contains a pointer to an IDirectDraw, IDirectDraw2, or IDirectDraw4 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;
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in ddraw.h.
Import Library: Use ddraw.lib.