Ensure Wgl core entry points are loaded prior to first use, even without a Wgl context.

Do not query actual GraphicsMode.Default in DummyGLContext constructor. Doing so creates a temporary context, which should not be done when creating a dummy context.
Fixed issue [#993]: "Possible bug in GraphicsContext.CreateDummyContext()".
This commit is contained in:
the_fiddler 2009-08-11 21:45:32 +00:00
parent 93b950ec22
commit 81b06b8a08
2 changed files with 5 additions and 2 deletions

View file

@ -19,7 +19,8 @@ namespace OpenTK.Platform.Dummy
/// </summary>
internal sealed class DummyGLContext : IGraphicsContext, IGraphicsContextInternal
{
GraphicsMode format = GraphicsMode.Default;
// This mode is not real. To receive a real mode we'd have to create a temporary context, which is not desirable!
GraphicsMode format = new GraphicsMode(new IntPtr(2), 32, 16, 0, 0, 0, 2, false);
bool vsync;
ContextHandle handle;
static int handle_count;

View file

@ -24,7 +24,9 @@ namespace OpenTK.Platform.Windows
delegatesClass = wglClass.GetNestedType("Delegates", BindingFlags.Static | BindingFlags.NonPublic);
importsClass = wglClass.GetNestedType("Imports", BindingFlags.Static | BindingFlags.NonPublic);
//LoadAll();
// Ensure core entry points are ready prior to accessing any method.
// Resolves bug [#993]: "Possible bug in GraphicsContext.CreateDummyContext()"
LoadAll();
}
#endregion