diff options
| author | Brian Paul <brian.paul@tungstengraphics.com> | 2002-04-04 16:58:04 +0000 | 
|---|---|---|
| committer | Brian Paul <brian.paul@tungstengraphics.com> | 2002-04-04 16:58:04 +0000 | 
| commit | 01dc182ee86922845ba0b17a2cda9af19150c93a (patch) | |
| tree | 45b0b0cb76d49fdf36f7be3c0bcdb99bfa19ce92 | |
| parent | 486734a5d50ff9114b567b5e9eac6337248a80e6 (diff) | |
added OSMesaGetProcAddress()
| -rw-r--r-- | include/GL/osmesa.h | 17 | ||||
| -rw-r--r-- | src/mesa/drivers/osmesa/osmesa.c | 35 | 
2 files changed, 47 insertions, 5 deletions
| diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index 63ce843b68..d941237812 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,10 +1,10 @@ -/* $Id: osmesa.h,v 1.9 2001/09/23 16:06:13 brianp Exp $ */ +/* $Id: osmesa.h,v 1.10 2002/04/04 16:58:04 brianp Exp $ */  /*   * Mesa 3-D graphics library - * Version:  4.0 + * Version:  4.1   *  - * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved. + * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.   *    * Permission is hereby granted, free of charge, to any person obtaining a   * copy of this software and associated documentation files (the "Software"), @@ -63,7 +63,7 @@ extern "C" {  #define OSMESA_MAJOR_VERSION 4 -#define OSMESA_MINOR_VERSION 0 +#define OSMESA_MINOR_VERSION 1  #define OSMESA_PATCH_VERSION 0 @@ -254,6 +254,15 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height, +/* + * Return pointer to the named function. + * + * New in Mesa 4.1 + */ +GLAPI void * GLAPIENTRY +OSMesaGetProcAddress( const char *funcName ); + +  #if defined(__BEOS__) || defined(__QUICKDRAW__)  #pragma export off  #endif diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index b7b667dd73..4fdf290383 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,4 +1,4 @@ -/* $Id: osmesa.c,v 1.77 2002/04/04 00:54:02 brianp Exp $ */ +/* $Id: osmesa.c,v 1.78 2002/04/04 16:58:04 brianp Exp $ */  /*   * Mesa 3-D graphics library @@ -621,6 +621,39 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width,     }  } + + +struct name_address { +   const char *Name; +   GLvoid *Address; +}; + +static struct name_address functions[] = { +   { "OSMesaCreateContext", (void *) OSMesaCreateContext }, +   { "OSMesaCreateContextExt", (void *) OSMesaCreateContextExt }, +   { "OSMesaDestroyContext", (void *) OSMesaDestroyContext }, +   { "OSMesaMakeCurrent", (void *) OSMesaMakeCurrent }, +   { "OSMesaGetCurrentContext", (void *) OSMesaGetCurrentContext }, +   { "OSMesaPixelsStore", (void *) OSMesaPixelStore }, +   { "OSMesaGetIntegerv", (void *) OSMesaGetIntegerv }, +   { "OSMesaGetDepthBuffer", (void *) OSMesaGetDepthBuffer }, +   { "OSMesaGetColorBuffer", (void *) OSMesaGetColorBuffer }, +   { "OSMesaGetProcAddress", (void *) OSMesaGetProcAddress }, +   { NULL, NULL } +}; + +GLAPI void * GLAPIENTRY +OSMesaGetProcAddress( const char *funcName ) +{ +   int i; +   for (i = 0; functions[i].Name; i++) { +      if (strcmp(functions[i].Name, funcName) == 0) +         return (void *) functions[i].Address; +   } +   return (void *) _glapi_get_proc_address(funcName); +} + +  /**********************************************************************/  /*** Device Driver Functions                                        ***/  /**********************************************************************/ | 
