diff options
Diffstat (limited to 'mesalib/src/mapi/glapi/glapi.h')
-rwxr-xr-x[-rw-r--r--] | mesalib/src/mapi/glapi/glapi.h | 86 |
1 files changed, 48 insertions, 38 deletions
diff --git a/mesalib/src/mapi/glapi/glapi.h b/mesalib/src/mapi/glapi/glapi.h index 7c22985ec..67bf1f42e 100644..100755 --- a/mesalib/src/mapi/glapi/glapi.h +++ b/mesalib/src/mapi/glapi/glapi.h @@ -68,9 +68,18 @@ extern "C" { # endif #endif /* _GLAPI_NO_EXPORTS */ +#include "GL/gl.h" +#include "GL/glext.h" -/* Is this needed? It is incomplete anyway. */ -#ifdef USE_MGL_NAMESPACE + +struct _glapi_table; + +typedef void (*_glapi_proc)(void); /* generic function pointer */ + +typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...); + + +#if defined(USE_MGL_NAMESPACE) #define _glapi_set_dispatch _mglapi_set_dispatch #define _glapi_get_dispatch _mglapi_get_dispatch #define _glapi_set_context _mglapi_set_context @@ -79,17 +88,23 @@ extern "C" { #define _glapi_Context _mglapi_Context #endif -typedef void (*_glapi_proc)(void); -struct _glapi_table; +/* + * Number of extension functions which we can dynamically add at runtime. + */ +#define MAX_EXTENSION_FUNCS 300 +/** + ** Define the GET_CURRENT_CONTEXT() macro. + ** \param C local variable which will hold the current context. + **/ #if defined (GLX_USE_TLS) _GLAPI_EXPORT extern __thread struct _glapi_table * _glapi_tls_Dispatch - __attribute__((tls_model("initial-exec"))); + ; _GLAPI_EXPORT extern __thread void * _glapi_tls_Context - __attribute__((tls_model("initial-exec"))); + ; _GLAPI_EXPORT extern const struct _glapi_table *_glapi_Dispatch; _GLAPI_EXPORT extern const void *_glapi_Context; @@ -99,8 +114,14 @@ _GLAPI_EXPORT extern const void *_glapi_Context; #else -_GLAPI_EXPORT extern struct _glapi_table *_glapi_Dispatch; -_GLAPI_EXPORT extern void *_glapi_Context; +#ifdef INSERVER +#define SERVEXTERN _declspec(dllimport) +#else +#define SERVEXTERN _declspec(dllexport) +#endif + +SERVEXTERN struct _glapi_table *_glapi_Dispatch; +SERVEXTERN void *_glapi_Context; # ifdef THREADS @@ -120,64 +141,53 @@ _GLAPI_EXPORT extern void *_glapi_Context; #endif /* defined (GLX_USE_TLS) */ -void -_glapi_destroy_multithread(void); - +/** + ** GL API public functions + **/ -_GLAPI_EXPORT void +SERVEXTERN void _glapi_check_multithread(void); -_GLAPI_EXPORT void +SERVEXTERN void _glapi_set_context(void *context); -_GLAPI_EXPORT void * +SERVEXTERN void * _glapi_get_context(void); -_GLAPI_EXPORT void +SERVEXTERN void _glapi_set_dispatch(struct _glapi_table *dispatch); -_GLAPI_EXPORT struct _glapi_table * +SERVEXTERN struct _glapi_table * _glapi_get_dispatch(void); +SERVEXTERN int +_glapi_begin_dispatch_override(struct _glapi_table *override); + +SERVEXTERN void +_glapi_end_dispatch_override(int layer); -_GLAPI_EXPORT unsigned int +struct _glapi_table * +_glapi_get_override_dispatch(int layer); + +SERVEXTERN GLuint _glapi_get_dispatch_table_size(void); -_GLAPI_EXPORT int +SERVEXTERN int _glapi_add_dispatch( const char * const * function_names, const char * parameter_signature ); -_GLAPI_EXPORT int -_glapi_get_proc_offset(const char *funcName); - - _GLAPI_EXPORT _glapi_proc _glapi_get_proc_address(const char *funcName); - -_GLAPI_EXPORT const char * -_glapi_get_proc_name(unsigned int offset); - - -_GLAPI_EXPORT struct _glapi_table * +extern struct _glapi_table * _glapi_create_table_from_handle(void *handle, const char *symbol_prefix); -/* - * These stubs are kept so that the old DRI drivers still load. - */ -_GLAPI_EXPORT void -_glapi_noop_enable_warnings(unsigned char enable); - - -_GLAPI_EXPORT void -_glapi_set_warning_func(_glapi_proc func); - #ifdef __cplusplus } |