1 #ifndef __glx_glvnd_dispatch_funcs_h__
2 #define __glx_glvnd_dispatch_funcs_h__
4 * Helper functions used by g_glxglvnddispatchfuncs.c.
6 #include "glvnd/libglxabi.h"
9 #define __VND __glXGLVNDAPIExports
11 static inline int AddFBConfigMapping(Display
*dpy
, GLXFBConfig config
,
12 __GLXvendorInfo
*vendor
)
14 return __VND
->addVendorFBConfigMapping(dpy
, config
, vendor
);
17 static inline int AddFBConfigsMapping(Display
*dpy
, const GLXFBConfig
*ret
,
18 int *nelements
, __GLXvendorInfo
*vendor
)
22 if (!nelements
|| !ret
)
25 for (i
= 0; i
< *nelements
; i
++) {
26 r
= __VND
->addVendorFBConfigMapping(dpy
, ret
[i
], vendor
);
29 __VND
->removeVendorFBConfigMapping(dpy
, ret
[i
]);
36 static inline int AddDrawableMapping(Display
*dpy
, GLXDrawable drawable
,
37 __GLXvendorInfo
*vendor
)
39 return __VND
->addVendorDrawableMapping(dpy
, drawable
, vendor
);
42 static inline int AddContextMapping(Display
*dpy
, GLXContext ctx
,
43 __GLXvendorInfo
*vendor
)
45 return __VND
->addVendorContextMapping(dpy
, ctx
, vendor
);
48 static inline __GLXvendorInfo
*GetDispatchFromDrawable(Display
*dpy
,
51 return __VND
->vendorFromDrawable(dpy
, drawable
);
54 static inline __GLXvendorInfo
*GetDispatchFromContext(GLXContext ctx
)
56 return __VND
->vendorFromContext(ctx
);
59 static inline __GLXvendorInfo
*GetDispatchFromFBConfig(Display
*dpy
, GLXFBConfig config
)
61 return __VND
->vendorFromFBConfig(dpy
, config
);
64 static inline __GLXvendorInfo
*GetDispatchFromVisual(Display
*dpy
,
65 const XVisualInfo
*visual
)
67 return __VND
->getDynDispatch(dpy
, visual
->screen
);
70 #endif // __glx_glvnd_dispatch_funcs_h__