Passing null to ChangeResolution will restore the original resolution.
This commit is contained in:
parent
0d659c6e74
commit
c57b11662f
1 changed files with 3 additions and 1 deletions
|
@ -189,10 +189,12 @@ namespace OpenTK.Graphics
|
|||
/// <summary>Changes the resolution of the DisplayDevice.</summary>
|
||||
/// <param name="resolution">The resolution to set. <see cref="DisplayDevice.SelectResolution"/></param>
|
||||
/// <exception cref="GraphicsModeException">Thrown if the requested resolution could not be set.</exception>
|
||||
/// <remarks>If the specified resolution is null, this function will restore the original DisplayResolution.</remarks>
|
||||
public void ChangeResolution(DisplayResolution resolution)
|
||||
{
|
||||
if (resolution == null)
|
||||
throw new ArgumentNullException("resolution", "Must be a valid resolution.");
|
||||
this.RestoreResolution();
|
||||
|
||||
if (resolution == current_resolution)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue