No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

QueryDimensionsCommand.cs 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Runtime.InteropServices;
  2. using UnityEngine.InputSystem.Utilities;
  3. namespace UnityEngine.InputSystem.LowLevel
  4. {
  5. /// <summary>
  6. /// Query dimensions of a device.
  7. /// </summary>
  8. /// <remarks>
  9. /// This is usually used to query screen dimensions from pointer devices.
  10. /// </remarks>
  11. [StructLayout(LayoutKind.Explicit, Size = kSize)]
  12. public struct QueryDimensionsCommand : IInputDeviceCommandInfo
  13. {
  14. public static FourCC Type { get { return new FourCC('D', 'I', 'M', 'S'); } }
  15. internal const int kSize = InputDeviceCommand.kBaseCommandSize + sizeof(float) * 2;
  16. [FieldOffset(0)]
  17. public InputDeviceCommand baseCommand;
  18. [FieldOffset(InputDeviceCommand.kBaseCommandSize)]
  19. public Vector2 outDimensions;
  20. public FourCC typeStatic
  21. {
  22. get { return Type; }
  23. }
  24. public static QueryDimensionsCommand Create()
  25. {
  26. return new QueryDimensionsCommand
  27. {
  28. baseCommand = new InputDeviceCommand(Type, kSize)
  29. };
  30. }
  31. }
  32. }