added "CurrentDisplayMode" of DefaultAdapter for GL3, DX10 and DX11 (issue #1194)
This commit is contained in:
parent
f9a44d9ac3
commit
37075c7e90
@ -31,22 +31,10 @@ namespace ANX.Framework.Graphics
|
|||||||
public int Revision { get; set; }
|
public int Revision { get; set; }
|
||||||
public int SubSystemId { get; set; }
|
public int SubSystemId { get; set; }
|
||||||
public int VendorId { get; set; }
|
public int VendorId { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
public DisplayMode CurrentDisplayMode
|
public DisplayMode CurrentDisplayMode { get; set; }
|
||||||
{
|
public DisplayModeCollection SupportedDisplayModes { get; set; }
|
||||||
get
|
public IntPtr MonitorHandle { get; set; }
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Description
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsWideScreen
|
public bool IsWideScreen
|
||||||
{
|
{
|
||||||
@ -56,16 +44,6 @@ namespace ANX.Framework.Graphics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntPtr MonitorHandle
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public DisplayModeCollection SupportedDisplayModes { get; set; }
|
|
||||||
|
|
||||||
static GraphicsAdapter()
|
static GraphicsAdapter()
|
||||||
{
|
{
|
||||||
var creator = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>();
|
var creator = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>();
|
||||||
|
@ -271,6 +271,8 @@ namespace ANX.RenderSystem.GL3
|
|||||||
resultingModes.Add(new DisplayMode(res.Width, res.Height, surfaceFormat));
|
resultingModes.Add(new DisplayMode(res.Width, res.Height, surfaceFormat));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DisplayDevice dev = DisplayDevice.GetDisplay(DisplayIndex.Default);
|
||||||
|
|
||||||
var newAdapter = new GraphicsAdapter
|
var newAdapter = new GraphicsAdapter
|
||||||
{
|
{
|
||||||
SupportedDisplayModes = new DisplayModeCollection(resultingModes),
|
SupportedDisplayModes = new DisplayModeCollection(resultingModes),
|
||||||
@ -282,6 +284,7 @@ namespace ANX.RenderSystem.GL3
|
|||||||
Revision = 0,
|
Revision = 0,
|
||||||
SubSystemId = 0,
|
SubSystemId = 0,
|
||||||
VendorId = 0,
|
VendorId = 0,
|
||||||
|
CurrentDisplayMode = new DisplayMode(dev.Width, dev.Height, SurfaceFormat.Color)
|
||||||
};
|
};
|
||||||
|
|
||||||
result.Add(newAdapter);
|
result.Add(newAdapter);
|
||||||
|
@ -183,16 +183,13 @@ namespace ANX.RenderSystem.Windows.DX10
|
|||||||
using (Adapter adapter = factory.GetAdapter(i))
|
using (Adapter adapter = factory.GetAdapter(i))
|
||||||
{
|
{
|
||||||
var ga = new GraphicsAdapter();
|
var ga = new GraphicsAdapter();
|
||||||
//ga.CurrentDisplayMode = ;
|
ga.Description = adapter.Description.Description;
|
||||||
//ga.Description = ;
|
|
||||||
ga.DeviceId = adapter.Description.DeviceId;
|
ga.DeviceId = adapter.Description.DeviceId;
|
||||||
ga.DeviceName = adapter.Description.Description;
|
ga.DeviceName = adapter.Description.Description;
|
||||||
ga.IsDefaultAdapter = i == 0; //TODO: how to set default adapter?
|
ga.IsDefaultAdapter = i == 0; //TODO: how to set default adapter?
|
||||||
//ga.IsWideScreen = ;
|
//ga.IsWideScreen = ;
|
||||||
//ga.MonitorHandle = ;
|
|
||||||
ga.Revision = adapter.Description.Revision;
|
ga.Revision = adapter.Description.Revision;
|
||||||
ga.SubSystemId = adapter.Description.SubsystemId;
|
ga.SubSystemId = adapter.Description.SubsystemId;
|
||||||
//ga.SupportedDisplayModes = ;
|
|
||||||
ga.VendorId = adapter.Description.VendorId;
|
ga.VendorId = adapter.Description.VendorId;
|
||||||
|
|
||||||
resultingModes.Clear();
|
resultingModes.Clear();
|
||||||
@ -208,6 +205,9 @@ namespace ANX.RenderSystem.Windows.DX10
|
|||||||
var displayMode = new DisplayMode(modeDescription.Width, modeDescription.Height, DxFormatConverter.Translate(modeDescription.Format));
|
var displayMode = new DisplayMode(modeDescription.Width, modeDescription.Height, DxFormatConverter.Translate(modeDescription.Format));
|
||||||
resultingModes.Add(displayMode);
|
resultingModes.Add(displayMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ga.CurrentDisplayMode = new DisplayMode(adapterOutput.Description.DesktopBounds.Width, adapterOutput.Description.DesktopBounds.Height, SurfaceFormat.Color);
|
||||||
|
ga.MonitorHandle = adapterOutput.Description.MonitorHandle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,16 +189,13 @@ namespace ANX.RenderSystem.Windows.DX11
|
|||||||
using (Adapter adapter = factory.GetAdapter(i))
|
using (Adapter adapter = factory.GetAdapter(i))
|
||||||
{
|
{
|
||||||
GraphicsAdapter ga = new GraphicsAdapter();
|
GraphicsAdapter ga = new GraphicsAdapter();
|
||||||
//ga.CurrentDisplayMode = ;
|
ga.Description = adapter.Description.Description;
|
||||||
//ga.Description = ;
|
|
||||||
ga.DeviceId = adapter.Description.DeviceId;
|
ga.DeviceId = adapter.Description.DeviceId;
|
||||||
ga.DeviceName = adapter.Description.Description;
|
ga.DeviceName = adapter.Description.Description;
|
||||||
ga.IsDefaultAdapter = i == 0; //TODO: how to set default adapter?
|
ga.IsDefaultAdapter = i == 0; //TODO: how to set default adapter?
|
||||||
//ga.IsWideScreen = ;
|
//ga.IsWideScreen = ;
|
||||||
//ga.MonitorHandle = ;
|
|
||||||
ga.Revision = adapter.Description.Revision;
|
ga.Revision = adapter.Description.Revision;
|
||||||
ga.SubSystemId = adapter.Description.SubsystemId;
|
ga.SubSystemId = adapter.Description.SubsystemId;
|
||||||
//ga.SupportedDisplayModes = ;
|
|
||||||
ga.VendorId = adapter.Description.VendorId;
|
ga.VendorId = adapter.Description.VendorId;
|
||||||
|
|
||||||
resultingModes.Clear();
|
resultingModes.Clear();
|
||||||
@ -214,6 +211,9 @@ namespace ANX.RenderSystem.Windows.DX11
|
|||||||
var displayMode = new DisplayMode(modeDescription.Width, modeDescription.Height, DxFormatConverter.Translate(modeDescription.Format));
|
var displayMode = new DisplayMode(modeDescription.Width, modeDescription.Height, DxFormatConverter.Translate(modeDescription.Format));
|
||||||
resultingModes.Add(displayMode);
|
resultingModes.Add(displayMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ga.CurrentDisplayMode = new DisplayMode(adapterOutput.Description.DesktopBounds.Width, adapterOutput.Description.DesktopBounds.Height, SurfaceFormat.Color);
|
||||||
|
ga.MonitorHandle = adapterOutput.Description.MonitorHandle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user