check for invalid vertex/fragment program in glBegin

This commit is contained in:
Brian Paul 2004-02-26 22:09:28 +00:00
parent 04207ab7e2
commit 1ef3d3a758

View file

@ -992,6 +992,15 @@ static void GLAPIENTRY _tnl_Begin( GLenum mode )
{
GET_CURRENT_CONTEXT( ctx );
if ((ctx->VertexProgram.Enabled
&& !ctx->VertexProgram.Current->Instructions) ||
(ctx->FragmentProgram.Enabled
&& !ctx->FragmentProgram.Current->Instructions)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBegin (invalid vertex/fragment program)");
return;
}
if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1) {
TNLcontext *tnl = TNL_CONTEXT(ctx);
int i;