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


C# Effect.Start方法代码示例

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


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

示例1: StartFFBEffect

        /// <summary>
        /// Starts playback of an effect.
        /// </summary>
        /// <param name="ef">
        /// Effect which is to be played.
        /// </param>
        /// <returns>
        /// Returns true if successful, otherwise returns false.
        /// </returns>
        private bool StartFFBEffect(Effect ef)
        {
            SlimDX.Result res;

            if (ef == null)
            {
                MessageBox.Show("NULL pointer to effect in \"DInputHandler::StartFFBEffect()\"",
                                FFBInspector.Properties.Resources.errCap_effError,
                                MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return false;
            }

            res = ffbDevice.Acquire();
            if (!(res != ResultCode.Success || res != ResultCode.Failure))
            {
                MessageBox.Show("Cannot acquire the device.\n" +
                                "Make sure no other application is using the device\n" +
                                res.ToString(), FFBInspector.Properties.Resources.errCap_devError,
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return false;
            }

            res = ef.Start();
            if (res != ResultCode.Success)
            {
                MessageBox.Show("Cannot start the effect.\n", FFBInspector.Properties.Resources.errCap_effError,
                                MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return false;
            }

            return true;
        }
开发者ID:MadCatX,项目名称:FFBInspector,代码行数:41,代码来源:DInputHandler.cs

示例2: SetVibration

		// Note that this does not appear to work at this time. I probably need to have more infos.
		public void SetVibration(int left, int right)
		{
			int[] temp1, temp2;
			// my first clue that it doesnt work is that LEFT  and RIGHT _ARENT USED_
			// I should just look for C++ examples instead of trying to look for SlimDX examples

			var parameters = new EffectParameters
				{
					Duration = 0x2710,
					Gain = 0x2710,
					SamplePeriod = 0,
					TriggerButton = 0,
					TriggerRepeatInterval = 0x2710,
					Flags = EffectFlags.None
				};
			parameters.GetAxes(out temp1, out temp2);
			parameters.SetAxes(temp1, temp2);
			var effect = new Effect(joystick, EffectGuid.ConstantForce);
			effect.SetParameters(parameters);
			effect.Start(1);
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:22,代码来源:GamePad.cs


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