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 int FindGLXFunction(const GLubyte
*name
)
23 unsigned last
= DI_FUNCTION_COUNT
- 1;
25 while (first
<= last
) {
26 unsigned middle
= (first
+ last
) / 2;
27 int comp
= strcmp((const char *) name
,
28 __glXDispatchTableStrings
[middle
]);
40 static void *__glXGLVNDGetDispatchAddress(const GLubyte
*procName
)
42 int internalIndex
= FindGLXFunction(procName
);
44 if (internalIndex
>= 0) {
45 return __glXDispatchFunctions
[internalIndex
];
51 static void __glXGLVNDSetDispatchIndex(const GLubyte
*procName
, int index
)
53 int internalIndex
= FindGLXFunction(procName
);
55 if (internalIndex
>= 0)
56 __glXDispatchTableIndices
[internalIndex
] = index
;
59 _X_EXPORT Bool
__glx_Main(uint32_t version
, const __GLXapiExports
*exports
,
60 __GLXvendorInfo
*vendor
, __GLXapiImports
*imports
)
62 static Bool initDone
= False
;
64 if (GLX_VENDOR_ABI_GET_MAJOR_VERSION(version
) !=
65 GLX_VENDOR_ABI_MAJOR_VERSION
||
66 GLX_VENDOR_ABI_GET_MINOR_VERSION(version
) <
67 GLX_VENDOR_ABI_MINOR_VERSION
)
72 __glXGLVNDAPIExports
= exports
;
74 imports
->isScreenSupported
= __glXGLVNDIsScreenSupported
;
75 imports
->getProcAddress
= __glXGLVNDGetProcAddress
;
76 imports
->getDispatchAddress
= __glXGLVNDGetDispatchAddress
;
77 imports
->setDispatchIndex
= __glXGLVNDSetDispatchIndex
;
78 imports
->notifyError
= NULL
;
79 imports
->isPatchSupported
= NULL
;
80 imports
->initiatePatch
= NULL
;