From 61bac6014aa15e0bec134e290aebac18f9815299 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 21 Apr 2002 21:04:46 +0000 Subject: check for vertex program mode --- src/mesa/main/api_validate.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src/mesa/main/api_validate.c') diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 3a0ce52b96..c3aba1ad8b 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -1,10 +1,10 @@ -/* $Id: api_validate.c,v 1.5 2001/03/12 00:48:37 gareth Exp $ */ +/* $Id: api_validate.c,v 1.6 2002/04/21 21:04:46 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -61,7 +61,10 @@ _mesa_validate_DrawElements(GLcontext *ctx, if (ctx->NewState) _mesa_update_state( ctx ); - if (!ctx->Array.Vertex.Enabled) + if (ctx->Array.Vertex.Enabled + || (ctx->VertexProgram.Enabled && ctx->Array.VertexAttrib[0].Enabled)) + return GL_TRUE; + else return GL_FALSE; return GL_TRUE; @@ -94,8 +97,7 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, if (type != GL_UNSIGNED_INT && type != GL_UNSIGNED_BYTE && - type != GL_UNSIGNED_SHORT) - { + type != GL_UNSIGNED_SHORT) { _mesa_error(ctx, GL_INVALID_ENUM, "glDrawElements(type)" ); return GL_FALSE; } @@ -103,10 +105,11 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, if (ctx->NewState) _mesa_update_state( ctx ); - if (!ctx->Array.Vertex.Enabled) + if (ctx->Array.Vertex.Enabled + || (ctx->VertexProgram.Enabled && ctx->Array.VertexAttrib[0].Enabled)) + return GL_TRUE; + else return GL_FALSE; - - return GL_TRUE; } @@ -130,8 +133,9 @@ _mesa_validate_DrawArrays(GLcontext *ctx, if (ctx->NewState) _mesa_update_state( ctx ); - if (!ctx->Array.Vertex.Enabled) + if (ctx->Array.Vertex.Enabled + || (ctx->VertexProgram.Enabled && ctx->Array.VertexAttrib[0].Enabled)) + return GL_TRUE; + else return GL_FALSE; - - return GL_TRUE; } -- cgit v1.2.3