Reload WGL entry points in WinGLContext()

This fixes AccessViolationException when creating multiple contexts on
Intel hardware.
This commit is contained in:
Stefanos A. 2013-10-03 14:04:34 +02:00
parent c077d5c026
commit 3c867838e6

View file

@ -64,7 +64,14 @@ namespace OpenTK.Platform.Windows
lock (LoadLock)
{
if (!wgl_loaded)
// On intel drivers, wgl entry points appear to change
// when creating multiple contexts. As a workaround,
// we reload Wgl entry points every time we create a
// new context - this solves the issue without any apparent
// side-effects (i.e. the old contexts can still be handled
// using the new entry points.)
// Sigh...
// if (!wgl_loaded)
{
// We need to create a temp context in order to load wgl extensions (e.g. for multisampling or GL3).
// We cannot rely on OpenTK.Platform.Wgl until we create the context and call Wgl.LoadAll().