port from perforce
This commit is contained in:
26
aiwaz/Backup/Aiwaz.Core/DeviceEnumerator/DisplayMode.cs
Normal file
26
aiwaz/Backup/Aiwaz.Core/DeviceEnumerator/DisplayMode.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Aiwaz.Contracts;
|
||||
using SlimDX;
|
||||
|
||||
|
||||
namespace Aiwaz.Core
|
||||
{
|
||||
public class DisplayMode
|
||||
{
|
||||
public int Width { get; protected set; }
|
||||
public int Height { get; protected set; }
|
||||
public int RefreshRate { get; protected set; }
|
||||
public SlimDX.DXGI.Format Format { get; protected set; }
|
||||
|
||||
public DisplayMode(SlimDX.DXGI.ModeDescription description)
|
||||
{
|
||||
this.Width = description.Width;
|
||||
this.Height = description.Height;
|
||||
this.Format = description.Format;
|
||||
this.RefreshRate = description.RefreshRate.Numerator == 0 ? 0 : (int)Math.Round(description.RefreshRate.Numerator / (double)description.RefreshRate.Denominator, 0, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user