DirectShow Animated Header -- CAggDirectDraw Class DirectShow Animated Header -- CAggDirectDraw Class* Microsoft DirectShow SDK
*Index  *Topic Contents
*Previous Topic: Introduction to the DirectShow C++ Class Library
*Next Topic: CAggDrawSurface Class

CAggDirectDraw Class


CAggDirectDraw class hierarchy

This class aggregates an IDirectDraw interface. Although 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
Name Description
m_pDirectDraw DirectDraw object.

Member Functions
Name Description
CAggDirectDraw Constructs a CAggDirectDraw object.
SetDirectDraw Sets the DirectDraw object to be aggregated by this class.

Overridable Member Functions
Name Description
NonDelegatingQueryInterface Returns an interface and increments the reference count.

Implemented IDirectDraw Methods
Name Description
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 Returns the current display mode.
GetFourCCCodes Gets the FOURCC codes supported by the DirectDraw object.
GetGDISurface Returns the DirectDrawSurface object that currently represents the surface memory that GDI treats as the primary surface.
GetMonitorFrequency Points to a DirectDrawSurface pointer that will be made to point to the DirectDrawSurface object currently controlling GDI's primary surface memory.
GetScanLine Returns the scan line that the monitor is currently updating to the display.
GetVerticalBlankStatus Returns 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.

CAggDirectDraw(
  TCHAR *pName,
  LPUNKNOWN pUnk
  );

Parameters
pName
Name of the object; used for debugging purposes.
pUnk
Pointer to the owner of this object. If non-NULL, IUnknown calls are delegated to this object.
Return Values

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

Returns an interface and increments the reference count.

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

Parameters
riid
Reference identifier.
ppv
Pointer to the interface.
Return Values

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.

void SetDirectDraw(
  LPDIRECTDRAW pDirectDraw
  );

Parameters
pDirectDraw
IDirectDraw object to be aggregated.
Return Values

No return value.

Remarks

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

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.

*Top of Page