check for either GL_NV_vertex_program or GL_ARB_vertex_program for some enables
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 18 Aug 2004 18:45:25 +0000 (18:45 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 18 Aug 2004 18:45:25 +0000 (18:45 +0000)
src/mesa/main/enable.c

index 25bb7938c01747a303be1c39b3022720a06f244b..8d244e02e5b936f123f5fd48ec1f1e11de643636 100644 (file)
@@ -5,9 +5,9 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  5.1
+ * Version:  6.1
  *
- * Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
       return;                                                          \
    }
 
-#define CHECK_EXTENSION2(EXT1, EXT2, CAP)                              \
-   if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) {               \
-      _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(0x%x)",       \
-                  state ? "Enable" : "Disable", CAP);                  \
-      return;                                                          \
-   }
-
 
 static void
 client_state( GLcontext *ctx, GLenum cap, GLboolean state )
@@ -192,6 +185,14 @@ _mesa_DisableClientState( GLenum cap )
       return;                                                          \
    }
 
+#define CHECK_EXTENSION2(EXT1, EXT2, CAP)                              \
+   if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) {               \
+      _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(0x%x)",                  \
+                  state ? "Enable" : "Disable", CAP);                  \
+      return;                                                          \
+   }
+
+
 
 /**
  * Perform glEnable() and glDisable() calls.
@@ -852,21 +853,21 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
 
 #if FEATURE_NV_vertex_program
       case GL_VERTEX_PROGRAM_NV:
-         CHECK_EXTENSION(NV_vertex_program, cap);
+         CHECK_EXTENSION2(NV_vertex_program, ARB_vertex_program, cap);
          if (ctx->VertexProgram.Enabled == state)
             return;
          FLUSH_VERTICES(ctx, _NEW_PROGRAM); 
          ctx->VertexProgram.Enabled = state;
          break;
       case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
-         CHECK_EXTENSION(NV_vertex_program, cap);
+         CHECK_EXTENSION2(NV_vertex_program, ARB_vertex_program, cap);
          if (ctx->VertexProgram.PointSizeEnabled == state)
             return;
          FLUSH_VERTICES(ctx, _NEW_PROGRAM);
          ctx->VertexProgram.PointSizeEnabled = state;
          break;
       case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
-         CHECK_EXTENSION(NV_vertex_program, cap);
+         CHECK_EXTENSION2(NV_vertex_program, ARB_vertex_program, cap);
          if (ctx->VertexProgram.TwoSideEnabled == state)
             return;
          FLUSH_VERTICES(ctx, _NEW_PROGRAM);