anx.framework/ANX.Framework/GraphicsDeviceInformation.cs

88 lines
2.2 KiB
C#
Raw Normal View History

2011-10-31 05:36:24 +00:00
using ANX.Framework.Graphics;
using ANX.Framework.NonXNA.Development;
2011-10-31 05:36:24 +00:00
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
2011-10-31 05:36:24 +00:00
namespace ANX.Framework
{
[PercentageComplete(100)]
public class GraphicsDeviceInformation
{
#region Public
public GraphicsAdapter Adapter
{
get;
set;
}
public GraphicsProfile GraphicsProfile
{
get;
set;
}
public PresentationParameters PresentationParameters
{
get;
set;
}
#endregion
2011-10-31 05:36:24 +00:00
#region Constructor
public GraphicsDeviceInformation()
{
PresentationParameters = new PresentationParameters();
Adapter = GraphicsAdapter.DefaultAdapter;
}
#endregion
2011-10-31 05:36:24 +00:00
#region GetHashCode
public override int GetHashCode()
{
return GraphicsProfile.GetHashCode() ^
Adapter.GetHashCode() ^
PresentationParameters.BackBufferWidth.GetHashCode() ^
PresentationParameters.BackBufferHeight.GetHashCode() ^
PresentationParameters.BackBufferFormat.GetHashCode() ^
PresentationParameters.DepthStencilFormat.GetHashCode() ^
PresentationParameters.MultiSampleCount.GetHashCode() ^
PresentationParameters.DisplayOrientation.GetHashCode() ^
PresentationParameters.PresentationInterval.GetHashCode() ^
PresentationParameters.RenderTargetUsage.GetHashCode() ^
PresentationParameters.DeviceWindowHandle.GetHashCode() ^
PresentationParameters.IsFullScreen.GetHashCode();
}
#endregion
2011-10-31 05:36:24 +00:00
#region Equals
public override bool Equals(object obj)
{
GraphicsDeviceInformation other = obj as GraphicsDeviceInformation;
2011-10-31 05:36:24 +00:00
if (other != null)
{
return Adapter.Equals(other.Adapter) &&
GraphicsProfile.Equals(other.GraphicsProfile) &&
PresentationParameters.Equals(other.PresentationParameters);
}
2011-10-31 05:36:24 +00:00
return false;
}
#endregion
2011-10-31 05:36:24 +00:00
#region Clone
public GraphicsDeviceInformation Clone()
{
return new GraphicsDeviceInformation()
{
PresentationParameters = PresentationParameters.Clone(),
Adapter = Adapter,
GraphicsProfile = GraphicsProfile
};
}
#endregion
}
2011-10-31 05:36:24 +00:00
}