summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texparam.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-08-12 17:41:57 -0600
committerKeith Whitwell <[email protected]>2008-09-21 22:13:57 -0700
commit1b7e90984511cfa47597c255d73ca416ddd2db6f (patch)
treecdcfeb7cf72ca5f3da1e6310cdc372c8ea1026d4 /src/mesa/main/texparam.c
parent93c90d34d10e06105984796b7b157f2a3e6db5c1 (diff)
mesa: texture crop rect state
(cherry picked from commit c01fbc7866d7cd5cf4263dffec6d9591470b4c23)
Diffstat (limited to 'src/mesa/main/texparam.c')
-rw-r--r--src/mesa/main/texparam.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index dc27124b8e7..664adadfb9c 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -410,6 +410,14 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
}
}
break;
+#ifdef FEATURE_OES_draw_texture
+ case GL_TEXTURE_CROP_RECT_OES:
+ texObj->CropRect[0] = (GLint) params[0];
+ texObj->CropRect[1] = (GLint) params[1];
+ texObj->CropRect[2] = (GLint) params[2];
+ texObj->CropRect[3] = (GLint) params[3];
+ break;
+#endif
default:
_mesa_error(ctx, GL_INVALID_ENUM,
@@ -448,6 +456,12 @@ _mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params )
fparam[2] = INT_TO_FLOAT(params[2]);
fparam[3] = INT_TO_FLOAT(params[3]);
}
+ else if (pname == GL_TEXTURE_CROP_RECT_OES) {
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = (GLfloat) params[1];
+ fparam[2] = (GLfloat) params[2];
+ fparam[3] = (GLfloat) params[3];
+ }
else {
if (pname == GL_TEXTURE_PRIORITY)
fparam[0] = INT_TO_FLOAT(params[0]);
@@ -886,6 +900,14 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
else
error = 1;
break;
+#ifdef FEATURE_OES_draw_texture
+ case GL_TEXTURE_CROP_RECT_OES:
+ params[0] = obj->CropRect[0];
+ params[0] = obj->CropRect[1];
+ params[0] = obj->CropRect[2];
+ params[0] = obj->CropRect[3];
+ break;
+#endif
default:
error = 1;
break;
@@ -1028,6 +1050,14 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
return;
}
break;
+#ifdef FEATURE_OES_draw_texture
+ case GL_TEXTURE_CROP_RECT_OES:
+ params[0] = obj->CropRect[0];
+ params[0] = obj->CropRect[1];
+ params[0] = obj->CropRect[2];
+ params[0] = obj->CropRect[3];
+ break;
+#endif
default:
; /* silence warnings */
}