次の方法で共有


IDirectDrawVideo::SetDirectDraw (Compact 2013)

3/26/2014

This method passes the IDirectDraw interface to a loaded driver.

Syntax

HRESULT SetDirectDraw(
  LPDIRECTDRAW pDirectDraw 
);

Parameters

Return Value

Returns an HRESULT value.

Remarks

To have the renderer release a DirectDraw interface previously passed in through SetDirectDraw, an application can call SetDirectDraw and pass in NULL. However, the renderer continues using that DirectDraw interface until it is disconnected.

Therefore, calling SetDirectDraw with a null parameter does not make the renderer stop using it immediately.

This method was created because only one instance of IDirectDraw could be loaded per process in DirectDraw 1.0.

If an application wanted to load IDirectDraw but allow the renderer to also allocate surfaces, the application could open IDirectDraw and then pass the interface to the loaded driver through IDirectDrawVideo::SetDirectDraw.

Alternatively, the application could let the renderer load DirectDraw and then obtain a reference-incremented interface to it through IDirectDrawVideo::GetDirectDraw.

Because DirectShow ships with the most recently shipped version of DirectDraw, this method is not required unless the application wants to change display modes itself and pass in a DirectDraw object, which the renderer can then use to allocate surfaces.

Requirements

Header

dshow.h

Library

Strmiids.lib

See Also

Reference

IDirectDrawVideo Interface