From da16813f432c5e328b5b2666d468f185c0678a98 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 2 Mar 2006 12:06:57 +0000 Subject: 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. --- src/mesa/main/enable.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'src/mesa/main/enable.c') diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 5efbf46a75..26cf9ec654 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 -- cgit v1.2.3