Microsoft DirectX 8.0 (C++) |
Allocates resources for a buffer that was created with the DSBCAPS_LOCDEFER flag in the DSBUFFERDESC structure.
HRESULT AcquireResources( DWORD dwFlags, DWORD dwEffectsCount, LPDWORD pdwResultCodes );
This parameter can be NULL if result codes are not wanted.
If the method succeeds, the return value is DS_OK or DS_INCOMPLETE.
If the method fails, the return value may be one of the following error values:
DSERR_CONTROLUNAVAIL |
DSERR_INVALIDCALL |
DSERR_INVALIDPARAM |
Normally, buffers created with DSBCAPS_LOCDEFER are not allocated resources until IDirectSoundBuffer8::Play is called. IDirectSoundBuffer8::AcquireResources can be used to allocate resources for deferred buffers. By doing so, the application can retrieve information about effects processing and set effect parameters before the buffer is played.
If the method fails, check the values in pdwResultCodes to determine which effects caused the failure.
A buffer with acquired resources that is not yet playing is not a candidate for premature termination by the voice management flags passed to the Play method.
Resources that have been acquired by AcquireResources are released when playback is stopped.
If the method is called on a buffer on which it has already been called, the status of the effects is returned but no additional resources are allocated.
The dwEffectsCount parameter to this function must be the same as the one passed in the call to IDirectSoundBuffer8::SetFX.
If an attempt is made to acquire resources for a buffer with the DSBCAPS_LOCHARDWARE flag on a system where hardware acceleration is not available, the method fails with either DSERR_CONTROLUNAVAIL or DSERR_INVALIDCALL, depending on the operating system.
Header: Declared in dsound.h.