From 539370d4b741991ed8385e30d43c0760650d7b59 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 4 May 2008 16:26:54 +0000 Subject: [PATCH] Passing null to ChangeResolution will restore the original resolution. --- Source/OpenTK/Graphics/DisplayDevice.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/OpenTK/Graphics/DisplayDevice.cs b/Source/OpenTK/Graphics/DisplayDevice.cs index eeda0124..ef529bcc 100644 --- a/Source/OpenTK/Graphics/DisplayDevice.cs +++ b/Source/OpenTK/Graphics/DisplayDevice.cs @@ -189,10 +189,12 @@ namespace OpenTK.Graphics /// Changes the resolution of the DisplayDevice. /// The resolution to set. /// Thrown if the requested resolution could not be set. + /// If the specified resolution is null, this function will restore the original DisplayResolution. public void ChangeResolution(DisplayResolution resolution) { if (resolution == null) - throw new ArgumentNullException("resolution", "Must be a valid resolution."); + this.RestoreResolution(); + if (resolution == current_resolution) return;