From 4db23069f9aca4e2fa51f82009f5fa8f3cd2860d Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 14 Sep 2009 15:39:09 +0800 Subject: es: Check OES_draw_texture is enabled. --- src/mesa/es/main/drawtex.c | 9 +++++++-- 1 file 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); } -- cgit v1.2.3