diff options
author | Brian Paul <[email protected]> | 1999-11-12 02:07:56 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 1999-11-12 02:07:56 +0000 |
commit | b95d252c347e14825cd61b28223040cfc5d0e7de (patch) | |
tree | 9ecc5d01e2c812079aefdb4311c36e9a2cdb6dc7 | |
parent | a087e348ab534a8293c0dc1eb7fda8794326259d (diff) |
added GL_EXT_texture_env_add extension
-rw-r--r-- | include/GL/gl.h | 13 | ||||
-rw-r--r-- | src/mesa/main/extensions.c | 3 | ||||
-rw-r--r-- | src/mesa/main/texstate.c | 17 |
3 files changed, 26 insertions, 7 deletions
diff --git a/include/GL/gl.h b/include/GL/gl.h index 22477924dee..a0f71bed0b9 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.20 1999/11/11 17:48:32 brianp Exp $ */ +/* $Id: gl.h,v 1.21 1999/11/12 02:08:59 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2308,6 +2308,17 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); +/* + * GL_EXT_texture_env_add + */ +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +/* No new tokens or functions */ + +#endif /* GL_EXT_texture_env_add */ + + #if defined(__BEOS__) || defined(__QUICKDRAW__) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index c8b154d0613..98a7551191d 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -1,4 +1,4 @@ -/* $Id: extensions.c,v 1.12 1999/11/12 02:05:46 brianp Exp $ */ +/* $Id: extensions.c,v 1.13 1999/11/12 02:07:56 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -74,6 +74,7 @@ static struct { int enabled; const char *name; } default_extensions[] = { { DEFAULT_ON, "GL_EXT_compiled_vertex_array" }, { DEFAULT_OFF, "GL_EXT_vertex_array_set" }, { DEFAULT_ON, "GL_EXT_clip_volume_hint" }, + { DEFAULT_ON, "GL_EXT_texture_env_add" }, }; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 7e5ce3085a0..fa893e7f2d7 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,4 +1,4 @@ -/* $Id: texstate.c,v 1.5 1999/11/11 01:22:28 brianp Exp $ */ +/* $Id: texstate.c,v 1.6 1999/11/12 02:07:56 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -31,6 +31,7 @@ #include "glheader.h" #include "context.h" #include "enums.h" +#include "extensions.h" #include "macros.h" #include "matrix.h" #include "texobj.h" @@ -84,10 +85,16 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) if (pname==GL_TEXTURE_ENV_MODE) { GLenum mode = (GLenum) (GLint) *param; switch (mode) { - case GL_MODULATE: - case GL_BLEND: - case GL_DECAL: - case GL_REPLACE: + case GL_ADD: + if (!gl_extension_is_enabled(ctx, "GL_EXT_texture_env_add")) { + gl_error(ctx, GL_INVALID_ENUM, "glTexEnv(param)"); + return; + } + /* FALL-THROUGH */ + case GL_MODULATE: + case GL_BLEND: + case GL_DECAL: + case GL_REPLACE: /* A small optimization for drivers */ if (texUnit->EnvMode == mode) return; |