summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/glheader.h4
-rw-r--r--src/mesa/main/mtypes.h2
-rw-r--r--src/mesa/main/points.c4
-rw-r--r--src/mesa/main/texparam.c30
4 files changed, 39 insertions, 1 deletions
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index 3131a356b86..f0f97c218c2 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -176,6 +176,10 @@
#endif
+#ifndef GL_OES_draw_texture
+#define GL_TEXTURE_CROP_RECT_OES 0x8B9D
+#endif
+
#if !defined(CAPI) && defined(WIN32) && !defined(BUILD_FOR_SNAP)
#define CAPI _cdecl
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index a95f02b889b..71a4ca55bc4 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1434,6 +1434,7 @@ struct gl_texture_object
GLenum DepthMode; /**< GL_ARB_depth_texture */
GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */
GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */
+ GLint CropRect[4]; /**< GL_OES_draw_texture */
GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */
GLboolean _Complete; /**< Is texture object complete? */
@@ -1443,7 +1444,6 @@ struct gl_texture_object
/** GL_EXT_paletted_texture */
struct gl_color_table Palette;
-
/**
* \name For device driver.
* Note: instead of attaching driver data to this pointer, it's preferable
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index fbedbcb22c4..d16344a42c3 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -244,7 +244,11 @@ _mesa_init_point(GLcontext *ctx)
ctx->Point.MaxSize
= MAX2(ctx->Const.MaxPointSize, ctx->Const.MaxPointSizeAA);
ctx->Point.Threshold = 1.0;
+#if FEATURE_es2_glsl
+ ctx->Point.PointSprite = GL_TRUE; /* GL_ARB/NV_point_sprite */
+#else
ctx->Point.PointSprite = GL_FALSE; /* GL_ARB/NV_point_sprite */
+#endif
ctx->Point.SpriteRMode = GL_ZERO; /* GL_NV_point_sprite (only!) */
ctx->Point.SpriteOrigin = GL_UPPER_LEFT; /* GL_ARB_point_sprite */
for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index af288c4e18c..3f3b448dbc6 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -409,6 +409,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,
@@ -447,6 +455,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]);
@@ -885,6 +899,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;
@@ -1027,6 +1049,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 */
}