OpenTK.Platform.X11.Glx.GetExtensionDelegate C# (CSharp) Method

GetExtensionDelegate() private static method

Creates a System.Delegate that can be used to call a dynamically exported OpenGL function.
private static GetExtensionDelegate ( string name, Type signature ) : Delegate
name string The name of the OpenGL function (eg. "glNewList")
signature System.Type The signature of the OpenGL function.
return System.Delegate
        private static Delegate GetExtensionDelegate(string name, Type signature)
        {
            IntPtr address = Glx.GetProcAddress(name);

            if (address == IntPtr.Zero ||
                address == new IntPtr(1) ||     // Workaround for buggy nvidia drivers which return
                address == new IntPtr(2))       // 1 or 2 instead of IntPtr.Zero for some extensions.
                return null;
            else
                return Marshal.GetDelegateForFunctionPointer(address, signature);
        }