mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-12 09:15:36 +00:00
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:
parent
93b950ec22
commit
81b06b8a08
|
@ -19,7 +19,8 @@ namespace OpenTK.Platform.Dummy
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal sealed class DummyGLContext : IGraphicsContext, IGraphicsContextInternal
|
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;
|
bool vsync;
|
||||||
ContextHandle handle;
|
ContextHandle handle;
|
||||||
static int handle_count;
|
static int handle_count;
|
||||||
|
|
|
@ -24,7 +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);
|
||||||
|
|
||||||
//LoadAll();
|
// Ensure core entry points are ready prior to accessing any method.
|
||||||
|
// Resolves bug [#993]: "Possible bug in GraphicsContext.CreateDummyContext()"
|
||||||
|
LoadAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
Loading…
Reference in a new issue