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


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

本文整理汇总了C++中LPDIRECTINPUTDEVICE8::EnumEffectsInFile方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTINPUTDEVICE8::EnumEffectsInFile方法的具体用法?C++ LPDIRECTINPUTDEVICE8::EnumEffectsInFile怎么用?C++ LPDIRECTINPUTDEVICE8::EnumEffectsInFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LPDIRECTINPUTDEVICE8的用法示例。


在下文中一共展示了LPDIRECTINPUTDEVICE8::EnumEffectsInFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnReadFile

//-----------------------------------------------------------------------------
// Name: OnReadFile()
// Desc: Reads a file contain a collection of DirectInput force feedback 
//       effects.  It creates each of effect read in and stores it 
//       in the linked list, g_EffectsList.
//-----------------------------------------------------------------------------
HRESULT OnReadFile( HWND hDlg )
{
    HRESULT hr;

    static TCHAR strFileName[MAX_PATH] = TEXT("");
    static TCHAR strPath[MAX_PATH] = TEXT("");

    // Setup the OPENFILENAME structure
    OPENFILENAME ofn = { sizeof(OPENFILENAME), hDlg, NULL,
                         TEXT("FEdit Files\0*.ffe\0All Files\0*.*\0\0"), NULL,
                         0, 1, strFileName, MAX_PATH, NULL, 0, strPath,
                         TEXT("Open FEdit File"),
                         OFN_FILEMUSTEXIST|OFN_HIDEREADONLY, 0, 0,
                         TEXT(".ffe"), 0, NULL, NULL };

    // Get the default media path (something like C:\DXSDK\SAMPLES\MULTIMEDIA\DINPUT\MEDIA)
    if( '\0' == strPath[0] )
        _tcscpy( strPath, DXUtil_GetDXSDKMediaPath() );

    // Display the OpenFileName dialog. Then, try to load the specified file
    if( FALSE == GetOpenFileName( &ofn ) )
        return S_OK;

    EmptyEffectList();

    // Enumerate the effects in the file selected, and create them in the callback
    if( FAILED( hr = g_pFFDevice->EnumEffectsInFile( strFileName, 
                                                     EnumAndCreateEffectsCallback, 
                                                     NULL, DIFEF_MODIFYIFNEEDED ) ) )
        return hr;

    // Remember the path for next time
    _tcscpy( strPath, strFileName );
    TCHAR* strLastSlash = _tcsrchr( strPath, '\\' );
    strLastSlash[0] = '\0';

    // If list of effects is empty, then we haven't been able to create any effects
    if( g_EffectsList.pNext == &g_EffectsList )
    {
        // Pop up a box informing the user
        MessageBox( hDlg, _T("Unable to create any effects."),
                          _T("ReadFFE"), MB_ICONEXCLAMATION | MB_OK );
        EnableWindow( GetDlgItem( hDlg, IDC_PLAY_EFFECTS ), FALSE );
    }
    else
    {
        // We have effects so enable the 'play effects' button
        EnableWindow( GetDlgItem( hDlg, IDC_PLAY_EFFECTS ), TRUE );
    }

    return S_OK;
}
开发者ID:grakidov,项目名称:Render3D,代码行数:58,代码来源:readffe.cpp

示例2: LoadEffectFile

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : device - 
//			&map - 
// Output : static void
//-----------------------------------------------------------------------------
static void LoadEffectFile( LPDIRECTINPUTDEVICE8 device, EffectMap_t &map )
{
	LoadEffectContext_t context;
	context.device = device;
	context.map = ↦

	// Pull out of .gcf if needed
	filesystem->GetLocalCopy( map.effectfile );

	char fullpath[ 512 ];
	filesystem->GetLocalPath( map.effectfile, fullpath, sizeof( fullpath ) );

	HRESULT hr = device->EnumEffectsInFile
		( fullpath, 
          EnumEffectsInFileProc,
          (LPVOID)&context, 
          DIFEF_MODIFYIFNEEDED );

	if ( FAILED( hr ) )
	{
		Msg( "EnumEffectsInFile failed for %s\n", map.effectfile );
	}

}
开发者ID:1n73rf4c3,项目名称:source-sdk-2013,代码行数:30,代码来源:in_forcefeedback.cpp

示例3: EnumEffectsInFile

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


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