4 #include "glvnd/libglxabi.h"
9 static Bool
__glXGLVNDIsScreenSupported(Display
*dpy
, int screen
)
11 /* TODO: Think of a better heuristic... */
15 static void *__glXGLVNDGetProcAddress(const GLubyte
*procName
)
17 return glXGetProcAddressARB(procName
);
20 static unsigned FindGLXFunction(const GLubyte
*name
)
23 int last
= DI_FUNCTION_COUNT
- 1;
25 while (first
<= last
) {
26 int middle
= (first
+ last
) / 2;
27 int comp
= strcmp((const char *) name
,
28 __glXDispatchTableStrings
[middle
]);
38 /* Just point to the dummy entry at the end of the respective table */
39 return DI_FUNCTION_COUNT
;
42 static void *__glXGLVNDGetDispatchAddress(const GLubyte
*procName
)
44 unsigned internalIndex
= FindGLXFunction(procName
);
46 return __glXDispatchFunctions
[internalIndex
];
49 static void __glXGLVNDSetDispatchIndex(const GLubyte
*procName
, int index
)
51 unsigned internalIndex
= FindGLXFunction(procName
);
53 __glXDispatchTableIndices
[internalIndex
] = index
;
56 _X_EXPORT Bool
__glx_Main(uint32_t version
, const __GLXapiExports
*exports
,
57 __GLXvendorInfo
*vendor
, __GLXapiImports
*imports
)
59 static Bool initDone
= False
;
61 if (GLX_VENDOR_ABI_GET_MAJOR_VERSION(version
) !=
62 GLX_VENDOR_ABI_MAJOR_VERSION
||
63 GLX_VENDOR_ABI_GET_MINOR_VERSION(version
) <
64 GLX_VENDOR_ABI_MINOR_VERSION
)
69 __glXGLVNDAPIExports
= exports
;
71 imports
->isScreenSupported
= __glXGLVNDIsScreenSupported
;
72 imports
->getProcAddress
= __glXGLVNDGetProcAddress
;
73 imports
->getDispatchAddress
= __glXGLVNDGetDispatchAddress
;
74 imports
->setDispatchIndex
= __glXGLVNDSetDispatchIndex
;
75 imports
->notifyError
= NULL
;
76 imports
->isPatchSupported
= NULL
;
77 imports
->initiatePatch
= NULL
;