Microsoft® DirectShowreg; must work on multiple platforms; in particular, it also runs on Microsoft Windows NT® 3.51, which does not have DirectDraw® capabilities. The filters therefore cannot link statically to the DirectDraw library. To make the platform dependencies easier to handle, this class manages loading and unloading the library and creating the initial IDirectDraw interface.
Member Functions
CLoadDirectDraw Constructs a CLoadDirectDraw object. GetDirectDraw Retrieves a pointer to the IDirectDraw interface. IsDirectDrawLoaded Verifies that DirectDraw is loaded. IsDirectDrawVersion1 Checks the version of DirectDraw installed on the current system. LoadDirectDraw Loads and initializes the DirectDraw library. ReleaseDirectDraw Releases the IDirectDraw interface.
Constructs a CLoadDirectDraw object.
Syntax
CLoadDirectDraw(void);
Return Value
No return value.
Retrieves the DirectDraw interface.
Syntax
LPDIRECTDRAW GetDirectDraw(void);
Return Value
Returns a pointer to the IDirectDraw interface.
Remarks
Call CLoadDirectDraw::LoadDirectDraw before calling this member function and call the CLoadDirectDraw::ReleaseDirectDraw member function to release the interface when you are done.
Verifies that this object loaded DirectDraw.
Syntax
HRESULT IsDirectDrawLoaded(void);
Return Value
Returns S_OK if loaded; otherwise, returns S_FALSE.
Checks the version of DirectDraw installed on the current system.
Syntax
BOOL IsDirectDrawVersion1(void);
Return Value
Returns TRUE if the installed version of DirectDraw doesn't support the IDirectDraw2 interface, or FALSE if the m_pDirectDraw data member is NULL or the installed version of DirectDraw supports IDirectDraw2.
Remarks
The video renderer must know what the installed version of DirectDraw is to perform certain tasks, such as full-screen playback, which the IDirectDraw2 interface supports.
Loads and initializes the DirectDraw library in the specified area.
Syntax
HRESULT LoadDirectDraw(
LPSTR szDevice
);
Parameters
- szDevice
- This parameter is optional; if omitted, this method loads DirectDraw to the base drawing area.
Return Value
Returns S_OK if DirectDraw loaded correctly or E_NOINTERFACE otherwise.
Remarks
DirectDraw is not always available, so applications can't statically link to the library. Therefore, this member function loads the library, gets the function entry point addresses, and calls them to create the driver objects. Call this member function before calling CLoadDirectDraw::GetDirectDraw to retrieve the IDirectDraw interface.
Releases the IDirectDraw interface.
Syntax
void ReleaseDirectDraw(void);
Return Value
No return value.
Remarks
This member function is called to release any IDirectDraw interface previously loaded. Call this only when all reference counts have been released.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.