summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-12-17 14:18:49 -0800
committerEric Anholt <eric@anholt.net>2013-12-17 14:34:02 -0800
commit3ae4726cdbb0fccdb02bcdba07662fe6f6a15589 (patch)
tree944936c15ab0f18805dc49671378ab81c03b12e9 /src
parentc4214a39f4ef941316042d48cabfbd826cc7a07f (diff)
win32: Expose the dispatch table reset funtion in the public API.
Fixes #2.
Diffstat (limited to 'src')
-rw-r--r--src/dispatch_wgl.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/dispatch_wgl.c b/src/dispatch_wgl.c
index 743136e..a0b7277 100644
--- a/src/dispatch_wgl.c
+++ b/src/dispatch_wgl.c
@@ -59,8 +59,17 @@ epoxy_has_wgl_extension(HDC hdc, const char *ext)
return epoxy_extension_in_string(getext(hdc), ext);
}
-static void
-reset_dispatch_table(void)
+/**
+ * Does the work necessary to update the win32 per-thread dispatch
+ * tables when wglMakeCurrent() is called.
+ *
+ * Right now, we just reset everything to "do wglGetProcAddress()
+ * again". This could be improved in the future to track a resolved
+ * dispatch table per context and reuse it when the context is made
+ * current again.
+ */
+PUBLIC void
+epoxy_handle_external_wglMakeCurrent(void)
{
gl_init_dispatch_table();
wgl_init_dispatch_table();
@@ -96,7 +105,7 @@ DllMain(HINSTANCE dll, DWORD reason, LPVOID reserved)
data = LocalAlloc(LPTR, wgl_tls_size);
TlsSetValue(wgl_tls_index, data);
- reset_dispatch_table();
+ epoxy_handle_external_wglMakeCurrent();
break;
case DLL_THREAD_DETACH:
@@ -123,7 +132,7 @@ WRAPPER(epoxy_wglMakeCurrent)(HDC hdc, HGLRC hglrc)
{
BOOL ret = epoxy_wglMakeCurrent_unwrapped(hdc, hglrc);
- reset_dispatch_table();
+ epoxy_handle_external_wglMakeCurrent();
return ret;
}
@@ -137,7 +146,7 @@ WRAPPER(epoxy_wglMakeContextCurrentARB)(HDC hDrawDC,
BOOL ret = epoxy_wglMakeContextCurrentARB_unwrapped(hDrawDC, hReadDC,
hglrc);
- reset_dispatch_table();
+ epoxy_handle_external_wglMakeCurrent();
return ret;
}
@@ -151,7 +160,7 @@ WRAPPER(epoxy_wglMakeContextCurrentEXT)(HDC hDrawDC,
BOOL ret = epoxy_wglMakeContextCurrentEXT_unwrapped(hDrawDC, hReadDC,
hglrc);
- reset_dispatch_table();
+ epoxy_handle_external_wglMakeCurrent();
return ret;
}
@@ -162,7 +171,7 @@ WRAPPER(epoxy_wglMakeAssociatedContextCurrentAMD)(HGLRC hglrc)
{
BOOL ret = epoxy_wglMakeAssociatedContextCurrentAMD_unwrapped(hglrc);
- reset_dispatch_table();
+ epoxy_handle_external_wglMakeCurrent();
return ret;
}