diff --git a/Source/OpenTK/Platform/X11/API.cs b/Source/OpenTK/Platform/X11/API.cs index 068c8ef3..753943df 100644 --- a/Source/OpenTK/Platform/X11/API.cs +++ b/Source/OpenTK/Platform/X11/API.cs @@ -586,27 +586,31 @@ XF86VidModeGetGammaRampSize( #region internal class XVisualInfo +#pragma warning disable 1591 + [StructLayout(LayoutKind.Sequential)] public struct XVisualInfo { - public IntPtr visual; - public VisualID visualid; - public int screen; - public int depth; - public XVisualClass @class; - public long redMask; - public long greenMask; + public IntPtr Visual; + public VisualID VisualID; + public int Screen; + public int Depth; + public XVisualClass Class; + public long RedMask; + public long GreenMask; public long blueMask; - public int colormap_size; - public int bits_per_rgb; + public int ColormapSize; + public int BitsPerRgb; public override string ToString() { return String.Format("id ({0}), screen ({1}), depth ({2}), class ({3})", - visualid, screen, depth, @class); + VisualID, Screen, Depth, Class); } } +#pragma warning restore 1591 + #endregion #region internal class SetWindowAttributes @@ -1254,6 +1258,8 @@ XF86VidModeGetGammaRampSize( #endregion +#pragma warning disable 1591 + public enum XVisualClass : int { StaticGray = 0, @@ -1264,6 +1270,8 @@ XF86VidModeGetGammaRampSize( DirectColor = 5, } +#pragma warning restore 1591 + [Flags] internal enum XVisualInfoMask { diff --git a/Source/OpenTK/Platform/X11/Structs.cs b/Source/OpenTK/Platform/X11/Structs.cs index 14f8cc27..e6066f23 100644 --- a/Source/OpenTK/Platform/X11/Structs.cs +++ b/Source/OpenTK/Platform/X11/Structs.cs @@ -834,7 +834,7 @@ namespace OpenTK.Platform.X11 XK_Hyper_R = 0xFFEE, } - +#pragma warning disable 1591 [Flags] public enum EventMask @@ -867,6 +867,8 @@ namespace OpenTK.Platform.X11 OwnerGrabButtonMask = 1 << 24 } +#pragma warning restore 1591 + internal enum GrabMode { GrabModeSync = 0, diff --git a/Source/OpenTK/Platform/X11/X11GLContext.cs b/Source/OpenTK/Platform/X11/X11GLContext.cs index e63cd853..9dd44e77 100644 --- a/Source/OpenTK/Platform/X11/X11GLContext.cs +++ b/Source/OpenTK/Platform/X11/X11GLContext.cs @@ -154,8 +154,8 @@ namespace OpenTK.Platform.X11 XVisualInfo SelectVisual(GraphicsMode mode, X11WindowInfo currentWindow) { XVisualInfo info = new XVisualInfo(); - info.visualid = (IntPtr)mode.Index; - info.screen = currentWindow.Screen; + info.VisualID = (IntPtr)mode.Index; + info.Screen = currentWindow.Screen; int items; lock (API.Lock) diff --git a/Source/OpenTK/Platform/X11/X11GLControl.cs b/Source/OpenTK/Platform/X11/X11GLControl.cs index 6dc0b90a..7f23af22 100644 --- a/Source/OpenTK/Platform/X11/X11GLControl.cs +++ b/Source/OpenTK/Platform/X11/X11GLControl.cs @@ -30,16 +30,16 @@ namespace OpenTK.Platform.X11 X11WindowInfo window = (X11WindowInfo)this.WindowInfo; XVisualInfo info = new XVisualInfo(); - info.visualid = mode.Index; + info.VisualID = mode.Index; int dummy; window.VisualInfo = (XVisualInfo)Marshal.PtrToStructure( Functions.XGetVisualInfo(window.Display, XVisualInfoMask.ID, ref info, out dummy), typeof(XVisualInfo)); Type xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms"); xplatui.GetField("CustomVisual", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic) - .SetValue(null, window.VisualInfo.visual); + .SetValue(null, window.VisualInfo.Visual); xplatui.GetField("CustomColormap", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic) - .SetValue(null, Functions.XCreateColormap(window.Display, window.RootWindow, window.VisualInfo.visual, 0)); + .SetValue(null, Functions.XCreateColormap(window.Display, window.RootWindow, window.VisualInfo.Visual, 0)); } #region --- IGLControl Members --- diff --git a/Source/OpenTK/Platform/X11/X11GLNative.cs b/Source/OpenTK/Platform/X11/X11GLNative.cs index 265e4e61..7585077b 100644 --- a/Source/OpenTK/Platform/X11/X11GLNative.cs +++ b/Source/OpenTK/Platform/X11/X11GLNative.cs @@ -124,7 +124,7 @@ namespace OpenTK.Platform.X11 lock (API.Lock) { - info.visualid = mode.Index; + info.VisualID = mode.Index; int dummy; window.VisualInfo = (XVisualInfo)Marshal.PtrToStructure( Functions.XGetVisualInfo(window.Display, XVisualInfoMask.ID, ref info, out dummy), typeof(XVisualInfo)); @@ -135,7 +135,7 @@ namespace OpenTK.Platform.X11 XSetWindowAttributes attributes = new XSetWindowAttributes(); attributes.background_pixel = IntPtr.Zero; attributes.border_pixel = IntPtr.Zero; - attributes.colormap = Functions.XCreateColormap(window.Display, window.RootWindow, window.VisualInfo.visual, 0/*AllocNone*/); + attributes.colormap = Functions.XCreateColormap(window.Display, window.RootWindow, window.VisualInfo.Visual, 0/*AllocNone*/); window.EventMask = EventMask.StructureNotifyMask | EventMask.SubstructureNotifyMask | EventMask.ExposureMask | EventMask.KeyReleaseMask | EventMask.KeyPressMask | EventMask.PointerMotionMask | EventMask.FocusChangeMask | @@ -146,8 +146,8 @@ namespace OpenTK.Platform.X11 (uint)SetWindowValuemask.BackPixel | (uint)SetWindowValuemask.BorderPixel; window.WindowHandle = Functions.XCreateWindow(window.Display, window.RootWindow, - x, y, width, height, 0, window.VisualInfo.depth/*(int)CreateWindowArgs.CopyFromParent*/, - (int)CreateWindowArgs.InputOutput, window.VisualInfo.visual, (UIntPtr)mask, ref attributes); + x, y, width, height, 0, window.VisualInfo.Depth/*(int)CreateWindowArgs.CopyFromParent*/, + (int)CreateWindowArgs.InputOutput, window.VisualInfo.Visual, (UIntPtr)mask, ref attributes); if (window.WindowHandle == IntPtr.Zero) throw new ApplicationException("XCreateWindow call failed (returned 0)."); diff --git a/Source/OpenTK/Platform/X11/X11GraphicsMode.cs b/Source/OpenTK/Platform/X11/X11GraphicsMode.cs index 58faa8fe..23f6cbf9 100644 --- a/Source/OpenTK/Platform/X11/X11GraphicsMode.cs +++ b/Source/OpenTK/Platform/X11/X11GraphicsMode.cs @@ -70,7 +70,7 @@ namespace OpenTK.Platform.X11 Glx.GetConfig(display, ref info, GLXAttribute.STEREO, out st); stereo = st != 0; - gfx = new GraphicsMode(info.visualid, new ColorFormat(r, g, b, a), depth, stencil, samples, + gfx = new GraphicsMode(info.VisualID, new ColorFormat(r, g, b, a), depth, stencil, samples, new ColorFormat(ar, ag, ab, aa), buffers, stereo); Functions.XFree(visual);