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 f91631240fdcedf3c755e11c404086a6dd84fbfb..b3be2305fd65c1b2c131957b86b59df2a115d9aa 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 c4478b389146049ecab3d4cd448cda982ff458b6..b8c2bda48552c2cb5663250e4ac8dc159911bb0b 100644 (file)
@@ -72,6 +72,10 @@ extern EGLBoolean
 _eglIsCurrentThreadDummy(void);
 
 
+PUBLIC _EGLContext *
+_eglGetAPIContext(EGLenum api);
+
+
 PUBLIC _EGLContext *
 _eglGetCurrentContext(void);