当前位置: 首页>>代码示例>>C++>>正文


C++ LPDIRECTINPUTDEVICE8::SendForceFeedbackCommand方法代码示例

本文整理汇总了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;
}
开发者ID:grakidov,项目名称:Render3D,代码行数:30,代码来源:readffe.cpp

示例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; 
}
开发者ID:gbaumgart,项目名称:vt,代码行数:23,代码来源:hasFFe.cpp

示例3: SendForceFeedbackCommand

 HRESULT _stdcall SendForceFeedbackCommand(DWORD a) {
     return RealDevice->SendForceFeedbackCommand(a);
 }
开发者ID:europop,项目名称:morrgraphext,代码行数:3,代码来源:DInput+(mouse+combat).cpp

示例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;
}
开发者ID:gbaumgart,项目名称:vt,代码行数:78,代码来源:PlayEffect.cpp


注:本文中的LPDIRECTINPUTDEVICE8::SendForceFeedbackCommand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。