/// <summary> /// Initializes a new instance of the <see cref="TouchDeviceInfo"/> class. /// </summary> /// <param name="uv">The Ultraviolet context.</param> public TouchDeviceInfo(UltravioletContext uv) : base(uv) { var count = SDL.GetNumTouchDevices(); devices = new SDL2TouchDevice[count]; for (int i = 0; i < count; i++) { devices[i] = new SDL2TouchDevice(uv, i); } }
/// <summary> /// Registers the specified device as having received user input. /// </summary> /// <param name="device">The device to register.</param> /// <returns><see langword="true"/> if the device was registered; otherwise, <see langword="false"/>.</returns> internal Boolean RegisterTouchDevice(SDL2TouchDevice device) { if (primaryTouchDevice == null) { primaryTouchDevice = device; } if (device.IsRegistered) { return(false); } TouchDeviceRegistered?.Invoke(device); return(true); }