/// <summary> /// Resets a device to unfiltered /// </summary> /// <param name="device">The device you want reset</param> internal void Reset(InputDevice device) { IntPtr noiseFilterPtr = InputStateBuffers.s_NoiseFilterBuffer; if (noiseFilterPtr != IntPtr.Zero) { BitmaskHelpers.Whitelist(noiseFilterPtr, device); } }
/// <summary> /// Called when the NoiseFilter gets applied to a device, calls down to any individual FilteredElements that need to do any work. /// </summary> /// <param name="device">The device you want to apply filtering to.</param> internal void Apply(InputDevice device) { if (device == null) { throw new ArgumentException("No device supplied to apply NoiseFilter to.", "device"); } IntPtr noiseFilterPtr = InputStateBuffers.s_NoiseFilterBuffer; if (noiseFilterPtr != IntPtr.Zero) { BitmaskHelpers.Whitelist(noiseFilterPtr, device); for (int i = 0; i < elements.Length; i++) { elements[i].Apply(noiseFilterPtr, device); } } }