diff options
Diffstat (limited to 'src/glx/glxglvnddispatchfuncs.h')
-rw-r--r-- | src/glx/glxglvnddispatchfuncs.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/src/glx/glxglvnddispatchfuncs.h b/src/glx/glxglvnddispatchfuncs.h new file mode 100644 index 00000000000..d9362ff81b4 --- /dev/null +++ b/src/glx/glxglvnddispatchfuncs.h @@ -0,0 +1,70 @@ +#ifndef __glx_glvnd_dispatch_funcs_h__ +#define __glx_glvnd_dispatch_funcs_h__ +/* + * Helper functions used by g_glxglvnddispatchfuncs.c. + */ +#include "glvnd/libglxabi.h" +#include "glxglvnd.h" + +#define __VND __glXGLVNDAPIExports + +static inline int AddFBConfigMapping(Display *dpy, GLXFBConfig config, + __GLXvendorInfo *vendor) +{ + return __VND->addVendorFBConfigMapping(dpy, config, vendor); +} + +static inline int AddFBConfigsMapping(Display *dpy, const GLXFBConfig *ret, + int *nelements, __GLXvendorInfo *vendor) +{ + int i, r; + + if (!nelements || !ret) + return 0; + + for (i = 0; i < *nelements; i++) { + r = __VND->addVendorFBConfigMapping(dpy, ret[i], vendor); + if (r) { + for (; i >= 0; i--) + __VND->removeVendorFBConfigMapping(dpy, ret[i]); + break; + } + } + return r; +} + +static inline int AddDrawableMapping(Display *dpy, GLXDrawable drawable, + __GLXvendorInfo *vendor) +{ + return __VND->addVendorDrawableMapping(dpy, drawable, vendor); +} + +static inline int AddContextMapping(Display *dpy, GLXContext ctx, + __GLXvendorInfo *vendor) +{ + return __VND->addVendorContextMapping(dpy, ctx, vendor); +} + +static inline __GLXvendorInfo *GetDispatchFromDrawable(Display *dpy, + GLXDrawable drawable) +{ + return __VND->vendorFromDrawable(dpy, drawable); +} + +static inline __GLXvendorInfo *GetDispatchFromContext(GLXContext ctx) +{ + return __VND->vendorFromContext(ctx); +} + +static inline __GLXvendorInfo *GetDispatchFromFBConfig(Display *dpy, GLXFBConfig config) +{ + return __VND->vendorFromFBConfig(dpy, config); +} + +static inline __GLXvendorInfo *GetDispatchFromVisual(Display *dpy, + const XVisualInfo *visual) +{ + return __VND->getDynDispatch(dpy, visual->screen); +} + +#endif // __glx_glvnd_dispatch_funcs_h__ |