Passing null to ChangeResolution will restore the original resolution.

This commit is contained in:
the_fiddler 2008-05-04 16:26:54 +00:00
parent eaaf67d903
commit 539370d4b7

View file

@ -189,10 +189,12 @@ namespace OpenTK.Graphics
/// <summary>Changes the resolution of the DisplayDevice.</summary> /// <summary>Changes the resolution of the DisplayDevice.</summary>
/// <param name="resolution">The resolution to set. <see cref="DisplayDevice.SelectResolution"/></param> /// <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> /// <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) public void ChangeResolution(DisplayResolution resolution)
{ {
if (resolution == null) if (resolution == null)
throw new ArgumentNullException("resolution", "Must be a valid resolution."); this.RestoreResolution();
if (resolution == current_resolution) if (resolution == current_resolution)
return; return;