mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 03:55:28 +00:00
Merge remote-tracking branch 'cwassall/develop' into develop
This commit is contained in:
commit
c73e4785cd
|
@ -47,7 +47,8 @@ namespace OpenTK
|
|||
|
||||
bool primary;
|
||||
Rectangle bounds;
|
||||
DisplayResolution current_resolution = new DisplayResolution(), original_resolution;
|
||||
DisplayResolution current_resolution = new DisplayResolution();
|
||||
DisplayResolution original_resolution;
|
||||
List<DisplayResolution> available_resolutions = new List<DisplayResolution>();
|
||||
IList<DisplayResolution> available_resolutions_readonly;
|
||||
|
||||
|
@ -335,6 +336,23 @@ namespace OpenTK
|
|||
|
||||
#endregion
|
||||
|
||||
#region --- Internal Methods ---
|
||||
|
||||
#region internal DisplayResolution OriginalResolution
|
||||
|
||||
/// <summary>
|
||||
/// Gets the original resolution of this instance.
|
||||
/// </summary>
|
||||
internal DisplayResolution OriginalResolution
|
||||
{
|
||||
get { return original_resolution; }
|
||||
set { original_resolution = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Private Methods ---
|
||||
|
||||
#region DisplayResolution FindResolution(int width, int height, int bitsPerPixel, float refreshRate)
|
||||
|
|
|
@ -96,6 +96,10 @@ namespace OpenTK.Platform.Windows
|
|||
{
|
||||
lock (display_lock)
|
||||
{
|
||||
// Store an array of the current available DisplayDevice objects.
|
||||
// This is needed to preserve the original resolution.
|
||||
DisplayDevice[] previousDevices = AvailableDevices.ToArray();
|
||||
|
||||
AvailableDevices.Clear();
|
||||
|
||||
// We save all necessary parameters in temporary variables
|
||||
|
@ -159,6 +163,11 @@ namespace OpenTK.Platform.Windows
|
|||
opentk_dev_current_res.Bounds,
|
||||
dev1.DeviceName);
|
||||
|
||||
// Set the original resolution if the DisplayDevice was previously available.
|
||||
foreach (DisplayDevice existingDevice in previousDevices)
|
||||
if ((string)existingDevice.Id == (string)opentk_dev.Id)
|
||||
opentk_dev.OriginalResolution = existingDevice.OriginalResolution;
|
||||
|
||||
AvailableDevices.Add(opentk_dev);
|
||||
|
||||
if (opentk_dev_primary)
|
||||
|
|
Loading…
Reference in a new issue