|
|
|
IDirectInputEffect |
|
' ****************************************************************************************
' IDirectInputEffect interface
' ****************************************************************************************
' ****************************************************************************************
' Applications use the methods of the IDirectInputEffect interface to manage effects of
' force-feedback devices.
' The interface is obtained by using the IDirectInputDevice8::CreateEffect method.
' ****************************************************************************************
' ****************************************************************************************
'DECLARE_INTERFACE_(IDirectInputEffect, IUnknown)
'{
' /*** IUnknown methods ***/
' 0. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
' 1. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
' 2. STDMETHOD_(ULONG,Release)(THIS) PURE;
' /*** IDirectInputEffect methods ***/
' 3. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
' 4. STDMETHOD(GetEffectGuid)(THIS_ LPGUID) PURE;
' 5. STDMETHOD(GetParameters)(THIS_ LPDIEFFECT,DWORD) PURE;
' 6. STDMETHOD(SetParameters)(THIS_ LPCDIEFFECT,DWORD) PURE;
' 7. STDMETHOD(Start)(THIS_ DWORD,DWORD) PURE;
' 8. STDMETHOD(Stop)(THIS) PURE;
' 9. STDMETHOD(GetEffectStatus)(THIS_ LPDWORD) PURE;
' 10. STDMETHOD(Download)(THIS) PURE;
' 11. STDMETHOD(Unload)(THIS) PURE;
' 12. STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
'};
' ****************************************************************************************
' ****************************************************************************************
' Initialize method
' Initializes a DirectInputEffect object.
' HRESULT Initialize(
' HINSTANCE hinst,
' DWORD dwVersion,
' REFGUID rguid
' );
' ****************************************************************************************
FUNCTION IDirectInputEffect_Initialize ALIAS "IDirectInputEffect_Initialize" ( _
BYVAL pthis AS DWORD PTR, BYVAL hinst AS DWORD, BYVAL dwVersion AS DWORD, _
BYREF rguid AS GUID) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[3] USING IDirectInputEffect_Initialize(pthis, hinst, dwVersion, rguid) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' GetEffectGuid method
' Retrieves the globally unique identifier (GUID) for the effect represented by the
' IDirectInputEffect object.
' HRESULT GetEffectGuid(
' LPGUID pguid
' );
' ****************************************************************************************
FUNCTION IDirectInputEffect_GetEffectGuid ALIAS "IDirectInputEffect_GetEffectGuid" ( _
BYVAL pthis AS DWORD PTR, BYREF rguid AS GUID) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[4] USING IDirectInputEffect_GetEffectGuid(pthis, rguid) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' GetParameters method
' Retrieves information about an effect.
' HRESULT GetParameters(
' LPDIEFFECT peff,
' DWORD dwFlags
' );
' ****************************************************************************************
FUNCTION IDirectInputEffect_GetParameters ALIAS "IDirectInputEffect_GetParameters" ( _
BYVAL pthis AS DWORD PTR, BYREF peff AS DIEFFECT, BYREF dwFlags AS DWORD) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[5] USING IDirectInputEffect_GetParameters(pthis, peff, dwFLags) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' SetParameters method
' Sets the characteristics of an effect.
' HRESULT SetParameters(
' LPCDIEFFECT peff,
' DWORD dwFlags
' );
' ****************************************************************************************
FUNCTION IDirectInputEffect_SetParameters ALIAS "IDirectInputEffect_SetParameters" ( _
BYVAL pthis AS DWORD PTR, BYREF peff AS DIEFFECT, BYVAL dwFlags AS DWORD) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[6] USING IDirectInputEffect_SetParameters(pthis, peff, dwFLags) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Start method
' Begins playing an effect. If the effect is already playing, it is restarted from the
' beginning. If the effect has not been downloaded or has been modified since its last
' download, it is downloaded before being started. This default behavior can be suppressed
' by passing the DIES_NODOWNLOAD flag.
' HRESULT Start(
' DWORD dwIterations,
' DWORD dwFlags
' );
' ****************************************************************************************
FUNCTION IDirectInputEffect_Start ALIAS "IDirectInputEffect_Start" ( _
BYVAL pthis AS DWORD PTR, BYVAL dwIterations AS DWORD, BYVAL dwFlags AS DWORD) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[7] USING IDirectInputEffect_Start(pthis, dwIterations, dwFLags) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Stop method
' Stops playing an effect.
' HRESULT Stop(VOID);
' ****************************************************************************************
FUNCTION IDirectInputEffect_Stop ALIAS "IDirectInputEffect_Stop" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[8] USING IDirectInputEffect_Stop(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' GetEffectStatus method
' Retrieves the status of an effect.
' HRESULT GetEffectStatus(
' LPDWORD pdwFlags
' );
' ****************************************************************************************
FUNCTION IDirectInputEffect_GetEffectStatus ALIAS "IDirectInputEffect_GetEffectStatus" ( _
BYVAL pthis AS DWORD PTR, BYREF pdwFlags AS DWORD) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[9] USING IDirectInputEffect_GetEffectStatus(pthis, pdwFLags) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Download method
' Places the effect on the device. If the effect is already on the device, the existing
' effect is updated to match the values set by the IDirectInputEffect::SetParameters method.
' HRESULT Download(VOID);
' ****************************************************************************************
FUNCTION IDirectInputEffect_Download ALIAS "IDirectInputEffect_Download" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[10] USING IDirectInputEffect_Download(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Unload method
' Removes the effect from the device. If the effect is playing, it is automatically
' stopped before it is unloaded.
' HRESULT Unload(VOID);
' ****************************************************************************************
FUNCTION IDirectInputEffect_Unload ALIAS "IDirectInputEffect_Unload" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[11] USING IDirectInputEffect_Unload(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Escape method
' Sends a hardware-specific command to the driver.
' HRESULT Escape(
' LPDIEFFESCAPE pesc
' );
' ****************************************************************************************
FUNCTION IDirectInputEffect_Escape ALIAS "IDirectInputEffect_Escape" ( _
BYVAL pthis AS DWORD PTR, BYREF pesc AS DIEFFESCAPE) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[12] USING IDirectInputEffect_Escape(pthis, pesc) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
|
Page last updated on Wednesday, 15 March 2006 00:48:05 +0100