From 781fb93877ea3a6faeefcdb48d9b463da7d954a3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 28 Aug 2003 03:04:41 +0000 Subject: Added OpenGL 1.4's per-texture LOD bias. --- src/mesa/main/texstate.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/mesa/main/texstate.c') diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 8110772d3c8..2c1d155f52e 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1399,6 +1399,14 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) return; } break; + case GL_TEXTURE_LOD_BIAS: + /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias*/ + if (ctx->Extensions.EXT_texture_lod_bias) { + texObj->LodBias = CLAMP(params[0], + -ctx->Const.MaxTextureLodBias, + ctx->Const.MaxTextureLodBias); + } + break; default: _mesa_error(ctx, GL_INVALID_ENUM, @@ -1775,6 +1783,12 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) return; } break; + case GL_TEXTURE_LOD_BIAS: + if (ctx->Extensions.EXT_texture_lod_bias) { + *params = obj->LodBias; + break; + } + break; default: ; /* silence warnings */ } @@ -1801,6 +1815,12 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) switch (pname) { case GL_TEXTURE_MAG_FILTER: *params = (GLint) obj->MagFilter; + case GL_TEXTURE_LOD_BIAS: + if (ctx->Extensions.EXT_texture_lod_bias) { + *params = (GLint) obj->LodBias; + break; + } + break; return; case GL_TEXTURE_MIN_FILTER: *params = (GLint) obj->MinFilter; -- cgit v1.2.3