ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

glapi.c File Reference
#include "main/glheader.h"
#include <stdlib.h>
#include <string.h>
#include "glapi.h"
#include "glapioffsets.h"
#include "glapitable.h"
#include "glapitemp.h"

Go to the source code of this file.

Defines

#define KEYWORD1   static
#define KEYWORD1_ALT   static
#define KEYWORD2   GLAPIENTRY
#define NAME(func)   NoOp##func
#define F   NULL
#define DISPATCH(func, args, msg)
#define RETURN_DISPATCH(func, args, msg)
#define DISPATCH_TABLE_NAME   __glapi_noop_table
#define UNUSED_TABLE_NAME   __unused_noop_functions
#define TABLE_ENTRY(name)   (_glapi_proc) NoOp##name
#define NEED_FUNCTION_POINTER
#define DISPATCH_TABLE_SIZE   (sizeof(struct _glapi_table) / sizeof(void *) + MAX_EXTENSION_FUNCS)

Functions

PUBLIC void _glapi_noop_enable_warnings (GLboolean enable)
PUBLIC void _glapi_set_warning_func (_glapi_warning_func func)
static GLboolean warn (void)
static GLint NoOpUnused (void)
void _glapi_check_multithread (void)
PUBLIC void _glapi_set_context (void *context)
PUBLIC void_glapi_get_context (void)
PUBLIC void _glapi_set_dispatch (struct _glapi_table *dispatch)
PUBLIC struct _glapi_table_glapi_get_dispatch (void)
PUBLIC GLuint _glapi_get_dispatch_table_size (void)
void _glapi_check_table (const struct _glapi_table *table)

Variables

static GLboolean WarnFlag = GL_FALSE
static _glapi_warning_func warning_func
Current dispatch and current context control variables

Depending on whether or not multithreading is support, and the type of support available, several variables are used to store the current context pointer and the current dispatch table pointer. In the non-threaded case, the variables _glapi_Dispatch and _glapi_Context are used for this purpose.

In the "normal" threaded case, the variables _glapi_Dispatch and _glapi_Context will be NULL if an application is detected as being multithreaded. Single-threaded applications will use _glapi_Dispatch and _glapi_Context just like the case without any threading support. When _glapi_Dispatch and _glapi_Context are NULL, the thread state data _gl_DispatchTSD and ContextTSD are used. Drivers and the static dispatch functions access these variables via _glapi_get_dispatch and _glapi_get_context.

There is a race condition in setting _glapi_Dispatch to NULL. It is possible for the original thread to be setting it at the same instant a new thread, perhaps running on a different processor, is clearing it. Because of that, ThreadSafe, which can only ever be changed to GL_TRUE, is used to determine whether or not the application is multithreaded.

In the TLS case, the variables _glapi_Dispatch and _glapi_Context are hardcoded to NULL. Instead the TLS variables _glapi_tls_Dispatch and _glapi_tls_Context are used. Having _glapi_Dispatch and _glapi_Context be hardcoded to NULL maintains binary compatability between TLS enabled loaders and non-TLS DRI drivers.

PUBLIC struct _glapi_table_glapi_Dispatch
PUBLIC void_glapi_Context = NULL

Generated on Sat May 26 2012 04:55:53 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.