[PATCH 4/7] egl: Update glproc.py

Chia-I Wu olvaffe at gmail.com
Thu Nov 3 03:56:56 PDT 2011


Generate dispatch functions for EGL API.
---
 CMakeLists.txt |    2 +-
 glproc.py      |   49 +++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 48 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 30208cd..5c59351 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -224,7 +224,7 @@ include_directories (
 add_custom_command (
     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glproc.py > ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
-    DEPENDS glproc.py dispatch.py specs/wglapi.py specs/glxapi.py specs/cglapi.py specs/glapi.py specs/gltypes.py specs/stdapi.py
+    DEPENDS glproc.py dispatch.py specs/wglapi.py specs/glxapi.py specs/cglapi.py specs/eglapi.py specs/glapi.py specs/gltypes.py specs/stdapi.py
 )
 
 if (WIN32)
diff --git a/glproc.py b/glproc.py
index 6a44917..a086055 100644
--- a/glproc.py
+++ b/glproc.py
@@ -35,6 +35,7 @@ from specs.glapi import glapi
 from specs.glxapi import glxapi
 from specs.wglapi import wglapi
 from specs.cglapi import cglapi
+from specs.eglapi import eglapi
 
 
 # See http://www.opengl.org/registry/ABI/
@@ -449,6 +450,43 @@ public_symbols = set([
 
 ])
 
+# EGL 1.4
+public_symbols.update([
+   "eglBindAPI",
+   "eglBindTexImage",
+   "eglChooseConfig",
+   "eglCopyBuffers",
+   "eglCreateContext",
+   "eglCreatePbufferFromClientBuffer",
+   "eglCreatePbufferSurface",
+   "eglCreatePixmapSurface",
+   "eglCreateWindowSurface",
+   "eglDestroyContext",
+   "eglDestroySurface",
+   "eglGetConfigAttrib",
+   "eglGetConfigs",
+   "eglGetCurrentContext",
+   "eglGetCurrentDisplay",
+   "eglGetCurrentSurface",
+   "eglGetDisplay",
+   "eglGetError",
+   "eglGetProcAddress",
+   "eglInitialize",
+   "eglMakeCurrent",
+   "eglQueryAPI",
+   "eglQueryContext",
+   "eglQueryString",
+   "eglQuerySurface",
+   "eglReleaseTexImage",
+   "eglReleaseThread",
+   "eglSurfaceAttrib",
+   "eglSwapBuffers",
+   "eglSwapInterval",
+   "eglTerminate",
+   "eglWaitClient",
+   "eglWaitGL",
+   "eglWaitNative",
+])
 
 class GlDispatcher(Dispatcher):
 
@@ -463,7 +501,11 @@ class GlDispatcher(Dispatcher):
         print '#    define __getPrivateProcAddress(name) glXGetProcAddressARB((const GLubyte *)(name))'
         print '#  endif'
         print '#else /* !RETRACE */'
-        print '#  ifdef _WIN32'
+        print '#  if defined(TRACE_EGL)'
+        print '#    define __getPublicProcAddress(name) __libegl_sym(name, true)'
+        print '#    define __getPrivateProcAddress(name) __libegl_sym(name, false)'
+        print '     void * __libegl_sym(const char *symbol, bool pub);'
+        print '#  elif defined(_WIN32)'
         print '     PROC __getPublicProcAddress(LPCSTR lpProcName);'
         print '#    define __getPrivateProcAddress(name) __wglGetProcAddress(name)'
         print '     static inline PROC __stdcall __wglGetProcAddress(const char * lpszProc);'
@@ -495,7 +537,10 @@ if __name__ == '__main__':
     print
     dispatcher = GlDispatcher()
     dispatcher.header()
-    print '#if defined(_WIN32)'
+    print '#if defined(TRACE_EGL)'
+    print
+    dispatcher.dispatch_api(eglapi)
+    print '#elif defined(_WIN32)'
     print
     dispatcher.dispatch_api(wglapi)
     print '#elif defined(__APPLE__)'
-- 
1.7.6.3



More information about the apitrace mailing list