/// <summary> /// Function to convert a ModeDescription1 to a ModeDescription. /// </summary> /// <param name="mode">ModeDescription1 to convert.</param> /// <returns>The new mode description.</returns> public static ModeDescription ToModeDesc(this ModeDescription1 mode) => new ModeDescription { Format = mode.Format, Height = mode.Height, Scaling = mode.Scaling, Width = mode.Width, ScanlineOrdering = mode.ScanlineOrdering, RefreshRate = mode.RefreshRate };
/// <summary> /// <p>[This documentation is preliminary and is subject to change.]</p><p><strong>Applies to: </strong>desktop apps | Metro style apps</p><p>Gets the display modes that match the requested format and other input options.</p> /// </summary> /// <param name="enumFormat"><dd> <p>A <strong><see cref="SharpDX.DXGI.Format"/></strong>-typed value for the color format.</p> </dd></param> /// <param name="flags"><dd> <p>A combination of DXGI_ENUM_MODES-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for display modes to include. You must specify <see cref="SharpDX.DXGI.DisplayModeEnumerationFlags.Scaling"/> to expose the display modes that require scaling. Centered modes that require no scaling and correspond directly to the display output are enumerated by default.</p> </dd></param> /// <returns>A list of display modes</returns> /// <remarks> /// <p><strong>GetDisplayModeList1</strong> is updated from <strong>GetDisplayModeList</strong> to return a list of <strong><see cref="SharpDX.DXGI.ModeDescription1"/></strong> structures, which are updated mode descriptions. <strong>GetDisplayModeList</strong> behaves as though it calls <strong>GetDisplayModeList1</strong> because <strong>GetDisplayModeList</strong> can return all of the modes that are specified by DXGI_ENUM_MODES, including stereo mode. However, <strong>GetDisplayModeList</strong> returns a list of <strong><see cref="SharpDX.DXGI.ModeDescription"/></strong> structures, which are the former mode descriptions and do not indicate stereo mode.</p><p>The <strong>GetDisplayModeList1</strong> method does not enumerate stereo modes unless you specify the <see cref="SharpDX.DXGI.DisplayModeEnumerationFlags.Stereo"/> flag in the <em>Flags</em> parameter. If you specify <see cref="SharpDX.DXGI.DisplayModeEnumerationFlags.Stereo"/>, stereo modes are included in the list of returned modes that the <em>pDesc</em> parameter points to. In other words, the method returns both stereo and mono modes.</p><p>In general, when you switch from windowed to full-screen mode, a swap chain automatically chooses a display mode that meets (or exceeds) the resolution, color depth, and refresh rate of the swap chain. To exercise more control over the display mode, use <strong>GetDisplayModeList1</strong> to poll the set of display modes that are validated against monitor capabilities, or all modes that match the desktop (if the desktop settings are not validated against the monitor).</p><p>The following example code shows that you need to call <strong>GetDisplayModeList1</strong> twice. First call <strong>GetDisplayModeList1</strong> to get the number of modes available, and second call <strong>GetDisplayModeList1</strong> to return a description of the modes.</p><pre><code> UINT num = 0; /// <see cref="SharpDX.DXGI.Format"/> format = <see cref="SharpDX.DXGI.Format.R32G32B32A32_Float"/>; /// UINT flags = <see cref="SharpDX.DXGI.DisplayModeEnumerationFlags.Interlaced"/>; pOutput->GetDisplayModeList1( format, flags, &num, 0); ... <see cref="SharpDX.DXGI.ModeDescription1"/> * pDescs = new <see cref="SharpDX.DXGI.ModeDescription1"/>[num]; /// pOutput->GetDisplayModeList1( format, flags, &num, pDescs); </code></pre> /// </remarks> /// <msdn-id>hh404606</msdn-id> /// <unmanaged>HRESULT IDXGIOutput1::GetDisplayModeList1([In] DXGI_FORMAT EnumFormat,[In] unsigned int Flags,[InOut] unsigned int* pNumModes,[Out, Buffer, Optional] DXGI_MODE_DESC1* pDesc)</unmanaged> /// <unmanaged-short>IDXGIOutput1::GetDisplayModeList1</unmanaged-short> public ModeDescription1[] GetDisplayModeList1(Format enumFormat, DisplayModeEnumerationFlags flags) { int numberOfDisplayModes = 0; GetDisplayModeList1(enumFormat, (int)flags, ref numberOfDisplayModes, null); var list = new ModeDescription1[numberOfDisplayModes]; if (numberOfDisplayModes > 0) GetDisplayModeList1(enumFormat, (int)flags, ref numberOfDisplayModes, list); return list; }
/// <summary> /// <p>[This documentation is preliminary and is subject to change.]</p><p><strong>Applies to: </strong>desktop apps | Metro style apps</p><p>Gets the display modes that match the requested format and other input options.</p> /// </summary> /// <param name="enumFormat"><dd> <p>A <strong><see cref="SharpDX.DXGI.Format"/></strong>-typed value for the color format.</p> </dd></param> /// <param name="flags"><dd> <p>A combination of DXGI_ENUM_MODES-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for display modes to include. You must specify <see cref="SharpDX.DXGI.DisplayModeEnumerationFlags.Scaling"/> to expose the display modes that require scaling. Centered modes that require no scaling and correspond directly to the display output are enumerated by default.</p> </dd></param> /// <returns>A list of display modes</returns> /// <remarks> /// <p><strong>GetDisplayModeList1</strong> is updated from <strong>GetDisplayModeList</strong> to return a list of <strong><see cref="SharpDX.DXGI.ModeDescription1"/></strong> structures, which are updated mode descriptions. <strong>GetDisplayModeList</strong> behaves as though it calls <strong>GetDisplayModeList1</strong> because <strong>GetDisplayModeList</strong> can return all of the modes that are specified by DXGI_ENUM_MODES, including stereo mode. However, <strong>GetDisplayModeList</strong> returns a list of <strong><see cref="SharpDX.DXGI.ModeDescription"/></strong> structures, which are the former mode descriptions and do not indicate stereo mode.</p><p>The <strong>GetDisplayModeList1</strong> method does not enumerate stereo modes unless you specify the <see cref="SharpDX.DXGI.DisplayModeEnumerationFlags.Stereo"/> flag in the <em>Flags</em> parameter. If you specify <see cref="SharpDX.DXGI.DisplayModeEnumerationFlags.Stereo"/>, stereo modes are included in the list of returned modes that the <em>pDesc</em> parameter points to. In other words, the method returns both stereo and mono modes.</p><p>In general, when you switch from windowed to full-screen mode, a swap chain automatically chooses a display mode that meets (or exceeds) the resolution, color depth, and refresh rate of the swap chain. To exercise more control over the display mode, use <strong>GetDisplayModeList1</strong> to poll the set of display modes that are validated against monitor capabilities, or all modes that match the desktop (if the desktop settings are not validated against the monitor).</p><p>The following example code shows that you need to call <strong>GetDisplayModeList1</strong> twice. First call <strong>GetDisplayModeList1</strong> to get the number of modes available, and second call <strong>GetDisplayModeList1</strong> to return a description of the modes.</p><pre><code> UINT num = 0; /// <see cref="SharpDX.DXGI.Format"/> format = <see cref="SharpDX.DXGI.Format.R32G32B32A32_Float"/>; /// UINT flags = <see cref="SharpDX.DXGI.DisplayModeEnumerationFlags.Interlaced"/>; pOutput->GetDisplayModeList1( format, flags, &num, 0); ... <see cref="SharpDX.DXGI.ModeDescription1"/> * pDescs = new <see cref="SharpDX.DXGI.ModeDescription1"/>[num]; /// pOutput->GetDisplayModeList1( format, flags, &num, pDescs); </code></pre> /// </remarks> /// <msdn-id>hh404606</msdn-id> /// <unmanaged>HRESULT IDXGIOutput1::GetDisplayModeList1([In] DXGI_FORMAT EnumFormat,[In] unsigned int Flags,[InOut] unsigned int* pNumModes,[Out, Buffer, Optional] DXGI_MODE_DESC1* pDesc)</unmanaged> /// <unmanaged-short>IDXGIOutput1::GetDisplayModeList1</unmanaged-short> public ModeDescription1[] GetDisplayModeList1(Format enumFormat, DisplayModeEnumerationFlags flags) { int numberOfDisplayModes = 0; GetDisplayModeList1(enumFormat, (int)flags, ref numberOfDisplayModes, null); var list = new ModeDescription1[numberOfDisplayModes]; if (numberOfDisplayModes > 0) { GetDisplayModeList1(enumFormat, (int)flags, ref numberOfDisplayModes, list); } return(list); }
public ModeDescription1[] GetDisplayModeList1(Format format, DisplayModeEnumerationFlags flags) { int count = 0; GetDisplayModeList1(format, (int)flags, ref count, null); var result = new ModeDescription1[count]; if (count > 0) { GetDisplayModeList1(format, (int)flags, ref count, result); } return(result); }
public void FindClosestMatchingMode1(ComObject concernedDevice, ModeDescription1 modeToMatch, out ModeDescription1 closestMatch) { FindClosestMatchingMode1(ref modeToMatch, out closestMatch, concernedDevice); }
/// <summary> /// Function to convert a DXGI ModeDescription1 to a <see cref="GorgonVideoMode"/>. /// </summary> /// <param name="mode">ModeDescription1 to convert.</param> /// <param name="gorgonMode">The converted video mode.</param> public static void ToGorgonVideoMode(this ModeDescription1 mode, out GorgonVideoMode gorgonMode) => gorgonMode = new GorgonVideoMode(mode);
public static DisplayMode FromDescription(ModeDescription1 description) { return(new DisplayMode(description.Format, description.Width, description.Height, description.RefreshRate)); }
public static DisplayMode FromDescription(ModeDescription1 description) { return new DisplayMode(description.Format, description.Width, description.Height, description.RefreshRate); }