mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-26 04:51:07 +00:00
Modified CreateX11WindowInfo to check GraphicsMode.Index.HasValue prior to using it.
This commit is contained in:
parent
5d5f598707
commit
7a8bfc60ee
|
@ -322,7 +322,11 @@ namespace OpenTK.Platform
|
||||||
|
|
||||||
// get the X11 Visual info for the display.
|
// get the X11 Visual info for the display.
|
||||||
Platform.X11.XVisualInfo info = new Platform.X11.XVisualInfo();
|
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;
|
int dummy;
|
||||||
window.VisualInfo = (Platform.X11.XVisualInfo)Marshal.PtrToStructure(
|
window.VisualInfo = (Platform.X11.XVisualInfo)Marshal.PtrToStructure(
|
||||||
Platform.X11.Functions.XGetVisualInfo(window.Display, Platform.X11.XVisualInfoMask.ID,
|
Platform.X11.Functions.XGetVisualInfo(window.Display, Platform.X11.XVisualInfoMask.ID,
|
||||||
|
|
Loading…
Reference in a new issue