mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
058d79dce2
Previously if you need to depend on a new GL feature you had to: - Add typedefs for all of the functions in cogl-defines.h.in - Add function pointers for each of the functions in cogl-context-driver.h - Add an initializer for the function pointers in cogl-context-driver.c - Add a check for the extension and all of the functions in cogl_features_init. If the extension is available under multiple names then you have to duplicate the checks. This is quite tedious and error prone. This patch moves all of the features and their functions into a list of macro invocations in cogl-feature-functions.h. The macros can be redefined to implement all of the above tasks from the same header. The features are described in a struct with a pointer to a table of functions. A new function takes the feature description from this struct and checks for its availability. The feature can take a list of extension names with a list of alternate namespaces (such as "EXT" or "ARB"). It can also detect the feature from a particular version of GL. The typedefs are now gone and instead the function pointer in the Cogl context just directly contains the type. Some of the functions in the context were previously declared with the 'ARB' extension. This has been removed so that now all the functions have no suffix. This makes more sense when the extension could potentially be merged into GL core as well. |
||
---|---|---|
.. | ||
cogl-context-driver.c | ||
cogl-context-driver.h | ||
cogl-defines.h.in | ||
cogl-feature-functions.h | ||
cogl-program.c | ||
cogl-program.h | ||
cogl-shader-private.h | ||
cogl-shader.c | ||
cogl-texture-driver.c | ||
cogl.c | ||
Makefile.am |