/* GL_EXT_secondary_color */
case GL_COLOR_SUM_EXT:
- CHECK_EXTENSION(EXT_secondary_color, cap);
+ CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program, cap);
if (ctx->Fog.ColorSumEnabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_FOG);
return GL_FALSE; \
}
+#undef CHECK_EXTENSION2
+#define CHECK_EXTENSION2(EXT1, EXT2) \
+ if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled"); \
+ return GL_FALSE; \
+ }
/**
* Test whether a capability is enabled.
return (texUnit->Enabled & TEXTURE_CUBE_BIT) ? GL_TRUE : GL_FALSE;
}
+ /* GL_EXT_secondary_color */
+ case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program);
+ return ctx->Fog.ColorSumEnabled;
+
/* GL_ARB_multisample */
case GL_MULTISAMPLE_ARB:
CHECK_EXTENSION(ARB_multisample);
/* GL_NV_point_sprite */
case GL_POINT_SPRITE_NV:
+ CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite)
return ctx->Point.PointSprite;
#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
- case GL_VERTEX_PROGRAM_NV:
- CHECK_EXTENSION(NV_vertex_program);
+ case GL_VERTEX_PROGRAM_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
return ctx->VertexProgram.Enabled;
- case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
- CHECK_EXTENSION(NV_vertex_program);
+ case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
return ctx->VertexProgram.PointSizeEnabled;
- case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
- CHECK_EXTENSION(NV_vertex_program);
+ case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
return ctx->VertexProgram.TwoSideEnabled;
#endif
#if FEATURE_NV_vertex_program
params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled;
break;
case GL_COLOR_SUM_EXT:
- CHECK_EXT1(EXT_secondary_color, "GetBooleanv");
+ CHECK_EXT2(EXT_secondary_color, ARB_vertex_program, "GetBooleanv");
params[0] = ctx->Fog.ColorSumEnabled;
break;
case GL_CURRENT_SECONDARY_COLOR_EXT:
params[0] = ctx->Transform.RasterPositionUnclipped;
break;
case GL_POINT_SPRITE_NV:
- CHECK_EXT1(NV_point_sprite, "GetBooleanv");
+ CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetBooleanv");
params[0] = ctx->Point.PointSprite;
break;
case GL_POINT_SPRITE_R_MODE_NV:
params[0] = ENUM_TO_BOOLEAN(ctx->Point.SpriteRMode);
break;
case GL_POINT_SPRITE_COORD_ORIGIN:
- CHECK_EXT1(NV_point_sprite, "GetBooleanv");
+ CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetBooleanv");
params[0] = ENUM_TO_BOOLEAN(ctx->Point.SpriteOrigin);
break;
case GL_GENERATE_MIPMAP_HINT_SGIS:
CHECK_EXT1(ARB_vertex_program, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Const.VertexProgram.MaxAttribs);
break;
- case GL_FRAGMENT_PROGRAM_ARB:
- CHECK_EXT1(ARB_fragment_program, "GetBooleanv");
- params[0] = ctx->FragmentProgram.Enabled;
- break;
case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
- CHECK_EXT1(ARB_fragment_program, "GetBooleanv");
+ CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetBooleanv");
{
const GLfloat *matrix = ctx->CurrentStack->Top->m;
params[0] = FLOAT_TO_BOOLEAN(matrix[0]);
params[15] = FLOAT_TO_BOOLEAN(matrix[15]);
}
break;
+ case GL_FRAGMENT_PROGRAM_ARB:
+ CHECK_EXT1(ARB_fragment_program, "GetBooleanv");
+ params[0] = ctx->FragmentProgram.Enabled;
+ break;
case GL_DEPTH_BOUNDS_TEST_EXT:
CHECK_EXT1(EXT_depth_bounds_test, "GetBooleanv");
params[0] = ctx->Depth.BoundsTest;
params[0] = BOOLEAN_TO_FLOAT(ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled);
break;
case GL_COLOR_SUM_EXT:
- CHECK_EXT1(EXT_secondary_color, "GetFloatv");
+ CHECK_EXT2(EXT_secondary_color, ARB_vertex_program, "GetFloatv");
params[0] = BOOLEAN_TO_FLOAT(ctx->Fog.ColorSumEnabled);
break;
case GL_CURRENT_SECONDARY_COLOR_EXT:
params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.RasterPositionUnclipped);
break;
case GL_POINT_SPRITE_NV:
- CHECK_EXT1(NV_point_sprite, "GetFloatv");
+ CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetFloatv");
params[0] = BOOLEAN_TO_FLOAT(ctx->Point.PointSprite);
break;
case GL_POINT_SPRITE_R_MODE_NV:
params[0] = ENUM_TO_FLOAT(ctx->Point.SpriteRMode);
break;
case GL_POINT_SPRITE_COORD_ORIGIN:
- CHECK_EXT1(NV_point_sprite, "GetFloatv");
+ CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetFloatv");
params[0] = ENUM_TO_FLOAT(ctx->Point.SpriteOrigin);
break;
case GL_GENERATE_MIPMAP_HINT_SGIS:
CHECK_EXT1(ARB_vertex_program, "GetFloatv");
params[0] = (GLfloat)(ctx->Const.VertexProgram.MaxAttribs);
break;
- case GL_FRAGMENT_PROGRAM_ARB:
- CHECK_EXT1(ARB_fragment_program, "GetFloatv");
- params[0] = BOOLEAN_TO_FLOAT(ctx->FragmentProgram.Enabled);
- break;
case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
- CHECK_EXT1(ARB_fragment_program, "GetFloatv");
+ CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetFloatv");
{
const GLfloat *matrix = ctx->CurrentStack->Top->m;
params[0] = matrix[0];
params[15] = matrix[15];
}
break;
+ case GL_FRAGMENT_PROGRAM_ARB:
+ CHECK_EXT1(ARB_fragment_program, "GetFloatv");
+ params[0] = BOOLEAN_TO_FLOAT(ctx->FragmentProgram.Enabled);
+ break;
case GL_DEPTH_BOUNDS_TEST_EXT:
CHECK_EXT1(EXT_depth_bounds_test, "GetFloatv");
params[0] = BOOLEAN_TO_FLOAT(ctx->Depth.BoundsTest);
params[0] = BOOLEAN_TO_INT(ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled);
break;
case GL_COLOR_SUM_EXT:
- CHECK_EXT1(EXT_secondary_color, "GetIntegerv");
+ CHECK_EXT2(EXT_secondary_color, ARB_vertex_program, "GetIntegerv");
params[0] = BOOLEAN_TO_INT(ctx->Fog.ColorSumEnabled);
break;
case GL_CURRENT_SECONDARY_COLOR_EXT:
params[0] = BOOLEAN_TO_INT(ctx->Transform.RasterPositionUnclipped);
break;
case GL_POINT_SPRITE_NV:
- CHECK_EXT1(NV_point_sprite, "GetIntegerv");
+ CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetIntegerv");
params[0] = BOOLEAN_TO_INT(ctx->Point.PointSprite);
break;
case GL_POINT_SPRITE_R_MODE_NV:
params[0] = ENUM_TO_INT(ctx->Point.SpriteRMode);
break;
case GL_POINT_SPRITE_COORD_ORIGIN:
- CHECK_EXT1(NV_point_sprite, "GetIntegerv");
+ CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetIntegerv");
params[0] = ENUM_TO_INT(ctx->Point.SpriteOrigin);
break;
case GL_GENERATE_MIPMAP_HINT_SGIS:
CHECK_EXT1(ARB_vertex_program, "GetIntegerv");
params[0] = ctx->Const.VertexProgram.MaxAttribs;
break;
- case GL_FRAGMENT_PROGRAM_ARB:
- CHECK_EXT1(ARB_fragment_program, "GetIntegerv");
- params[0] = BOOLEAN_TO_INT(ctx->FragmentProgram.Enabled);
- break;
case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
- CHECK_EXT1(ARB_fragment_program, "GetIntegerv");
+ CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetIntegerv");
{
const GLfloat *matrix = ctx->CurrentStack->Top->m;
params[0] = IROUND(matrix[0]);
params[15] = IROUND(matrix[15]);
}
break;
+ case GL_FRAGMENT_PROGRAM_ARB:
+ CHECK_EXT1(ARB_fragment_program, "GetIntegerv");
+ params[0] = BOOLEAN_TO_INT(ctx->FragmentProgram.Enabled);
+ break;
case GL_DEPTH_BOUNDS_TEST_EXT:
CHECK_EXT1(EXT_depth_bounds_test, "GetIntegerv");
params[0] = BOOLEAN_TO_INT(ctx->Depth.BoundsTest);
# - the state datatype, one of GLint, GLfloat, GLboolean or GLenum
# - list of code fragments to get the state, such as ["ctx->Foo.Bar"]
# - optional extra code or empty string
-# - optional extension to check, or None (XXX this should be a list!)
+# - optional extensions to check, or None
#
StateVars = [
( "GL_ACCUM_RED_BITS", GLint, ["ctx->DrawBuffer->Visual.accumRedBits"],
# GL_EXT_secondary_color
( "GL_COLOR_SUM_EXT", GLboolean,
- ["ctx->Fog.ColorSumEnabled"], "", ["EXT_secondary_color"] ),
+ ["ctx->Fog.ColorSumEnabled"], "",
+ ["EXT_secondary_color", "ARB_vertex_program"] ),
( "GL_CURRENT_SECONDARY_COLOR_EXT", GLfloatN,
["ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]",
"ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]",
["ctx->Transform.RasterPositionUnclipped"], "", ["IBM_rasterpos_clip"] ),
# GL_NV_point_sprite
- ( "GL_POINT_SPRITE_NV", GLboolean, ["ctx->Point.PointSprite"],
- "", ["NV_point_sprite"] ), # OR ARB_point_sprite
+ ( "GL_POINT_SPRITE_NV", GLboolean, ["ctx->Point.PointSprite"], # == GL_POINT_SPRITE_ARB
+ "", ["NV_point_sprite", "ARB_point_sprite"] ),
( "GL_POINT_SPRITE_R_MODE_NV", GLenum, ["ctx->Point.SpriteRMode"],
- "", ["NV_point_sprite"] ), # OR ARB_point_sprite
+ "", ["NV_point_sprite"] ),
( "GL_POINT_SPRITE_COORD_ORIGIN", GLenum, ["ctx->Point.SpriteOrigin"],
- "", ["NV_point_sprite"] ), # OR ARB_point_sprite
+ "", ["NV_point_sprite", "ARB_point_sprite"] ),
# GL_SGIS_generate_mipmap
( "GL_GENERATE_MIPMAP_HINT_SGIS", GLenum, ["ctx->Hint.GenerateMipmap"],
# GL_ARB_vertex_program
( "GL_MAX_VERTEX_ATTRIBS_ARB", GLint,
["ctx->Const.VertexProgram.MaxAttribs"], "", ["ARB_vertex_program"] ),
-
- # GL_ARB_fragment_program
- ( "GL_FRAGMENT_PROGRAM_ARB", GLboolean,
- ["ctx->FragmentProgram.Enabled"], "", ["ARB_fragment_program"] ),
( "GL_TRANSPOSE_CURRENT_MATRIX_ARB", GLfloat,
["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]",
"matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]",
"matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]",
"matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"],
"const GLfloat *matrix = ctx->CurrentStack->Top->m;",
- ["ARB_fragment_program"] ),
+ ["ARB_vertex_program", "ARB_fragment_program"] ),
+
+ # GL_ARB_fragment_program
+ ( "GL_FRAGMENT_PROGRAM_ARB", GLboolean,
+ ["ctx->FragmentProgram.Enabled"], "", ["ARB_fragment_program"] ),
# GL_EXT_depth_bounds_test
( "GL_DEPTH_BOUNDS_TEST_EXT", GLboolean,