Applications use the methods of the IDirectDraw2 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 IDirectDraw2 interface can be organized into the following groups:
| Allocating memory | Compact |
| Initialize | |
| Creating objects | CreateClipper |
| CreatePalette | |
| CreateSurface | |
| Device capabilities | GetCaps |
| Display modes | EnumDisplayModes |
| GetDisplayMode | |
| GetMonitorFrequency | |
| RestoreDisplayMode | |
| SetDisplayMode | |
| WaitForVerticalBlank | |
| Display status | GetScanLine |
| GetVerticalBlankStatus | |
| Miscellaneous | GetAvailableVidMem |
| GetFourCCCodes | |
| Setting behavior | SetCooperativeLevel |
| Surfaces | DuplicateSurface |
| EnumSurfaces | |
| FlipToGDISurface | |
| GetGDISurface | |
The IDirectDraw2 interface, like all COM interfaces, inherits the IUnknown interface methods. The IUnknown interface supports the following three methods:
| AddRef | |
| QueryInterface | |
| Release |
You can use the LPDIRECTDRAW or LPDIRECTDRAW data types to declare a variable that contains a pointer to an IDirectDraw or IDirectDraw2 interface. The Ddraw.h header file declares these data types with the following code:
typedef struct IDirectDraw FAR *LPDIRECTDRAW;
typedef struct IDirectDraw2 FAR *LPDIRECTDRAW2;