#include "GL/gl.h"
#include "GL/glext.h"
#include "glthread.h"
Defines | |
#define | GL_GLEXT_PROTOTYPES |
#define | MAX_EXTENSION_FUNCS 300 |
#define | GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_Context |
Typedefs | |
typedef void(* | _glapi_proc )(void) |
typedef void(* | _glapi_warning_func )(void *ctx, const char *str,...) |
Functions | |
void | _glapi_noop_enable_warnings (GLboolean enable) |
GL API public functions. | |
void | _glapi_set_warning_func (_glapi_warning_func func) |
void | _glapi_check_multithread (void) |
We should call this periodically from a function such as glXMakeCurrent in order to test if multiple threads are being used. | |
void | _glapi_set_context (void *context) |
Set the current context pointer for this thread. | |
void * | _glapi_get_context (void) |
Get the current context pointer for this thread. | |
void | _glapi_set_dispatch (struct _glapi_table *dispatch) |
Set the global or per-thread dispatch table pointer. | |
struct _glapi_table * | _glapi_get_dispatch (void) |
Return pointer to current dispatch table for calling thread. | |
int | _glapi_begin_dispatch_override (struct _glapi_table *override) |
void | _glapi_end_dispatch_override (int layer) |
struct _glapi_table * | _glapi_get_override_dispatch (int layer) |
GLuint | _glapi_get_dispatch_table_size (void) |
Return size of dispatch table struct as number of functions (or slots). | |
void | _glapi_check_table (const struct _glapi_table *table) |
Make sure there are no NULL pointers in the given dispatch table. | |
int | _glapi_add_dispatch (const char *const *function_names, const char *parameter_signature) |
Fill-in the dispatch stub for the named function. | |
GLint | _glapi_get_proc_offset (const char *funcName) |
Return offset of entrypoint for named function within dispatch table. | |
_glapi_proc | _glapi_get_proc_address (const char *funcName) |
Return pointer to the named function. | |
const char * | _glapi_get_proc_name (GLuint offset) |
Return the name of the function at the given dispatch offset. | |
Variables | |
void * | _glapi_Context |
Define the GET_CURRENT_CONTEXT() macro. | |
struct _glapi_table * | _glapi_Dispatch |
#define GET_CURRENT_CONTEXT | ( | C | ) | GLcontext *C = (GLcontext *) _glapi_Context |
#define GL_GLEXT_PROTOTYPES |
#define MAX_EXTENSION_FUNCS 300 |
typedef void(* _glapi_proc)(void) |
typedef void(* _glapi_warning_func)(void *ctx, const char *str,...) |
int _glapi_add_dispatch | ( | const char *const * | function_names, | |
const char * | parameter_signature | |||
) |
Fill-in the dispatch stub for the named function.
This function is intended to be called by a hardware driver. When called, a dispatch stub may be created created for the function. A pointer to this dispatch function will be returned by glXGetProcAddress.
function_names | Array of pointers to function names that should share a common dispatch offset. | |
parameter_signature | String representing the types of the parameters passed to the named function. Parameter types are converted to characters using the following rules:
|
dispatch_table
[offset
]. Return -1 if error/problem.glPointParameterfSGIS
, glPointParameterfEXT
, glPointParameterfARB
, and glPointParameterf
), so this should not be too painful of a limitation.parameter_signature
should be allowed to be NULL
. It doesn't seem like much of a hardship for drivers to have to pass in an empty string.parameter_signature
with the parameter signature of a static function. In order to do that, we need to find a way to get the parameter signature of a static function. int _glapi_begin_dispatch_override | ( | struct _glapi_table * | override | ) |
void _glapi_check_multithread | ( | void | ) |
We should call this periodically from a function such as glXMakeCurrent in order to test if multiple threads are being used.
void _glapi_check_table | ( | const struct _glapi_table * | table | ) |
Make sure there are no NULL pointers in the given dispatch table.
Intended for debugging purposes.
void _glapi_end_dispatch_override | ( | int | layer | ) |
void* _glapi_get_context | ( | void | ) |
Get the current context pointer for this thread.
The context pointer is an opaque type which should be cast from void to the real context pointer type.
struct _glapi_table* _glapi_get_dispatch | ( | void | ) | [read] |
Return pointer to current dispatch table for calling thread.
GLuint _glapi_get_dispatch_table_size | ( | void | ) |
Return size of dispatch table struct as number of functions (or slots).
struct _glapi_table* _glapi_get_override_dispatch | ( | int | layer | ) | [read] |
_glapi_proc _glapi_get_proc_address | ( | const char * | funcName | ) |
Return pointer to the named function.
If the function name isn't found in the name of static functions, try generating a new API entrypoint on the fly with assembly language.
const char* _glapi_get_proc_name | ( | GLuint | offset | ) |
Return the name of the function at the given dispatch offset.
This is only intended for debugging.
GLint _glapi_get_proc_offset | ( | const char * | funcName | ) |
Return offset of entrypoint for named function within dispatch table.
void _glapi_noop_enable_warnings | ( | GLboolean | enable | ) |
GL API public functions.
void _glapi_set_context | ( | void * | context | ) |
Set the current context pointer for this thread.
The context pointer is an opaque type which should be cast to void from the real context pointer type.
void _glapi_set_dispatch | ( | struct _glapi_table * | dispatch | ) |
Set the global or per-thread dispatch table pointer.
If the dispatch parameter is NULL we'll plug in the no-op dispatch table (__glapi_noop_table).
void _glapi_set_warning_func | ( | _glapi_warning_func | func | ) |
void* _glapi_Context |
Define the GET_CURRENT_CONTEXT() macro.
C | local variable which will hold the current context. |
struct _glapi_table* _glapi_Dispatch |