public KeyboardSDL(InputSourceSDL source, Window window) { Source = source; this.window = window; this.window.KeyDownActions += OnKeyEvent; this.window.KeyUpActions += OnKeyEvent; this.window.TextInputActions += OnTextInputActions; this.window.TextEditingActions += OnTextEditingActions; Id = InputDeviceUtils.DeviceNameToGuid(window.SdlHandle.ToString() + Name); }
public PointerSDL(InputSourceSDL source, Window uiControl) { Source = source; this.uiControl = uiControl; // Disable Touch-Mouse synthesis SDL.SetHint(Sdl.HintTouchMouseEvents, "false"); uiControl.FingerMoveActions += OnFingerMoveEvent; uiControl.FingerPressActions += OnFingerPressEvent; uiControl.FingerReleaseActions += OnFingerReleaseEvent; uiControl.ResizeEndActions += OnSizeChanged; OnSizeChanged(new WindowEvent()); Id = InputDeviceUtils.DeviceNameToGuid(uiControl.SdlHandle.ToString() + Name); }
/// <summary> /// Runs the specified main loop for the specified windows form. /// </summary> /// <param name="form">The form.</param> /// <param name="renderCallback">The rendering callback.</param> /// <exception cref="System.ArgumentNullException">form /// or /// renderCallback</exception> public static void Run(Window form, RenderCallback renderCallback) { if (form == null) { throw new ArgumentNullException(nameof(form)); } if (renderCallback == null) { throw new ArgumentNullException(nameof(renderCallback)); } form.Show(); using (var renderLoop = new SDLMessageLoop(form)) { while (renderLoop.NextFrame()) { renderCallback(); } } }
public InputSourceSDL(Window uiControl) { this.uiControl = uiControl ?? throw new ArgumentNullException(nameof(uiControl)); }
/// <summary> /// Initializes a new instance of the <see cref="WindowsMessageLoop"/> class. /// </summary> public SDLMessageLoop(Window control) { Control = control; }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { Control = null; }