summaryrefslogtreecommitdiff
path: root/src/mesa/es
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2009-09-14 15:39:09 +0800
committerChia-I Wu <olvaffe@gmail.com>2009-09-14 15:58:42 +0800
commit4db23069f9aca4e2fa51f82009f5fa8f3cd2860d (patch)
tree2b8e9b386859b100069127b7a048652ac6b57ab7 /src/mesa/es
parent77e2b23ea62840b90b4fb8dddf40461d91aa4a04 (diff)
es: Check OES_draw_texture is enabled.
Diffstat (limited to 'src/mesa/es')
-rw-r--r--src/mesa/es/main/drawtex.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/es/main/drawtex.c b/src/mesa/es/main/drawtex.c
index af055d07d2..1462807f9d 100644
--- a/src/mesa/es/main/drawtex.c
+++ b/src/mesa/es/main/drawtex.c
@@ -35,6 +35,11 @@ static INLINE void
draw_texture(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
GLfloat width, GLfloat height)
{
+ if (!ctx->Extensions.OES_draw_texture) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawTex(unsupported)");
+ return;
+ }
if (width <= 0.0f || height <= 0.0f) {
_mesa_error(ctx, GL_INVALID_VALUE, "glDrawTex(width or height <= 0)");
return;
@@ -43,8 +48,8 @@ draw_texture(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
if (ctx->NewState)
_mesa_update_state(ctx);
- if (ctx->Driver.DrawTex)
- ctx->Driver.DrawTex(ctx, x, y, z, width, height);
+ ASSERT(ctx->Driver.DrawTex);
+ ctx->Driver.DrawTex(ctx, x, y, z, width, height);
}