summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>1999-11-12 02:07:56 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>1999-11-12 02:07:56 +0000
commitb95d252c347e14825cd61b28223040cfc5d0e7de (patch)
tree9ecc5d01e2c812079aefdb4311c36e9a2cdb6dc7 /src
parenta087e348ab534a8293c0dc1eb7fda8794326259d (diff)
added GL_EXT_texture_env_add extension
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/extensions.c3
-rw-r--r--src/mesa/main/texstate.c17
2 files changed, 14 insertions, 6 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index c8b154d061..98a7551191 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 7e5ce3085a..fa893e7f2d 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;