mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-08-04 04:21:12 +00:00
Moved GetExtensionDelegate to the correct position
This commit is contained in:
parent
ffe934fa5d
commit
5d0e7a4acf
|
@ -186,6 +186,27 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region GetExtensionDelegate
|
||||||
|
|
||||||
|
// Creates a System.Delegate that can be used to call a dynamically exported OpenGL function.
|
||||||
|
internal Delegate GetExtensionDelegate(string name, Type signature)
|
||||||
|
{
|
||||||
|
IntPtr address = GetAddress(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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Private Members
|
#region Private Members
|
||||||
|
@ -204,27 +225,6 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region GetExtensionDelegate
|
|
||||||
|
|
||||||
// Creates a System.Delegate that can be used to call a dynamically exported OpenGL function.
|
|
||||||
internal Delegate GetExtensionDelegate(string name, Type signature)
|
|
||||||
{
|
|
||||||
IntPtr address = GetAddress(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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue