From 93da673904d4c520d3fbd2210e53777bf1598ac6 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Wed, 1 Mar 2006 23:11:14 +0000 Subject: Fix glGet with enums which are used not only in NV_vertex_program, but other extensions too (ARB_vertex_program, ARB_fragment_program, NV_fragment_program), if no support for NV_vertex_program is present. While here, fix return value if enum is used which is not supported by the exposed extensions (GL_INVALID_ENUM instead of GL_INVALID_VALUE). Fix some compile-time #ifs depending on NV_vertex/fragment_program which should also be dependant on ARB_vertex/fragment_program. See bug #6070 --- src/mesa/main/enable.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mesa/main/enable.c') diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 931aa2cc26..5efbf46a75 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -821,7 +821,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) ctx->Point.PointSprite = state; break; -#if FEATURE_NV_vertex_program +#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program case GL_VERTEX_PROGRAM_NV: CHECK_EXTENSION2(NV_vertex_program, ARB_vertex_program, cap); if (ctx->VertexProgram.Enabled == state) @@ -843,6 +843,8 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) FLUSH_VERTICES(ctx, _NEW_PROGRAM); ctx->VertexProgram.TwoSideEnabled = state; break; +#endif +#if FEATURE_NV_vertex_program case GL_MAP1_VERTEX_ATTRIB0_4_NV: case GL_MAP1_VERTEX_ATTRIB1_4_NV: case GL_MAP1_VERTEX_ATTRIB2_4_NV: @@ -1286,7 +1288,7 @@ _mesa_IsEnabled( GLenum cap ) case GL_POINT_SPRITE_NV: return ctx->Point.PointSprite; -#if FEATURE_NV_vertex_program +#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program case GL_VERTEX_PROGRAM_NV: CHECK_EXTENSION(NV_vertex_program); return ctx->VertexProgram.Enabled; @@ -1296,6 +1298,8 @@ _mesa_IsEnabled( GLenum cap ) case GL_VERTEX_PROGRAM_TWO_SIDE_NV: CHECK_EXTENSION(NV_vertex_program); return ctx->VertexProgram.TwoSideEnabled; +#endif +#if FEATURE_NV_vertex_program case GL_VERTEX_ATTRIB_ARRAY0_NV: case GL_VERTEX_ATTRIB_ARRAY1_NV: case GL_VERTEX_ATTRIB_ARRAY2_NV: -- cgit v1.2.3