Modified CreateX11WindowInfo to check GraphicsMode.Index.HasValue prior to using it.

This commit is contained in:
the_fiddler 2009-08-15 16:46:33 +00:00
parent 5d5f598707
commit 7a8bfc60ee

View file

@ -322,7 +322,11 @@ namespace OpenTK.Platform
// get the X11 Visual info for the display.
Platform.X11.XVisualInfo info = new Platform.X11.XVisualInfo();
info.VisualID = mode.Index;
if (!mode.Index.HasValue)
throw new GraphicsModeException("Invalid or unsupported GraphicsMode.");
info.VisualID = mode.Index.Value;
int dummy;
window.VisualInfo = (Platform.X11.XVisualInfo)Marshal.PtrToStructure(
Platform.X11.Functions.XGetVisualInfo(window.Display, Platform.X11.XVisualInfoMask.ID,