/// <summary>
 ///     Creates a new instance of <see cref="SetIlluminationParameterV1" />.
 /// </summary>
 /// <param name="gpuHandle">The physical gpu handle.</param>
 /// <param name="attribute">The attribute.</param>
 /// <param name="valueInPercentage">The attribute value in percentage.</param>
 public SetIlluminationParameterV1(
     PhysicalGPUHandle gpuHandle,
     IlluminationAttribute attribute,
     uint valueInPercentage)
 {
     this               = typeof(SetIlluminationParameterV1).Instantiate <SetIlluminationParameterV1>();
     _GPUHandle         = gpuHandle;
     _Attribute         = attribute;
     _ValueInPercentage = valueInPercentage;
 }
Пример #2
0
        /// <summary>
        ///     Sets the value of the specified illumination attribute brightness.
        /// </summary>
        /// <param name="gpuHandle">The physical GPU handle.</param>
        /// <param name="attribute">The attribute to set the value of.</param>
        /// <param name="valueInPercentage">Brightness value in percentage.</param>
        public static void SetIllumination(
            PhysicalGPUHandle gpuHandle,
            IlluminationAttribute attribute,
            uint valueInPercentage)
        {
            var instance = new SetIlluminationParameterV1(gpuHandle, attribute, valueInPercentage);

            using (var setParameterReference = ValueTypeReference.FromValueType(instance))
            {
                var status = DelegateFactory.GetDelegate <Delegates.GPU.NvAPI_GPU_SetIllumination>()(
                    setParameterReference
                    );

                if (status != Status.Ok)
                {
                    throw new NVIDIAApiException(status);
                }
            }
        }
Пример #3
0
        /// <summary>
        ///     Queries a illumination attribute support status.
        /// </summary>
        /// <param name="gpuHandle">The physical GPU handle.</param>
        /// <param name="attribute">The attribute to get the support status of.</param>
        /// <returns>true if the attribute is supported on this GPU; otherwise false.</returns>
        public static bool QueryIlluminationSupport(PhysicalGPUHandle gpuHandle, IlluminationAttribute attribute)
        {
            var instance = new QueryIlluminationSupportParameterV1(gpuHandle, attribute);

            using (var querySupportParameterReference = ValueTypeReference.FromValueType(instance))
            {
                var status = DelegateFactory.GetDelegate <Delegates.GPU.NvAPI_GPU_SetIllumination>()(
                    querySupportParameterReference
                    );

                if (status != Status.Ok)
                {
                    throw new NVIDIAApiException(status);
                }

                return(querySupportParameterReference.ToValueType <QueryIlluminationSupportParameterV1>()
                       .GetValueOrDefault()
                       .IsSupported);
            }
        }
Пример #4
0
        /// <summary>
        ///     Reports value of the specified illumination attribute brightness.
        /// </summary>
        /// <param name="gpuHandle">The physical GPU handle.</param>
        /// <param name="attribute">The attribute to get the value of.</param>
        /// <returns>Brightness value in percentage.</returns>
        public static uint GetIllumination(PhysicalGPUHandle gpuHandle, IlluminationAttribute attribute)
        {
            var instance = new GetIlluminationParameterV1(gpuHandle, attribute);

            using (var getParameterReference = ValueTypeReference.FromValueType(instance))
            {
                var status = DelegateFactory.GetDelegate <Delegates.GPU.NvAPI_GPU_GetIllumination>()(
                    getParameterReference
                    );

                if (status != Status.Ok)
                {
                    throw new NVIDIAApiException(status);
                }

                return(getParameterReference.ToValueType <GetIlluminationParameterV1>()
                       .GetValueOrDefault()
                       .ValueInPercentage);
            }
        }
Пример #5
0
 /// <summary>
 ///     Creates a new instance of <see cref="GetIlluminationParameterV1" />.
 /// </summary>
 /// <param name="gpuHandle">The physical gpu handle.</param>
 /// <param name="attribute">The attribute.</param>
 public GetIlluminationParameterV1(PhysicalGPUHandle gpuHandle, IlluminationAttribute attribute)
 {
     this       = typeof(GetIlluminationParameterV1).Instantiate <GetIlluminationParameterV1>();
     _GPUHandle = gpuHandle;
     _Attribute = attribute;
 }
 /// <summary>
 ///     Creates a new instance of <see cref="QueryIlluminationSupportParameterV1" />.
 /// </summary>
 /// <param name="gpuHandle">The physical gpu handle.</param>
 /// <param name="attribute">The attribute.</param>
 public QueryIlluminationSupportParameterV1(PhysicalGPUHandle gpuHandle, IlluminationAttribute attribute)
 {
     this       = typeof(QueryIlluminationSupportParameterV1).Instantiate <QueryIlluminationSupportParameterV1>();
     _GPUHandle = gpuHandle;
     _Attribute = attribute;
 }