IDirectDraw7 interface (ddraw.h)

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.

Inheritance

The IDirectDraw7 interface inherits from the IUnknown interface. IDirectDraw7 also has these types of members:

Methods

The IDirectDraw7 interface has these methods.

 
IDirectDraw7::Compact

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

Creates a DirectDrawClipper object.
IDirectDraw7::CreatePalette

Creates a DirectDrawPalette object for this DirectDraw object.
IDirectDraw7::CreateSurface

Creates a DirectDrawSurface object for this DirectDraw object.
IDirectDraw7::DuplicateSurface

Duplicates a DirectDrawSurface object.
IDirectDraw7::EnumDisplayModes

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

Enumerates all the existing or possible surfaces that meet the specified surface description.
IDirectDraw7::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.
IDirectDraw7::FlipToGDISurface

Makes the surface that the GDI writes to the primary surface.
IDirectDraw7::GetAvailableVidMem

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

Retrieves the capabilities of the device driver for the hardware and the hardware emulation layer (HEL).
IDirectDraw7::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.
IDirectDraw7::GetDisplayMode

Retrieves the current display mode.
IDirectDraw7::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.
IDirectDraw7::GetGDISurface

Retrieves the DirectDrawSurface object that currently represents the surface memory that GDI is treating as the primary surface.
IDirectDraw7::GetMonitorFrequency

Retrieves the frequency of the monitor that the DirectDraw object controls.
IDirectDraw7::GetScanLine

Retrieves the scan line that is currently being drawn on the monitor.
IDirectDraw7::GetSurfaceFromDC

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

Retrieves the status of the vertical blank.
IDirectDraw7::Initialize

Initializes a DirectDraw object that was created by using the CoCreateInstance COM function.
IDirectDraw7::RestoreAllSurfaces

Restores all the surfaces that were created for the DirectDraw object, in the order that they were created.
IDirectDraw7::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.
IDirectDraw7::SetCooperativeLevel

Determines the top-level behavior of the application.
IDirectDraw7::SetDisplayMode

Sets the mode of the display-device hardware.
IDirectDraw7::StartModeTest

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

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

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

Remarks

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

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

The IDirectDraw7 interface extends the features of previous versions of the interface by offering methods that enable 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 that dictate the lifetime of child objects.

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

Requirement Value
Target Platform Windows
Header ddraw.h