egl_glx: Add support for eglWaitClient and eglWaitNative.
authorChia-I Wu <olvaffe@gmail.com>
Fri, 2 Oct 2009 02:38:14 +0000 (10:38 +0800)
committerBrian Paul <brianp@vmware.com>
Thu, 22 Oct 2009 15:33:27 +0000 (09:33 -0600)
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
src/egl/drivers/glx/egl_glx.c

index 71b26181c1fe14d0bee680f69f9288538fe6421e..96292b0e9e867f8479980a32c01777d495ee9f8c 100644 (file)
@@ -904,6 +904,21 @@ GLX_eglGetProcAddress(const char *procname)
    return (_EGLProc) glXGetProcAddress((const GLubyte *) procname);
 }
 
+static EGLBoolean
+GLX_eglWaitClient(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx)
+{
+   glXWaitGL();
+   return EGL_TRUE;
+}
+
+static EGLBoolean
+GLX_eglWaitNative(_EGLDriver *drv, _EGLDisplay *dpy, EGLint engine)
+{
+   if (engine != EGL_CORE_NATIVE_ENGINE)
+      return _eglError(EGL_BAD_PARAMETER, "eglWaitNative");
+   glXWaitX();
+   return EGL_TRUE;
+}
 
 static void
 GLX_Unload(_EGLDriver *drv)
@@ -936,6 +951,8 @@ _eglMain(const char *args)
    GLX_drv->Base.API.DestroySurface = GLX_eglDestroySurface;
    GLX_drv->Base.API.SwapBuffers = GLX_eglSwapBuffers;
    GLX_drv->Base.API.GetProcAddress = GLX_eglGetProcAddress;
+   GLX_drv->Base.API.WaitClient = GLX_eglWaitClient;
+   GLX_drv->Base.API.WaitNative = GLX_eglWaitNative;
 
    GLX_drv->Base.Name = "GLX";
    GLX_drv->Base.Unload = GLX_Unload;