CAggDrawSurface Class

CAggDrawSurface class hierarchy

The CAggDrawSurface class aggregates an IDirectDrawSurface interface. Although Microsoft® DirectDraw® interfaces (IDirectDraw and IDirectDrawSurface) potentially can 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 CAggDirectDraw 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, SetDirectDrawSurface, and NonDelegatingQueryInterface, simply calls the corresponding method on the IDirectDrawSurface interface with the parameters passed to it.

Protected Data Members

m_pDirectDrawSurface DirectDraw surface.

Member Functions

CAggDrawSurface Constructs a CAggDrawSurface object.
SetDirectDrawSurface Sets the DirectDraw object to be aggregated by this class. This must be called before any of the IDirectDrawSurface interface methods can be called.

Overridable Member Functions

NonDelegatingQueryInterface Retrieves an interface and increments the reference count.

Implemented IDirectDrawSurface Methods

AddAttachedSurface Attaches a surface to another surface. Examples of possible attachments include z-buffers, alpha channels, and back buffers.
AddOverlayDirtyRect Builds up the list of the rectangles that must be updated the next time the UpdateOverlayDisplay member function is called.
Blt Performs a bit-block transfer.
BltBatch Performs a sequence of CAggDrawSurface::Blt operations from several sources to a single destination.
BltFast Performs a source copy bit-block transfer or transparent bit-block transfer using a source or destination color key.
DeleteAttachedSurface Detaches two attached surfaces.
EnumAttachedSurfaces Enumerates all the surfaces attached to a given surface.
EnumOverlayZOrders Enumerates the overlays on the specified destination. The overlays can be enumerated in front-to-back or back-to-front order.
Flip Makes the surface memory associated with the DDSCAPS_BACKBUFFER surface become associated with the FRONTBUFFER surface.
GetAttachedSurface Finds the attached surface that has the specified capabilities.
GetBltStatus Retrieves the status of a bit block transfer.
GetCaps Retrieves the capabilities of the surface.
GetClipper Retrieves the DirectDrawClipper object associated with this surface.
GetColorKey Retrieves the color key value for the DirectDrawSurface object.
GetDC Creates a GDI-compatible hDC for the surface.
GetFlipStatus Returns OK if the surface that it is called on has finished its flipping process; otherwise, returns DDERR_WASSTILLDRAWING.
GetOverlayPosition Retrieves the display coordinates of the surface, given a visible, active overlay surface (DDSCAPS_OVERLAY set).
GetPalette Retrieves the DirectDrawPalette structure associated with this surface.
GetPixelFormat Retrieves the color and pixel format of the surface.
GetSurfaceDesc Retrieves a DDSURFACEDESC structure describing the surface in its current condition.
Initialize Initializes a DirectDrawSurface object.
IsLost Determines if the surface memory associated with a DirectDrawSurface object has been freed.
Lock Obtains a valid pointer to the surface memory.
ReleaseDC Releases a GDI-compatible hDC previously obtained through CAggDrawSurface::GetDC.
Restore Restores a surface that has been "lost." The surface memory associated with the DirectDrawSurface object has been freed.
SetClipper Attaches a DirectDrawClipper object to a DirectDrawSurface object.
SetColorKey Sets the color key value for the DirectDrawSurface object if the hardware supports color keys on a per-surface basis.
SetOverlayPosition Changes the display coordinates of an overlay surface.
SetPalette Attaches the DirectDrawPalette object specified to a DirectDrawSurface.
Unlock Notifies DirectDraw that the direct surface manipulations are complete.
UpdateOverlay Repositions and/or modifies the visual attributes of an overlay surface. These surfaces must have the DDSCAPS_OVERLAY bit set.
UpdateOverlayDisplay Repaints the rectangles in the dirty rectangle lists of all active overlays.
UpdateOverlayZOrder Sets an overlay's z-order. The z-order determines which overlay should be occluded when multiple overlays are displayed simultaneously.

CAggDrawSurface::CAggDrawSurface

CAggDrawSurface Class

Creates a CAggDrawSurface object.

Syntax

CAggDrawSurface(
  TCHAR *pName,
  LPUNKNOWN pUnk
  );

Parameters

pName
Pointer to the name of the object; used for debugging purposes.
pUnk
Pointer to the owner of this object. If non-NULL, IUnknown interface 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_pDirectDrawSurface member variable to NULL.

CAggDrawSurface::NonDelegatingQueryInterface

CAggDrawSurface 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 IDirectDrawSurface and then calls the CUnknown::NonDelegatingQueryInterface member function for base class interface references. Override this class to return interfaces added in the derived class.

CAggDrawSurface::SetDirectDrawSurface

CAggDrawSurface Class

Called by the owner of this aggregation object to set the actual DirectDraw surface it is aggregating upon.

Syntax

void SetDirectDrawSurface(
  LPDIRECTDRAWSURFACE pDirectDrawSurface
  );

Parameters

pDirectDrawSurface
Pointer to the DirectDraw surface to be set.

Return Value

No return value.

Remarks

This member function must be called before any of the IDirectDrawSurface interface methods can be called.


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