using System.Runtime.InteropServices; using NvAPIWrapper.Native.Helpers; using NvAPIWrapper.Native.Interfaces; namespace NvAPIWrapper.Native.GPU.Structures { /// /// Holds information regarding the data necessary for synchronization. /// [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct IlluminationDeviceSyncV1 : IInitializable { private const int MaximumNumberOfReserved = 64; internal byte _IsSync; internal ulong _TimeStampInMS; [MarshalAs(UnmanagedType.ByValArray, SizeConst = MaximumNumberOfReserved)] internal byte[] _Reserved; /// /// Creates a new instance of /// /// A boolean value indicating if synchronization is enabled. /// The synchronization timestamp in ms public IlluminationDeviceSyncV1(bool isSync, ulong timeStampInMS) { this = typeof(IlluminationDeviceSyncV1).Instantiate(); _IsSync = isSync ? (byte) 1 : (byte) 0; _TimeStampInMS = timeStampInMS; } /// /// Gets a boolean value indicating the need for synchronization. /// public bool IsSync { get => _IsSync > 0; } /// /// Gets the timestamp in milliseconds required for synchronization. /// public ulong TimeStampInMS { get => _TimeStampInMS; } } }