예제 #1
0
        public static DXGI_MODE_DESC1?FindClosestMatchingMode1(this IDXGIOutput1 output, DXGI_MODE_DESC1 modeToMatch, object concernedDevice)
        {
            if (output == null)
            {
                throw new ArgumentNullException(nameof(output));
            }

            var closest = new DXGI_MODE_DESC1();

            if (output.FindClosestMatchingMode1(ref modeToMatch, out closest, ComObject.Unwrap(concernedDevice)).IsError)
            {
                return(null);
            }

            return(closest);
        }
예제 #2
0
        public static IReadOnlyList <DXGI_MODE_DESC1> GetDisplayModeList1(this IDXGIOutput1 output, DXGI_FORMAT format, DXGI_ENUM_MODES modes)
        {
            if (output == null)
            {
                throw new ArgumentNullException(nameof(output));
            }

            var  list = new List <DXGI_MODE_DESC1>();
            uint num  = 0;

            output.GetDisplayModeList(format, (uint)modes, ref num, null);
            if (num > 0)
            {
                var array = new DXGI_MODE_DESC1[num];
                output.GetDisplayModeList1(format, (uint)modes, ref num, array);
                list.AddRange(array);
            }
            return(list);
        }
예제 #3
0
 public static DXGI_MODE_DESC1?FindClosestMatchingMode1(this ComObject <IDXGIOutput1> output, DXGI_MODE_DESC1 modeToMatch, object concernedDevice) => FindClosestMatchingMode1(output?.Object, modeToMatch, concernedDevice);