CAggDirectDraw Class

CAggDirectDraw class hierarchy

The CAggDirectDraw class aggregates an IDirectDraw interface. Although Microsoft® DirectDraw® interfaces (IDirectDraw and IDirectDrawSurface) potentially have the ability to be aggregated, this feature is not yet implemented. Various parts of Microsoft DirectShow® require aggregation of the DirectDraw interfaces. In particular, the video renderer passes out media samples that expose IDirectDraw and IDirectDrawSurface. This class and the CAggDrawSurface class republish the methods of the DirectDraw class so that they can be aggregated.

Each member function in this class, with the exception of the constructor, SetDirectDraw, and NonDelegatingQueryInterface, simply calls the corresponding method on the IDirectDraw interface with the parameters passed to it.

Protected Data Members

m_pDirectDraw DirectDraw object.

Member Functions

CAggDirectDraw Constructs a CAggDirectDraw object.
SetDirectDraw Sets the DirectDraw object to be aggregated by this class.

Overridable Member Functions

NonDelegatingQueryInterface Retrieves an interface and increments the reference count.

Implemented IDirectDraw Methods

Compact Moves all the pieces of surface memory on the video card to a contiguous block to make the largest chunk of free memory available.
CreateClipper Creates a DirectDrawClipper object.
CreatePalette Creates a DirectDrawPalette object for this DirectDraw object.
CreateSurface Creates a DirectDrawSurface object for this DirectDraw object.
DuplicateSurface Duplicates a DirectDrawSurface object.
EnumDisplayModes Enumerates all the display modes the hardware exposes through the DirectDraw object that are compatible with a provided surface description.
EnumSurfaces Enumerates all the existing or possible surfaces that meet the search criterion specified.
FlipToGDISurface Makes the surface that GDI writes to the primary surface.
GetCaps Fills in the raw (not remaining) capabilities of the device driver (the hardware) and/or the Hardware Emulation Layer (HEL).
GetDisplayMode Retrieves the current display mode.
GetFourCCCodes Retrieves the FOURCC codes supported by the DirectDraw object.
GetGDISurface Retrieves the DirectDrawSurface object that currently represents the surface memory that GDI treats as the primary surface.
GetMonitorFrequency Retrieves the frequency of the monitor being driven by the DirectDraw object.
GetScanLine Retrieves the scan line that the monitor is currently updating to the display.
GetVerticalBlankStatus Retrieves the status of the vertical blank.
Initialize Initializes the DirectDraw object.
RestoreDisplayMode Resets the mode of the display device hardware for the primary surface to what it was before the CAggDirectDraw::SetDisplayMode member function was called.
SetCooperativeLevel Determines the top-level behavior of the application.
SetDisplayMode Sets the mode of the display device hardware.
WaitForVerticalBlank Helps the caller synchronize itself with the vertical blank interval.

CAggDirectDraw::CAggDirectDraw

CAggDirectDraw Class

Constructs a CAggDirectDraw object.

Syntax

CAggDirectDraw(
    TCHAR *pName,
    LPUNKNOWN pUnk
    );

Parameters

pName
Pointer to the object's name; used for debugging purposes.
pUnk
Pointer to the owner of this object. If non-NULL, IUnknown calls are delegated to this object.

Return Value

No return value.

Remarks

This member function calls the CUnknown::CUnknown base class constructor and sets the m_pDirectDraw member variable to NULL.

CAggDirectDraw::NonDelegatingQueryInterface

CAggDirectDraw Class

Retrieves an interface and increments the reference count.

Syntax

HRESULT NonDelegatingQueryInterface(
    REFIID riid,
    void **ppv
    );

Parameters

riid
Reference identifier.
ppv
Address of a pointer to the interface.

Return Value

Returns E_POINTER if ppv is invalid. Returns NOERROR if the query is successful or E_NOINTERFACE if it is not.

Remarks

This member function provides an implementation of the INonDelegatingUnknown::NonDelegatingQueryInterface method. By default it passes out references to IDirectDraw and then calls the CUnknown::NonDelegatingQueryInterface member function for base class interface references. Override this class to return interfaces added in the derived class.

CAggDirectDraw::SetDirectDraw

CAggDirectDraw Class

Sets the DirectDraw object to be aggregated by this class.

Syntax

void SetDirectDraw(
    LPDIRECTDRAW pDirectDraw
    );

Parameters

pDirectDraw
Pointer to the IDirectDraw object to be aggregated.

Return Value

No return value.

Remarks

This member function sets the m_pDirectDraw data member to the pDirectDraw parameter.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.