-/* $Id: texstate.c,v 1.54 2001/06/18 17:26:08 brianp Exp $ */
+/* $Id: texstate.c,v 1.55 2001/07/23 16:10:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
ASSERT_OUTSIDE_BEGIN_END(ctx);
-#define ERROR(errCode, msg, value) \
+#define TE_ERROR(errCode, msg, value) \
{ \
char s[100]; \
sprintf(s, msg, _mesa_lookup_enum_by_nr(value)); \
switch (mode) {
case GL_ADD:
if (!ctx->Extensions.EXT_texture_env_add) {
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
return;
}
break;
case GL_COMBINE_EXT:
if (!ctx->Extensions.EXT_texture_env_combine &&
!ctx->Extensions.ARB_texture_env_combine) {
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
return;
}
break;
case GL_REPLACE:
break;
default:
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
return;
}
break;
case GL_SUBTRACT_ARB:
if (!ctx->Extensions.ARB_texture_env_combine) {
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
return;
}
break;
case GL_DOT3_RGB_EXT:
case GL_DOT3_RGBA_EXT:
if (!ctx->Extensions.EXT_texture_env_dot3) {
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
return;
}
break;
case GL_DOT3_RGB_ARB:
case GL_DOT3_RGBA_ARB:
if (!ctx->Extensions.ARB_texture_env_dot3) {
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
return;
}
break;
default:
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
return;
}
if (texUnit->CombineModeRGB == mode)
texUnit->CombineModeRGB = mode;
}
else {
- ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
break;
break;
case GL_SUBTRACT_ARB:
if (!ctx->Extensions.ARB_texture_env_combine) {
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
return;
}
break;
default:
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
return;
}
if (texUnit->CombineModeA == mode)
texUnit->CombineModeA = mode;
}
else {
- ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
break;
texUnit->CombineSourceRGB[s] = source;
break;
default:
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source);
return;
}
}
else {
- ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
break;
texUnit->CombineSourceA[s] = source;
break;
default:
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source);
return;
}
}
else {
- ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
break;
texUnit->CombineOperandRGB[s] = operand;
break;
default:
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
return;
}
}
else {
- ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
break;
texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA_EXT] = operand;
break;
default:
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
return;
}
}
else {
- ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
break;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texUnit->CombineOperandRGB[2] = operand;
default:
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
return;
}
}
else {
- ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
break;
texUnit->CombineOperandA[2] = operand;
break;
default:
- ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
return;
}
}
else {
- ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
break;
texUnit->CombineScaleShiftRGB = newshift;
}
else {
- ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
break;
texUnit->CombineScaleShiftA = newshift;
}
else {
- ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
break;
texUnit->LodBias = param[0];
break;
default:
- ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
}