DirectShow™ 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
Name | Description |
CLoadDirectDraw | Constructs a CLoadDirectDraw object. |
GetDirectDraw | Retrieves a pointer to the IDirectDraw interface. |
IsDirectDrawLoaded | Verifies that DirectDraw is loaded. |
LoadDirectDraw | Loads and initializes the DirectDraw library. |
ReleaseDirectDraw | Releases the IDirectDraw interface. |
Constructs a CLoadDirectDraw object.
CLoadDirectDraw(void);
No return value.
Retrieves the DirectDraw interface.
LPDIRECTDRAW GetDirectDraw(void);
Returns a pointer to the IDirectDraw interface.
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.
HRESULT IsDirectDrawLoaded(void);
Returns S_OK if loaded; otherwise, returns S_FALSE.
Checks the version of DirectDraw installed on the current system.
BOOL IsDirectDrawVersion1(void);
Returns TRUE if the installed version of DirectDraw doesn't support the IDirectDraw2 interface; FALSE if m_pDirectDraw data member is NULL or the installed version of DirectDraw supports IDirectDraw2.
The video renderer must know what the installed version of DirectDraw is to perform certain tasks, such as full-screen playback, which is supported by the IDirectDraw2 interface.
Loads and initializes the DirectDraw library in the specified area.
HRESULT LoadDirectDraw(
LPSTR szDevice
);
Returns S_OK if DirectDraw loaded correctly or E_NOINTERFACE otherwise.
DirectDraw is not always available, so applications cannot 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.
void ReleaseDirectDraw(void);
No return value.
This member function is called to release any IDirectDraw interface previously loaded. Call this only when all reference counts have been released.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.