From 6edd78879def7e9e2cf02885a8687e3d59704317 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Tue, 9 Dec 2008 10:06:25 +0000 Subject: [PATCH] Fixed build warnings. --- .../OpenTK/Platform/Windows/WinGLContext.cs | 6 ++-- Source/OpenTK/Platform/Windows/WinGLNative.cs | 9 ++++-- Source/OpenTK/Platform/X11/API.cs | 4 ++- Source/OpenTK/Platform/X11/X11GLNative.cs | 30 +++++++++---------- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/Source/OpenTK/Platform/Windows/WinGLContext.cs b/Source/OpenTK/Platform/Windows/WinGLContext.cs index c08cda77..1bab8d18 100644 --- a/Source/OpenTK/Platform/Windows/WinGLContext.cs +++ b/Source/OpenTK/Platform/Windows/WinGLContext.cs @@ -66,6 +66,8 @@ namespace OpenTK.Platform.Windows currentWindow = (WinWindowInfo)window; if (currentWindow.WindowHandle == IntPtr.Zero) throw new ArgumentException("window", "Must be a valid window."); + this.format = format; + Debug.Print("OpenGL will be bound to handle: {0}", currentWindow.WindowHandle); Debug.Write("Setting pixel format... "); @@ -110,7 +112,7 @@ namespace OpenTK.Platform.Windows public void CreateContext() { throw new NotSupportedException(); - this.CreateContext(true, null); + //this.CreateContext(true, null); } #endregion @@ -120,7 +122,7 @@ namespace OpenTK.Platform.Windows public void CreateContext(bool direct) { throw new NotSupportedException(); - this.CreateContext(direct, null); + //this.CreateContext(direct, null); } #endregion diff --git a/Source/OpenTK/Platform/Windows/WinGLNative.cs b/Source/OpenTK/Platform/Windows/WinGLNative.cs index 2b9dad1b..4f4d5069 100644 --- a/Source/OpenTK/Platform/Windows/WinGLNative.cs +++ b/Source/OpenTK/Platform/Windows/WinGLNative.cs @@ -40,13 +40,13 @@ namespace OpenTK.Platform.Windows private WindowState windowState = WindowState.Normal; private int top, bottom, left, right; - private int width = 0, height = 0; + //private int width = 0, height = 0; private Rectangle previous_client_area; private Point position = new Point(); private Rectangle client_rectangle = new Rectangle(); private Size window_size = new Size(); - private Rectangle borders = new Rectangle(); + //private Rectangle borders = new Rectangle(); private ResizeEventArgs resizeEventArgs = new ResizeEventArgs(); @@ -603,10 +603,13 @@ namespace OpenTK.Platform.Windows #region public void OnResize - public event ResizeEvent Resize = null; + public event ResizeEvent Resize; public void OnResize(ResizeEventArgs e) { + if (Resize != null) + Resize(this, e); + throw new NotImplementedException("Use GameWindow.OnResize instead."); //this.width = e.Width; //this.height = e.Height; diff --git a/Source/OpenTK/Platform/X11/API.cs b/Source/OpenTK/Platform/X11/API.cs index 6cc18813..e4fefbfe 100644 --- a/Source/OpenTK/Platform/X11/API.cs +++ b/Source/OpenTK/Platform/X11/API.cs @@ -57,7 +57,7 @@ namespace OpenTK.Platform.X11 static int screenCount; internal static Display DefaultDisplay { get { return defaultDisplay; } } - //internal static int DefaultScreen { get { return defaultScreen; } } + static int DefaultScreen { get { return defaultScreen; } } //internal static Window RootWindow { get { return rootWindow; } } internal static int ScreenCount { get { return screenCount; } } @@ -743,6 +743,8 @@ XF86VidModeGetGammaRampSize( #region unsafe internal class XExtData + #pragma warning disable 0169, 0649 + unsafe internal class XExtData { int number; /* number returned by XRegisterExtension */ diff --git a/Source/OpenTK/Platform/X11/X11GLNative.cs b/Source/OpenTK/Platform/X11/X11GLNative.cs index d5c13d3c..065b47b3 100644 --- a/Source/OpenTK/Platform/X11/X11GLNative.cs +++ b/Source/OpenTK/Platform/X11/X11GLNative.cs @@ -61,16 +61,16 @@ namespace OpenTK.Platform.X11 IntPtr _atom_net_wm_action_maximize_horizontally; IntPtr _atom_net_wm_action_maximize_vertically; - IntPtr _atom_motif_wm_hints; - IntPtr _atom_kde_wm_hints; - IntPtr _atom_kde_net_wm_hints; + //IntPtr _atom_motif_wm_hints; + //IntPtr _atom_kde_wm_hints; + //IntPtr _atom_kde_net_wm_hints; static readonly IntPtr _atom_remove = (IntPtr)0; static readonly IntPtr _atom_add = (IntPtr)1; static readonly IntPtr _atom_toggle = (IntPtr)2; // Number of pending events. - int pending = 0; + //int pending = 0; int width, height; int top, bottom, left, right; @@ -86,11 +86,11 @@ namespace OpenTK.Platform.X11 bool isExiting; // XAtoms for window properties - static IntPtr WMTitle; // The title of the GameWindow. - static IntPtr UTF8String; // No idea. + //static IntPtr WMTitle; // The title of the GameWindow. + //static IntPtr UTF8String; // No idea. // Fields used for fullscreen mode changes. - int pre_fullscreen_width, pre_fullscreen_height; + //int pre_fullscreen_width, pre_fullscreen_height; //bool fullscreen = false; bool _decorations_hidden = false; @@ -646,7 +646,7 @@ namespace OpenTK.Platform.X11 IntPtr bytes_after; IntPtr prop = IntPtr.Zero; IntPtr atom; - XWindowAttributes attributes; + //XWindowAttributes attributes; bool fullscreen = false; int maximized = 0; bool minimized = false; @@ -995,7 +995,7 @@ namespace OpenTK.Platform.X11 IntPtr bytes_after; IntPtr prop = IntPtr.Zero; IntPtr atom; - XWindowAttributes attributes; + //XWindowAttributes attributes; Functions.XGetWindowProperty(window.Display, window.WindowHandle, _atom_net_wm_allowed_actions, IntPtr.Zero, new IntPtr(256), false, @@ -1023,13 +1023,13 @@ namespace OpenTK.Platform.X11 { get { - IntPtr actual_atom; - int actual_format; - IntPtr nitems; - IntPtr bytes_after; + //IntPtr actual_atom; + //int actual_format; + //IntPtr nitems; + //IntPtr bytes_after; IntPtr prop = IntPtr.Zero; - IntPtr atom; - XWindowAttributes attributes; + //IntPtr atom; + //XWindowAttributes attributes; // Test if decorations have been disabled through Motif. IntPtr motif_hints_atom = Functions.XInternAtom(this.window.Display, MOTIF_WM_ATOM, true);