summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/enable.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2006-03-02 12:06:57 +0000
committerRoland Scheidegger <[email protected]>2006-03-02 12:06:57 +0000
commitda16813f432c5e328b5b2666d468f185c0678a98 (patch)
tree77e0644f4fba164bcf15236fa42b22e6e4a4e2dc /src/mesa/main/enable.c
parent9227bca1032118eb94ff3ad14268335df0cece11 (diff)
Fix more enums defined not only by one extension when queried by glGet (GL_COLOR_SUM_EXT, GL_POINT_SPRITE_NV, GL_POINT_SPRITE_COORD_ORIGIN, GL_TRANSPOSE_CURRENT_MATRIX_ARB). Fix similar bugs (also those previously overseen dependant on NV/ARB_vertex_program) in glIsEnabled. Add missing GL_COLOR_SUM_EXT enum to glIsEnabled.
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r--src/mesa/main/enable.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 5efbf46a755..26cf9ec654f 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -759,7 +759,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
/* 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);
@@ -1037,6 +1037,12 @@ _mesa_Disable( GLenum cap )
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.
@@ -1262,6 +1268,11 @@ _mesa_IsEnabled( GLenum cap )
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);
@@ -1286,17 +1297,18 @@ _mesa_IsEnabled( GLenum cap )
/* 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