DirectDraw Exclusive Mode

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

Note

This topic applies to the VMR-7 only. In the VMR-9, you enable exclusive mode by supplying your own exclusive mode allocator-presenter. This is relatively straightforward if you use the IVMRSurfaceAllocatorNotify9::AllocateSurfaceHelper method. The VMR9Allocator sample shows how to implement a custom allocator-presenter.

 

In DirectDraw Exclusive Mode, an application takes exclusive control of the graphics hardware. This is useful for applications such as games, or perhaps full-screen video applications. Normally, the VMR creates the DirectDraw objects and sets the cooperative level to normal. However, to run the VMR in DirectDraw Exclusive Mode, the application itself must create the DirectDraw object and the primary surface, and call SetCooperativeLevel to specify exclusive mode.

The VMR has a special allocator-presenter that enables it to run in DirectDraw Exclusive Mode. To configure the VMR to use this allocator-presenter:

  1. Create the Filter Graph and add the VMR to it using the IFilterGraph::AddFilter method. For a code example, see VMR Windowless Mode.

  2. Create the Exclusive Mode allocator-presenter:

    IVMRImagePresenterExclModeConfig* pExclModeConfig;
    CoCreateInstance(
            CLSID_AllocPresenterDDXclMode,
            NULL,
            CLSCTX_INPROC_SERVER,
            IID_IVMRImagePresenterExclModeConfig,
            (void**)&pExclModeConfig
            );
    
  3. Configure the new allocator-presenter:

    pExclModeConfig->SetXlcModeDDObjAndPrimarySurface(...);
    
  4. Plug the new allocator-presenter into the VMR.

  5. Build the rest of the filter graph in the usual ways.

VMR Modes of Operation