egl: Add _eglGetAPIContext.
authorChia-I Wu <olvaffe@gmail.com>
Tue, 26 Jan 2010 08:52:14 +0000 (16:52 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Tue, 26 Jan 2010 10:46:05 +0000 (18:46 +0800)
It will return the currently bound context of the given API.

src/egl/main/eglcurrent.c
src/egl/main/eglcurrent.h

index f916312..b3be230 100644 (file)
@@ -227,7 +227,18 @@ _eglIsCurrentThreadDummy(void)
 
 
 /**
- * Return the currently bound context, or NULL.
+ * Return the currently bound context of the given API, or NULL.
+ */
+PUBLIC _EGLContext *
+_eglGetAPIContext(EGLenum api)
+{
+   _EGLThreadInfo *t = _eglGetCurrentThread();
+   return t->CurrentContexts[_eglConvertApiToIndex(api)];
+}
+
+
+/**
+ * Return the currently bound context of the current API, or NULL.
  */
 _EGLContext *
 _eglGetCurrentContext(void)
index c4478b3..b8c2bda 100644 (file)
@@ -73,6 +73,10 @@ _eglIsCurrentThreadDummy(void);
 
 
 PUBLIC _EGLContext *
+_eglGetAPIContext(EGLenum api);
+
+
+PUBLIC _EGLContext *
 _eglGetCurrentContext(void);