summaryrefslogtreecommitdiff
path: root/gst-libs/gst/gl/win32
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2014-10-28 17:31:37 +1100
committerMatthew Waters <matthew@centricular.com>2014-10-28 17:33:20 +1100
commit81ceca1aea35cfebf2d4b9b994a6c1ec20adf5b4 (patch)
treefec9bcf1fe152672b42b1261fd5f701be625b3db /gst-libs/gst/gl/win32
parentce1477791956a155b088a9330deae52b5f967243 (diff)
downloadgstreamer-plugins-bad-81ceca1aea35cfebf2d4b9b994a6c1ec20adf5b4.tar.gz
glcontext: add api for retreiving the current context and api
that is current in the calling thread.
Diffstat (limited to 'gst-libs/gst/gl/win32')
-rw-r--r--gst-libs/gst/gl/win32/gstglcontext_wgl.c9
-rw-r--r--gst-libs/gst/gl/win32/gstglcontext_wgl.h1
2 files changed, 9 insertions, 1 deletions
diff --git a/gst-libs/gst/gl/win32/gstglcontext_wgl.c b/gst-libs/gst/gl/win32/gstglcontext_wgl.c
index 4886e9af5..7547b4727 100644
--- a/gst-libs/gst/gl/win32/gstglcontext_wgl.c
+++ b/gst-libs/gst/gl/win32/gstglcontext_wgl.c
@@ -289,10 +289,17 @@ static gpointer
gst_gl_context_wgl_get_proc_address (GstGLContext * context, const gchar * name)
{
gpointer result;
+ GstGLAPI gl_api = gst_gl_context_get_gl_api (context);
- if (!(result = gst_gl_context_default_get_proc_address (context, name))) {
+ if (!(result = gst_gl_context_default_get_proc_address (gl_api, name))) {
result = wglGetProcAddress ((LPCSTR) name);
}
return result;
}
+
+guintptr
+gst_gl_context_wgl_get_current_context (void)
+{
+ return (guintptr) wglGetCurrentContext ();
+}
diff --git a/gst-libs/gst/gl/win32/gstglcontext_wgl.h b/gst-libs/gst/gl/win32/gstglcontext_wgl.h
index b996dc7cb..d840175e1 100644
--- a/gst-libs/gst/gl/win32/gstglcontext_wgl.h
+++ b/gst-libs/gst/gl/win32/gstglcontext_wgl.h
@@ -56,6 +56,7 @@ struct _GstGLContextWGLClass {
GType gst_gl_context_wgl_get_type (void);
GstGLContextWGL * gst_gl_context_wgl_new (void);
+guintptr gst_gl_context_wgl_get_current_context (void);
G_END_DECLS