diff options
| author | Chia-I Wu <olvaffe@gmail.com> | 2009-09-08 11:01:19 +0800 | 
|---|---|---|
| committer | Chia-I Wu <olvaffe@gmail.com> | 2009-09-12 20:55:57 +0800 | 
| commit | 6fcf6a5a7fe631af7c0dab67455e46a8ba898583 (patch) | |
| tree | 67789630ec03e862ac04eb903ec72c4ca9e7c24d /src | |
| parent | b04d58c0b1bd66ea59c5277a13e83e4306a6d740 (diff) | |
mesa/main: Make FEATURE_texgen follow feature conventions.
As shown in mfeatures.h, this allows users of texgen.h to work without
knowing if the feature is available.
Diffstat (limited to 'src')
| -rw-r--r-- | src/mesa/main/api_exec.c | 14 | ||||
| -rw-r--r-- | src/mesa/main/texgen.c | 20 | ||||
| -rw-r--r-- | src/mesa/main/texgen.h | 22 | 
3 files changed, 42 insertions, 14 deletions
| diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index a2f0dfabda..b7b9aa0bf2 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -93,9 +93,7 @@  #include "texenv.h"  #include "texgetimage.h"  #include "teximage.h" -#if FEATURE_texgen  #include "texgen.h" -#endif  #include "texobj.h"  #include "texparam.h"  #include "texstate.h" @@ -275,17 +273,7 @@ _mesa_init_exec_table(struct _glapi_table *exec)     SET_TexEnvf(exec, _mesa_TexEnvf);     SET_TexEnviv(exec, _mesa_TexEnviv); -#if FEATURE_texgen -   SET_GetTexGendv(exec, _mesa_GetTexGendv); -   SET_GetTexGenfv(exec, _mesa_GetTexGenfv); -   SET_GetTexGeniv(exec, _mesa_GetTexGeniv); -   SET_TexGend(exec, _mesa_TexGend); -   SET_TexGendv(exec, _mesa_TexGendv); -   SET_TexGenf(exec, _mesa_TexGenf); -   SET_TexGenfv(exec, _mesa_TexGenfv); -   SET_TexGeni(exec, _mesa_TexGeni); -   SET_TexGeniv(exec, _mesa_TexGeniv); -#endif +   _mesa_init_texgen_dispatch(exec);     SET_TexImage1D(exec, _mesa_TexImage1D);     SET_TexParameterf(exec, _mesa_TexParameterf); diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index e3feb024c3..8c98ee3602 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -36,6 +36,10 @@  #include "main/macros.h"  #include "main/texgen.h"  #include "math/m_matrix.h" +#include "glapi/dispatch.h" + + +#if FEATURE_texgen  /** @@ -337,3 +341,19 @@ _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params )  } +void  +_mesa_init_texgen_dispatch(struct _glapi_table *disp) +{ +   SET_GetTexGendv(disp, _mesa_GetTexGendv); +   SET_GetTexGenfv(disp, _mesa_GetTexGenfv); +   SET_GetTexGeniv(disp, _mesa_GetTexGeniv); +   SET_TexGend(disp, _mesa_TexGend); +   SET_TexGendv(disp, _mesa_TexGendv); +   SET_TexGenf(disp, _mesa_TexGenf); +   SET_TexGenfv(disp, _mesa_TexGenfv); +   SET_TexGeni(disp, _mesa_TexGeni); +   SET_TexGeniv(disp, _mesa_TexGeniv); +} + + +#endif /* FEATURE_texgen */ diff --git a/src/mesa/main/texgen.h b/src/mesa/main/texgen.h index 073588efcd..2ca026de3d 100644 --- a/src/mesa/main/texgen.h +++ b/src/mesa/main/texgen.h @@ -27,9 +27,16 @@  #define TEXGEN_H -#include "main/glheader.h" +#include "main/mtypes.h" +#if FEATURE_texgen + +#define _MESA_INIT_TEXGEN_FUNCTIONS(driver, impl) \ +   do {                                           \ +      (driver)->TexGen = impl ## TexGen;          \ +   } while (0) +  extern void GLAPIENTRY  _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); @@ -57,6 +64,19 @@ _mesa_TexGeni( GLenum coord, GLenum pname, GLint param );  extern void GLAPIENTRY  _mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params ); +extern void  +_mesa_init_texgen_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_texgen */ + +#define _MESA_INIT_TEXGEN_FUNCTIONS(driver, impl) do { } while (0) + +static INLINE void  +_mesa_init_texgen_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_texgen */  #endif /* TEXGEN_H */ | 
