Avoid loading Wgl entry points automatically. This is now explicitly done through WinGLContext.

This commit is contained in:
the_fiddler 2010-11-23 22:08:53 +00:00
parent 45a623a873
commit 23eaef0c70

View file

@ -24,9 +24,9 @@ namespace OpenTK.Platform.Windows
delegatesClass = wglClass.GetNestedType("Delegates", BindingFlags.Static | BindingFlags.NonPublic); delegatesClass = wglClass.GetNestedType("Delegates", BindingFlags.Static | BindingFlags.NonPublic);
importsClass = wglClass.GetNestedType("Imports", BindingFlags.Static | BindingFlags.NonPublic); importsClass = wglClass.GetNestedType("Imports", BindingFlags.Static | BindingFlags.NonPublic);
// Ensure core entry points are ready prior to accessing any method. //// Ensure core entry points are ready prior to accessing any method.
// Resolves bug [#993]: "Possible bug in GraphicsContext.CreateDummyContext()" //// Resolves bug [#993]: "Possible bug in GraphicsContext.CreateDummyContext()"
LoadAll(); //LoadAll();
} }
#endregion #endregion
@ -42,6 +42,8 @@ namespace OpenTK.Platform.Windows
private static bool rebuildExtensionList = true; private static bool rebuildExtensionList = true;
static readonly object SyncRoot = new object();
#endregion #endregion
#region static Delegate LoadDelegate(string name, Type signature) #region static Delegate LoadDelegate(string name, Type signature)
@ -108,7 +110,10 @@ namespace OpenTK.Platform.Windows
/// </summary> /// </summary>
public static void LoadAll() public static void LoadAll()
{ {
OpenTK.Platform.Utilities.LoadExtensions(typeof(Wgl)); lock (SyncRoot)
{
OpenTK.Platform.Utilities.LoadExtensions(typeof(Wgl));
}
} }
#endregion #endregion