From 2f2b7532e2be0c7dd708255f0a64431dd5ba1d92 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Wed, 23 Jan 2008 00:01:03 +0000 Subject: [PATCH] Added glXSwapIntervalSGI method. --- Source/OpenTK/Platform/X11/Glx.cs | 18 +++++++++++- Source/OpenTK/Platform/X11/GlxHelper.cs | 37 +++++++++++++++---------- 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/Source/OpenTK/Platform/X11/Glx.cs b/Source/OpenTK/Platform/X11/Glx.cs index db7a739b..a1c02c40 100644 --- a/Source/OpenTK/Platform/X11/Glx.cs +++ b/Source/OpenTK/Platform/X11/Glx.cs @@ -37,12 +37,13 @@ namespace OpenTK.Platform.X11 using GLdouble = System.Double; using GLclampd = System.Double; using GLstring = System.String; + using System.Security; #endregion /// /// Provides access to GLX functions. /// - public static partial class Glx + partial class Glx { #region Enums @@ -315,5 +316,20 @@ namespace OpenTK.Platform.X11 #endregion #endregion + + public partial class Sgi + { + public static int SwapIntervalSGI(int interval) + { + return Delegates.glXSwapIntervalSGI(interval); + } + } + + partial class Delegates + { + [SuppressUnmanagedCodeSecurity] + internal delegate int SwapIntervalSGI(int interval); + internal static SwapIntervalSGI glXSwapIntervalSGI = null; + } } } diff --git a/Source/OpenTK/Platform/X11/GlxHelper.cs b/Source/OpenTK/Platform/X11/GlxHelper.cs index 98102058..53ec0a16 100644 --- a/Source/OpenTK/Platform/X11/GlxHelper.cs +++ b/Source/OpenTK/Platform/X11/GlxHelper.cs @@ -10,63 +10,72 @@ using System.Text; namespace OpenTK.Platform.X11 { - public static partial class Glx + internal static partial class Glx { internal const string Library = "libGL.so.1"; // Disable BeforeFieldInit optimization. static Glx() { } + + #region internal static void LoadAll + + internal static void LoadAll() + { + OpenTK.Platform.Utilities.LoadExtensions(typeof(Glx)); + } + + #endregion } - public struct Status + internal struct Status { } - public struct GLXFBConfig + internal struct GLXFBConfig { } - public struct GLXPbuffer + internal struct GLXPbuffer { } - public struct GLXContextID + internal struct GLXContextID { } - public struct GLXHyperpipeNetworkPointer + internal struct GLXHyperpipeNetworkPointer { } - public struct GLXHyperpipeConfig + internal struct GLXHyperpipeConfig { } - public struct GLXHyperpipeConfigSGIX + internal struct GLXHyperpipeConfigSGIX { } - public struct GLXHyperpipeConfigPointer + internal struct GLXHyperpipeConfigPointer { } - public struct GLXVideoSourceSGIX + internal struct GLXVideoSourceSGIX { } - public struct GLXFBConfigSGIX + internal struct GLXFBConfigSGIX { } - public struct GLXPbufferSGIX + internal struct GLXPbufferSGIX { } - public struct DMparams + internal struct DMparams { } - public struct DMbuffer + internal struct DMbuffer { } }