本文整理汇总了C++中LPDIRECTINPUTDEVICE8::SendForceFeedbackCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTINPUTDEVICE8::SendForceFeedbackCommand方法的具体用法?C++ LPDIRECTINPUTDEVICE8::SendForceFeedbackCommand怎么用?C++ LPDIRECTINPUTDEVICE8::SendForceFeedbackCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECTINPUTDEVICE8
的用法示例。
在下文中一共展示了LPDIRECTINPUTDEVICE8::SendForceFeedbackCommand方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPlayEffects
//-----------------------------------------------------------------------------
// Name: OnPlayEffects()
// Desc: Plays all of the effects enumerated in the file
//-----------------------------------------------------------------------------
HRESULT OnPlayEffects( HWND hDlg )
{
EFFECTS_NODE* pEffectNode = g_EffectsList.pNext;
LPDIRECTINPUTEFFECT pDIEffect = NULL;
HRESULT hr;
// Stop all previous forces
if( FAILED( hr = g_pFFDevice->SendForceFeedbackCommand( DISFFC_STOPALL ) ) )
return hr;
while ( pEffectNode != &g_EffectsList )
{
// Play all of the effects enumerated in the file
pDIEffect = pEffectNode->pDIEffect;
if( NULL != pDIEffect )
{
if( FAILED( hr = pDIEffect->Start( pEffectNode->dwPlayRepeatCount, 0 ) ) )
return hr;
}
pEffectNode = pEffectNode->pNext;
}
return S_OK;
}
示例2: PlayFFECallBackObject2
CKERROR PlayFFECallBackObject2(const CKBehaviorContext& behcontext)
{
CKBehavior* beh = behcontext.Behavior;
switch(behcontext.CallbackMessage) {
case CKM_BEHAVIORCREATE:
case CKM_BEHAVIORLOAD:
case CKM_BEHAVIORDETACH:
{
if ( g_pFFDevice2)
g_pFFDevice2->SendForceFeedbackCommand( DISFFC_STOPALL );
FreeDirectInput0();
}
break;
}
return CKBR_OK;
}
示例3: SendForceFeedbackCommand
HRESULT _stdcall SendForceFeedbackCommand(DWORD a) {
return RealDevice->SendForceFeedbackCommand(a);
}
示例4: PlayFFEffect
int PlayFFEffect(const CKBehaviorContext& behcontext)
{
CKBehavior* beh = behcontext.Behavior;
CKContext* ctx2 = behcontext.Context;
ctx = ctx2;
HWND mWin = (HWND )ctx->GetMainWindow();
//init and load effect
if( beh->IsInputActive(0) ){
beh->ActivateInput(0,FALSE);
HRESULT result = InitDirectInput(mWin);
HRESULT sa = S_OK;
if (InitDirectInput(mWin) == S_OK)
{
XString filename((CKSTRING) beh->GetInputParameterReadDataPtr(0));
OnReadFile(mWin,filename.Str());
beh->ActivateOutput(0);
return CKBR_OK;
}else{
beh->ActivateOutput(4);
return CKBR_OK;
}
}
//play
if( beh->IsInputActive(1) ){
beh->ActivateInput(1,FALSE);
if (OnPlayEffects2(NULL) != S_OK ){
beh->ActivateOutput(4);
return CKBR_OK;
}
beh->ActivateOutput(1);
return CKBR_OK;
}
//stop the effect
if( beh->IsInputActive(2) ){
beh->ActivateInput(2,FALSE);
// Stop all previous forces
g_pFFDevice->SendForceFeedbackCommand( DISFFC_STOPALL );
beh->ActivateOutput(2);
return CKBR_OK;
}
// [11/7/2004]
//save device release
if( beh->IsInputActive(3) ){
beh->ActivateInput(3,FALSE);
if ( g_pFFDevice)
g_pFFDevice->SendForceFeedbackCommand( DISFFC_STOPALL );
FreeDirectInput2();
beh->ActivateOutput(3);
return CKBR_OK;
}
return CKBR_OK;
}