Refresh rate may be zero.

This commit is contained in:
the_fiddler 2008-01-25 10:23:17 +00:00
parent f4beb31381
commit 9ccb301c04

View file

@ -24,10 +24,11 @@ namespace OpenTK.Graphics
internal DisplayResolution(int width, int height, int bitsPerPixel, float refreshRate) internal DisplayResolution(int width, int height, int bitsPerPixel, float refreshRate)
{ {
// Refresh rate may be zero, since this information may not be available on some platforms.
if (width <= 0) throw new ArgumentOutOfRangeException("width", "Must be greater than zero."); if (width <= 0) throw new ArgumentOutOfRangeException("width", "Must be greater than zero.");
if (height <= 0) throw new ArgumentOutOfRangeException("height", "Must be greater than zero."); if (height <= 0) throw new ArgumentOutOfRangeException("height", "Must be greater than zero.");
if (bitsPerPixel <= 0) throw new ArgumentOutOfRangeException("bitsPerPixel", "Must be greater than zero."); if (bitsPerPixel <= 0) throw new ArgumentOutOfRangeException("bitsPerPixel", "Must be greater than zero.");
if (refreshRate <= 0) throw new ArgumentOutOfRangeException("refreshRate", "Must be greater than zero."); if (refreshRate < 0) throw new ArgumentOutOfRangeException("refreshRate", "Must be greater than zero.");
this.width = width; this.width = width;
this.height = height; this.height = height;