summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2003-07-03 15:08:25 +0000
committerBrian Paul <[email protected]>2003-07-03 15:08:25 +0000
commit92d31641d2116110da84a1b1fc1d882b7aa1b095 (patch)
tree4857ad4a3289d8529da0311b2b0947016abc9da2 /src/mesa
parentb464dee72be7a2d00755a60ef5bcfde1262934d3 (diff)
fix int/float conversion for GL_TEXTURE_PRIORITY in gl[Get]TexParameteri[v]
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/texstate.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index d96b73a2f5b..f27c346ec2f 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -1413,7 +1413,10 @@ void
_mesa_TexParameteri( GLenum target, GLenum pname, GLint param )
{
GLfloat fparam[4];
- fparam[0] = (GLfloat) param;
+ if (pname == GL_TEXTURE_PRIORITY)
+ fparam[0] = INT_TO_FLOAT(param);
+ else
+ fparam[0] = (GLfloat) param;
fparam[1] = fparam[2] = fparam[3] = 0.0;
_mesa_TexParameterfv(target, pname, fparam);
}
@@ -1430,7 +1433,10 @@ _mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params )
fparam[3] = INT_TO_FLOAT(params[3]);
}
else {
- fparam[0] = (GLfloat) params[0];
+ if (pname == GL_TEXTURE_PRIORITY)
+ fparam[0] = INT_TO_FLOAT(params[0]);
+ else
+ fparam[0] = (GLfloat) params[0];
fparam[1] = fparam[2] = fparam[3] = 0.0F;
}
_mesa_TexParameterfv(target, pname, fparam);
@@ -1827,7 +1833,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
}
return;
case GL_TEXTURE_PRIORITY:
- *params = (GLint) obj->Priority;
+ *params = FLOAT_TO_INT(obj->Priority);
return;
case GL_TEXTURE_MIN_LOD:
*params = (GLint) obj->MinLod;