diff options
author | Brian Paul <[email protected]> | 2001-02-20 16:42:25 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2001-02-20 16:42:25 +0000 |
commit | c499ce31baf820e84d133c2189f88e15a1a36672 (patch) | |
tree | 5fa0cc1d10f0e54703c7a0ceb55fcb4aa81c74e3 /src/mesa/main | |
parent | 0c75c4c41754a4f66cdc124b4328e92635b473fe (diff) |
Implemented GL_SGIX_shadow and GL_SGIX_shadow_texture.
Added some const keywords in the s/w texturing code.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/attrib.c | 5 | ||||
-rw-r--r-- | src/mesa/main/extensions.c | 6 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 4 | ||||
-rw-r--r-- | src/mesa/main/state.c | 7 | ||||
-rw-r--r-- | src/mesa/main/texobj.c | 3 | ||||
-rw-r--r-- | src/mesa/main/texstate.c | 32 |
6 files changed, 49 insertions, 8 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 205c14b0241..746ca7332b4 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,4 +1,4 @@ -/* $Id: attrib.c,v 1.43 2001/01/29 22:15:44 brianp Exp $ */ +/* $Id: attrib.c,v 1.44 2001/02/20 16:42:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -101,6 +101,9 @@ copy_texobj_state( struct gl_texture_object *dest, dest->MaxLod = src->MaxLod; dest->BaseLevel = src->BaseLevel; dest->MaxLevel = src->MaxLevel; + dest->CompareFlag = src->CompareFlag; + dest->CompareOperator = src->CompareOperator; + dest->ShadowAmbient = src->ShadowAmbient; dest->_MaxLevel = src->_MaxLevel; dest->_MaxLambda = src->_MaxLambda; dest->Palette = src->Palette; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index c68d751d322..a0b562378ef 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -1,4 +1,4 @@ -/* $Id: extensions.c,v 1.47 2001/02/17 18:41:01 brianp Exp $ */ +/* $Id: extensions.c,v 1.48 2001/02/20 16:42:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -105,6 +105,7 @@ static struct { { ON, "GL_SGIS_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, { OFF, "GL_SGIX_depth_texture", F(SGIX_depth_texture) }, { OFF, "GL_SGIX_shadow", F(SGIX_shadow) }, + { OFF, "GL_SGIX_shadow_ambient", F(SGIX_shadow_ambient) }, { ON, "GL_SGIX_pixel_texture", F(SGIX_pixel_texture) }, { OFF, "GL_3DFX_texture_compression_FXT1", F(_3DFX_texture_compression_FXT1) } }; @@ -127,7 +128,8 @@ _mesa_enable_sw_extensions(GLcontext *ctx) gl_extensions_enable(ctx, "GL_NV_blend_square"); gl_extensions_enable(ctx, "GL_MESA_sprite_point"); gl_extensions_enable(ctx, "GL_SGIX_depth_texture"); - /*gl_extensions_enable(ctx, "GL_SGIX_shadow"); not finished */ + gl_extensions_enable(ctx, "GL_SGIX_shadow"); + gl_extensions_enable(ctx, "GL_SGIX_shadow_ambient"); } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index b890fa0dbd0..93e76e57294 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1,4 +1,4 @@ -/* $Id: mtypes.h,v 1.20 2001/02/17 18:41:01 brianp Exp $ */ +/* $Id: mtypes.h,v 1.21 2001/02/20 16:42:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -834,6 +834,7 @@ struct gl_texture_object { GLint MaxLevel; /* max mipmap level, OpenGL 1.2 */ GLboolean CompareFlag; /* GL_SGIX_shadow */ GLenum CompareOperator; /* GL_SGIX_shadow */ + GLchan ShadowAmbient; /* GL_SGIX_shadow_ambient */ GLint _MaxLevel; /* actual max mipmap level (q in the spec) */ GLfloat _MaxLambda; /* = _MaxLevel - BaseLevel (q - b in spec) */ struct gl_texture_image *Image[MAX_TEXTURE_LEVELS]; @@ -1230,6 +1231,7 @@ struct gl_extensions { GLboolean SGIX_depth_texture; GLboolean SGIX_pixel_texture; GLboolean SGIX_shadow; + GLboolean SGIX_shadow_ambient; GLboolean _3DFX_texture_compression_FXT1; }; diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 533fa687242..badf180ce88 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -1,4 +1,4 @@ -/* $Id: state.c,v 1.58 2001/02/16 00:35:35 keithw Exp $ */ +/* $Id: state.c,v 1.59 2001/02/20 16:42:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -993,6 +993,11 @@ void gl_update_state( GLcontext *ctx ) ASSERT(ctx->Driver.TexSubImage1D); ASSERT(ctx->Driver.TexSubImage2D); ASSERT(ctx->Driver.TexSubImage3D); + ASSERT(ctx->Driver.CopyTexImage1D); + ASSERT(ctx->Driver.CopyTexImage2D); + ASSERT(ctx->Driver.CopyTexSubImage1D); + ASSERT(ctx->Driver.CopyTexSubImage2D); + ASSERT(ctx->Driver.CopyTexSubImage3D); if (ctx->Extensions.ARB_texture_compression) { ASSERT(ctx->Driver.CompressedTexImage1D); ASSERT(ctx->Driver.CompressedTexImage2D); diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 95427855fba..b227a96192c 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1,4 +1,4 @@ -/* $Id: texobj.c,v 1.39 2001/02/17 18:41:01 brianp Exp $ */ +/* $Id: texobj.c,v 1.40 2001/02/20 16:42:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -81,6 +81,7 @@ _mesa_alloc_texture_object( struct gl_shared_state *shared, obj->MaxLevel = 1000; obj->CompareFlag = GL_FALSE; obj->CompareOperator = GL_TEXTURE_LEQUAL_R_SGIX; + obj->ShadowAmbient = 0; _mesa_init_colortable(&obj->Palette); /* insert into linked list */ diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index f55cb5452a0..607f3b77dcf 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,4 +1,4 @@ -/* $Id: texstate.c,v 1.32 2001/02/17 18:41:01 brianp Exp $ */ +/* $Id: texstate.c,v 1.33 2001/02/20 16:42:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -784,7 +784,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) GLenum op = (GLenum) params[0]; if (op == GL_TEXTURE_LEQUAL_R_SGIX || op == GL_TEXTURE_GEQUAL_R_SGIX) { - texObj->CompareFlag = (GLenum) op; + texObj->CompareOperator = op; } else { gl_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)"); @@ -795,6 +795,15 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) return; } break; + case GL_SHADOW_AMBIENT_SGIX: + if (ctx->Extensions.SGIX_shadow_ambient) { + UNCLAMPED_FLOAT_TO_CHAN(texObj->ShadowAmbient, params[0]); + } + else { + gl_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname)"); + return; + } + break; default: gl_error( ctx, GL_INVALID_ENUM, "glTexParameter(pname)" ); return; @@ -1064,6 +1073,15 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) return; } break; + case GL_SHADOW_AMBIENT_SGIX: + if (ctx->Extensions.SGIX_shadow_ambient) { + *params = CHAN_TO_FLOAT(obj->ShadowAmbient); + } + else { + gl_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname)"); + return; + } + break; default: gl_error( ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname)" ); } @@ -1156,6 +1174,16 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) return; } break; + case GL_SHADOW_AMBIENT_SGIX: + if (ctx->Extensions.SGIX_shadow_ambient) { + /* XXX range? */ + *params = CHAN_TO_FLOAT(obj->ShadowAmbient); + } + else { + gl_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname)"); + return; + } + break; default: gl_error( ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname)" ); } |