Allow overriding of loading methods

This commit is contained in:
Stefanos A. 2013-11-24 13:57:08 +01:00
parent 1e71ca9122
commit 475e7ea797

View file

@ -125,7 +125,7 @@ namespace OpenTK
#region LoadEntryPoints #region LoadEntryPoints
internal void LoadEntryPoints() internal virtual void LoadEntryPoints()
{ {
// Using reflection is more than 3 times faster than directly loading delegates on the first // Using reflection is more than 3 times faster than directly loading delegates on the first
// run, probably due to code generation overhead. Subsequent runs are faster with direct loading // run, probably due to code generation overhead. Subsequent runs are faster with direct loading
@ -166,7 +166,7 @@ namespace OpenTK
#region LoadEntryPoint #region LoadEntryPoint
internal bool LoadEntryPoint(string function) internal virtual bool LoadEntryPoint(string function)
{ {
FieldInfo f = DelegatesClass.GetField(function, BindingFlags.Static | BindingFlags.NonPublic); FieldInfo f = DelegatesClass.GetField(function, BindingFlags.Static | BindingFlags.NonPublic);
if (f == null) if (f == null)
@ -189,7 +189,7 @@ namespace OpenTK
#region GetExtensionDelegate #region GetExtensionDelegate
// Creates a System.Delegate that can be used to call a dynamically exported OpenGL function. // Creates a System.Delegate that can be used to call a dynamically exported OpenGL function.
internal Delegate GetExtensionDelegate(string name, Type signature) internal virtual Delegate GetExtensionDelegate(string name, Type signature)
{ {
IntPtr address = GetAddress(name); IntPtr address = GetAddress(name);