diff options
author | Kyle Brenneman <kbrenneman@nvidia.com> | 2016-03-03 11:11:11 -0700 |
---|---|---|
committer | Kyle Brenneman <kbrenneman@nvidia.com> | 2016-03-03 11:11:11 -0700 |
commit | 58d8dcaeb0eb8e1e80f8e086613d08c4817de9e5 (patch) | |
tree | add487d3b5736a385098068ecae2eaa057e00168 /include | |
parent | b45f4d8efbdaf6b752f10365ec32f1eda33356d8 (diff) |
GLX: Change the __glx_Main function prototype.
Removed the vendorID and vendorName parameters from the __glx_Main function,
since neither one is useful to a vendor.
Instead, __glx_Main now takes the __GLXvendorInfo pointer as a parameter. We
can use that to look up any additional per-vendor information that might be
added in the future.
Diffstat (limited to 'include')
-rw-r--r-- | include/glvnd/libglxabi.h | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/include/glvnd/libglxabi.h b/include/glvnd/libglxabi.h index facd9c3..63d6186 100644 --- a/include/glvnd/libglxabi.h +++ b/include/glvnd/libglxabi.h @@ -311,25 +311,40 @@ typedef struct __GLXapiImportsRec { /*****************************************************************************/ -/*! - * Vendor libraries must export a function called __glx_Main() with the - * following prototype. This function also performs a handshake based on the ABI - * version number. This function receives a pointer to an exports table whose - * lifetime is only guaranteed to be at a minimum that of the call to - * __glx_Main(), in addition to the version number and a string identifying the - * vendor. If there is an ABI version mismatch or some other error occurs, this - * function returns NULL; otherwise this returns a pointer to a filled-in - * dispatch table. - */ #define __GLX_MAIN_PROTO_NAME "__glx_Main" #define __GLX_MAIN_PROTO(version, exports, vendorName) \ const __GLXapiImports *__glx_Main(uint32_t version, \ const __GLXapiExports *exports, \ - const char *vendorName, \ - int vendorID) + __GLXvendorInfo *vendor) typedef const __GLXapiImports *(*__PFNGLXMAINPROC) - (uint32_t, const __GLXapiExports *, const char *, int); + (uint32_t version, const __GLXapiExports *exports, __GLXvendorInfo *vendor); + +/*! + * Vendor libraries must export a function called __glx_Main() with the + * following prototype. + * + * This function also performs a handshake based on the ABI version number. + * Vendor libraries can optionally use the version number to support older + * versions of the ABI. + * + * \param version The ABI version. The upper 16 bits contains the major version + * number, and the lower 16 bits contains the minor version number. + * + * \param exports The table of functions provided by libGLX. This pointer will + * remain valid for as long as the vendor is loaded. + * + * \param vendor The opaque pointer used to identify this vendor library. This + * may be used in future versions to provide additional per-vendor information. + * + * \return A pointer to a __GLXapiImports struct, which must remain valid for + * as long as the vendor is loaded. If the vendor library does not support the + * requested ABI version, or if some other error occurrs, then it should return + * \c NULL. + */ +const __GLXapiImports *__glx_Main(uint32_t version, + const __GLXapiExports *exports, + __GLXvendorInfo *vendor); /*! * @} |