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
)
24 for (i
= 0; i
< DI_FUNCTION_COUNT
; i
++) {
25 if (strcmp((const char *) name
, __glXDispatchTableStrings
[i
]) == 0)
31 static void *__glXGLVNDGetDispatchAddress(const GLubyte
*procName
)
33 int internalIndex
= FindGLXFunction(procName
);
35 if (internalIndex
>= 0) {
36 return __glXDispatchFunctions
[internalIndex
];
42 static void __glXGLVNDSetDispatchIndex(const GLubyte
*procName
, int index
)
44 int internalIndex
= FindGLXFunction(procName
);
46 if (internalIndex
>= 0)
47 __glXDispatchTableIndices
[internalIndex
] = index
;
50 _X_EXPORT Bool
__glx_Main(uint32_t version
, const __GLXapiExports
*exports
,
51 __GLXvendorInfo
*vendor
, __GLXapiImports
*imports
)
53 static Bool initDone
= False
;
55 if (GLX_VENDOR_ABI_GET_MAJOR_VERSION(version
) !=
56 GLX_VENDOR_ABI_MAJOR_VERSION
||
57 GLX_VENDOR_ABI_GET_MINOR_VERSION(version
) <
58 GLX_VENDOR_ABI_MINOR_VERSION
)
63 __glXGLVNDAPIExports
= exports
;
65 imports
->isScreenSupported
= __glXGLVNDIsScreenSupported
;
66 imports
->getProcAddress
= __glXGLVNDGetProcAddress
;
67 imports
->getDispatchAddress
= __glXGLVNDGetDispatchAddress
;
68 imports
->setDispatchIndex
= __glXGLVNDSetDispatchIndex
;
69 imports
->notifyError
= NULL
;
70 imports
->isPatchSupported
= NULL
;
71 imports
->initiatePatch
= NULL
;