Index Topic Contents | |||
Previous Topic: CImageSample Class Next Topic: CMediaControl Class |
CLoadDirectDraw Class
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. IsDirectDrawVersion1 Checks the version of DirectDraw installed on the current system. LoadDirectDraw Loads and initializes the DirectDraw library. ReleaseDirectDraw Releases the IDirectDraw interface. CLoadDirectDraw Class
CLoadDirectDraw::CLoadDirectDrawConstructs a CLoadDirectDraw object.
CLoadDirectDraw(void);
Return Values
No return value.
CLoadDirectDraw Class
CLoadDirectDraw::GetDirectDrawRetrieves the DirectDraw interface.
LPDIRECTDRAW GetDirectDraw(void);
Return Values
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.
CLoadDirectDraw Class
CLoadDirectDraw::IsDirectDrawLoadedVerifies that this object loaded DirectDraw.
HRESULT IsDirectDrawLoaded(void);
Return Values
Returns S_OK if loaded; otherwise, returns S_FALSE.
CLoadDirectDraw Class
CLoadDirectDraw::IsDirectDrawVersion1Checks the version of DirectDraw installed on the current system.
BOOL IsDirectDrawVersion1(void);
Return Values
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.
CLoadDirectDraw Class
CLoadDirectDraw::LoadDirectDrawLoads and initializes the DirectDraw library in the specified area.
HRESULT LoadDirectDraw(
LPSTR szDevice
);Parameters
- szDevice
- This parameter is optional; if omitted, this method loads DirectDraw to the base drawing area.
Return Values
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.
CLoadDirectDraw Class
CLoadDirectDraw::ReleaseDirectDrawReleases the IDirectDraw interface.
void ReleaseDirectDraw(void);
Return Values
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.
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.