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 0d659c6e74
commit c57b11662f

View file

@ -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;