mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-24 18:06:49 +00:00
Change original_resolution field to a property
As the original_resolution field needs to be accessed from outside the module, it should be an internal property as opposed to an internal field
This commit is contained in:
parent
5f6c8e654c
commit
7b591962e8
|
@ -48,7 +48,7 @@ namespace OpenTK
|
||||||
bool primary;
|
bool primary;
|
||||||
Rectangle bounds;
|
Rectangle bounds;
|
||||||
DisplayResolution current_resolution = new DisplayResolution();
|
DisplayResolution current_resolution = new DisplayResolution();
|
||||||
internal DisplayResolution original_resolution;
|
DisplayResolution original_resolution;
|
||||||
List<DisplayResolution> available_resolutions = new List<DisplayResolution>();
|
List<DisplayResolution> available_resolutions = new List<DisplayResolution>();
|
||||||
IList<DisplayResolution> available_resolutions_readonly;
|
IList<DisplayResolution> available_resolutions_readonly;
|
||||||
|
|
||||||
|
@ -336,6 +336,23 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#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 --- Private Methods ---
|
||||||
|
|
||||||
#region DisplayResolution FindResolution(int width, int height, int bitsPerPixel, float refreshRate)
|
#region DisplayResolution FindResolution(int width, int height, int bitsPerPixel, float refreshRate)
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace OpenTK.Platform.Windows
|
||||||
lock (display_lock)
|
lock (display_lock)
|
||||||
{
|
{
|
||||||
// Store an array of the current available DisplayDevice objects.
|
// Store an array of the current available DisplayDevice objects.
|
||||||
// This is needed to preserve the original_resolution.
|
// This is needed to preserve the original resolution.
|
||||||
DisplayDevice[] previousDevices = AvailableDevices.ToArray();
|
DisplayDevice[] previousDevices = AvailableDevices.ToArray();
|
||||||
|
|
||||||
AvailableDevices.Clear();
|
AvailableDevices.Clear();
|
||||||
|
@ -163,10 +163,10 @@ namespace OpenTK.Platform.Windows
|
||||||
opentk_dev_current_res.Bounds,
|
opentk_dev_current_res.Bounds,
|
||||||
dev1.DeviceName);
|
dev1.DeviceName);
|
||||||
|
|
||||||
// Set the original_resolution if the DisplayDevice was previously available.
|
// Set the original resolution if the DisplayDevice was previously available.
|
||||||
foreach (DisplayDevice existingDevice in previousDevices)
|
foreach (DisplayDevice existingDevice in previousDevices)
|
||||||
if ((string)existingDevice.Id == (string)opentk_dev.Id)
|
if ((string)existingDevice.Id == (string)opentk_dev.Id)
|
||||||
opentk_dev.original_resolution = existingDevice.original_resolution;
|
opentk_dev.OriginalResolution = existingDevice.OriginalResolution;
|
||||||
|
|
||||||
AvailableDevices.Add(opentk_dev);
|
AvailableDevices.Add(opentk_dev);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue