Handle GL_MAX_VERTEX_ATTRIBS_ARB in glGet*().
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 13 Sep 2004 19:58:27 +0000 (19:58 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 13 Sep 2004 19:58:27 +0000 (19:58 +0000)
Define 2.0 point-sprite related tokens in glheader.h (temporary).

src/mesa/main/attrib.c
src/mesa/main/get.c
src/mesa/main/glheader.h
src/mesa/main/points.c
src/mesa/swrast/s_pointtemp.h

index dabb622ce08f3143cb1471f1c68a41565baab1c0..1f490540d899ad50ac2c413b0723832af239b23b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.1
+ * Version:  6.2
  *
  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
  *
@@ -1017,10 +1017,8 @@ _mesa_PopAttrib(void)
                   _mesa_set_enable(ctx, GL_POINT_SPRITE_NV,point->PointSprite);
                   _mesa_PointParameteriNV(GL_POINT_SPRITE_R_MODE_NV,
                                           ctx->Point.SpriteRMode);
-#if GL_VERSION_2_0
                   _mesa_PointParameterfEXT(GL_POINT_SPRITE_COORD_ORIGIN,
                                            (GLfloat)ctx->Point.SpriteOrigin);
-#endif
                }
             }
             break;
index aaff7176f9f042fef5bf093260337ef182c47858..98ab70eb4d081fa0a490d8f2aa5c727d726bb041 100644 (file)
@@ -1390,12 +1390,10 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
          CHECK_EXTENSION_B(NV_point_sprite, pname);
          *params = ENUM_TO_BOOL(ctx->Point.SpriteRMode);
          break;
-#if GL_VERSION_2_0
       case GL_POINT_SPRITE_COORD_ORIGIN:
          CHECK_EXTENSION_B(ARB_point_sprite, pname);
          *params = ENUM_TO_BOOL(ctx->Point.SpriteOrigin);
          break;
-#endif
 
       /* GL_SGIS_generate_mipmap */
       case GL_GENERATE_MIPMAP_HINT_SGIS:
@@ -1626,6 +1624,14 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
          break;
 #endif
 
+#if FEATURE_ARB_vertex_program
+      /* GL_NV_vertex_program and GL_ARB_fragment_program define others */
+      case GL_MAX_VERTEX_ATTRIBS_ARB:
+         CHECK_EXTENSION_B(ARB_vertex_program, pname);
+         *params = (ctx->Const.MaxVertexProgramAttribs > 0) ? GL_TRUE : GL_FALSE;
+         break;
+#endif
+
 #if FEATURE_ARB_fragment_program
       case GL_FRAGMENT_PROGRAM_ARB:
          CHECK_EXTENSION_B(ARB_fragment_program, pname);
@@ -2948,12 +2954,10 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
          CHECK_EXTENSION_D(NV_point_sprite, pname);
          *params = (GLdouble) ctx->Point.SpriteRMode;
          break;
-#if GL_VERSION_2_0
       case GL_POINT_SPRITE_COORD_ORIGIN:
          CHECK_EXTENSION_D(ARB_point_sprite, pname);
          *params = (GLdouble) ctx->Point.SpriteOrigin;
          break;
-#endif
 
       /* GL_SGIS_generate_mipmap */
       case GL_GENERATE_MIPMAP_HINT_SGIS:
@@ -3182,6 +3186,14 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
          break;
 #endif
 
+#if FEATURE_ARB_vertex_program
+      /* GL_NV_vertex_program and GL_ARB_fragment_program define others */
+      case GL_MAX_VERTEX_ATTRIBS_ARB:
+         CHECK_EXTENSION_D(ARB_vertex_program, pname);
+         *params = (GLdouble) ctx->Const.MaxVertexProgramAttribs;
+         break;
+#endif
+
 #if FEATURE_ARB_fragment_program
       case GL_FRAGMENT_PROGRAM_ARB:
          CHECK_EXTENSION_D(ARB_fragment_program, pname);
@@ -4480,12 +4492,10 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
          CHECK_EXTENSION_F(NV_point_sprite, pname);
          *params = (GLfloat) ctx->Point.SpriteRMode;
          break;
-#if GL_VERSION_2_0
       case GL_POINT_SPRITE_COORD_ORIGIN:
          CHECK_EXTENSION_F(ARB_point_sprite, pname);
          *params = (GLfloat) ctx->Point.SpriteOrigin;
          break;
-#endif
 
       /* GL_SGIS_generate_mipmap */
       case GL_GENERATE_MIPMAP_HINT_SGIS:
@@ -4714,6 +4724,14 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
          break;
 #endif
 
+#if FEATURE_ARB_vertex_program
+      /* GL_NV_vertex_program and GL_ARB_fragment_program define others */
+      case GL_MAX_VERTEX_ATTRIBS_ARB:
+         CHECK_EXTENSION_F(ARB_vertex_program, pname);
+         *params = (GLfloat) ctx->Const.MaxVertexProgramAttribs;
+         break;
+#endif
+
 #if FEATURE_ARB_fragment_program
       case GL_FRAGMENT_PROGRAM_ARB:
          CHECK_EXTENSION_F(ARB_fragment_program, pname);
@@ -6050,12 +6068,10 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
          CHECK_EXTENSION_I(NV_point_sprite, pname);
          *params = (GLint) ctx->Point.SpriteRMode;
          break;
-#if GL_VERSION_2_0
       case GL_POINT_SPRITE_COORD_ORIGIN:
          CHECK_EXTENSION_I(ARB_point_sprite, pname);
          *params = (GLint) ctx->Point.SpriteOrigin;
          break;
-#endif
 
       /* GL_SGIS_generate_mipmap */
       case GL_GENERATE_MIPMAP_HINT_SGIS:
@@ -6284,6 +6300,14 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
          break;
 #endif
 
+#if FEATURE_ARB_vertex_program
+      /* GL_NV_vertex_program and GL_ARB_fragment_program define others */
+      case GL_MAX_VERTEX_ATTRIBS_ARB:
+         CHECK_EXTENSION_I(ARB_vertex_program, pname);
+         *params = (GLint) ctx->Const.MaxVertexProgramAttribs;
+         break;
+#endif
+
 #if FEATURE_ARB_fragment_program
       case GL_FRAGMENT_PROGRAM_ARB:
          CHECK_EXTENSION_I(ARB_fragment_program, pname);
index c548ed70800d4cb2967c144bb63d320be62791e9..025b3a5857d8bff28d01c29d7b56ae3f771b1292 100644 (file)
@@ -20,7 +20,7 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  6.1
+ * Version:  6.2
  *
  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
  *
@@ -213,24 +213,14 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC
 #include <GL/internal/glcore.h>
 
 
-/* XXX temporary hack */
-#ifndef GL_PIXEL_PACK_BUFFER_EXT
-#define GL_PIXEL_PACK_BUFFER_EXT                        0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_EXT                      0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_EXT                0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT              0x88EF
-#endif
-
-
-/* XXX temporary hack */
+/* XXX temporary hack - remove when glext.h is updated */
 #ifndef GL_ARB_half_float_pixel
 #define GL_ARB_half_float_pixel 1
 #define GL_HALF_FLOAT_ARB 0x140B
 typedef GLushort GLhalfARB;
 #endif
 
-
-/* XXX temporary hack */
+/* XXX temporary hack - remove when glext.h is updated */
 #ifndef GL_ARB_texture_float
 #define GL_ARB_texture_float 1
 #define GL_TEXTURE_RED_TYPE_ARB             0x9000
@@ -255,6 +245,12 @@ typedef GLushort GLhalfARB;
 #define GL_LUMINANCE_ALPHA16F_ARB           0x881F
 #endif
 
+/* XXX temporary hack - remove when glext.h is updated */
+#ifndef GL_POINT_SPRITE_COORD_ORIGIN
+#define GL_POINT_SPRITE_COORD_ORIGIN        0x10000
+#define GL_LOWER_LEFT                       0x10001
+#define GL_UPPER_LEFT                       0x10002
+#endif
 
 
 
index 5f5e01039c6922d25c7a866032e6e346cb8be3c1..2ffb1a421253f133192c8d72854739cc2839e90c 100644 (file)
@@ -5,9 +5,9 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  5.1
+ * Version:  6.2
  *
- * 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"),
@@ -229,7 +229,6 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
             return;
          }
          break;
-#if GL_VERSION_2_0
       case GL_POINT_SPRITE_COORD_ORIGIN:
          if (ctx->Extensions.ARB_point_sprite) {
             GLenum value = (GLenum) params[0];
@@ -249,7 +248,6 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
             return;
          }
          break;
-#endif
       default:
          _mesa_error( ctx, GL_INVALID_ENUM,
                       "glPointParameterf[v]{EXT,ARB}(pname)" );
@@ -287,9 +285,7 @@ void _mesa_init_point( GLcontext * ctx )
    ctx->Point.Threshold = 1.0;
    ctx->Point.PointSprite = GL_FALSE; /* GL_ARB_point_sprite / GL_NV_point_sprite */
    ctx->Point.SpriteRMode = GL_ZERO; /* GL_NV_point_sprite (only!) */
-#if GL_VERSION_2_0
    ctx->Point.SpriteOrigin = GL_UPPER_LEFT; /* GL_ARB_point_sprite */
-#endif
    for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
       ctx->Point.CoordReplace[i] = GL_FALSE; /* GL_ARB_point_sprite / GL_NV_point_sprite */
    }
index 1cfdf002afd79016d5bfe23b7f440f6891de5e06..de940b355c9f6d91429b9cae4d9a35ed56c81b2c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.1
+ * Version:  6.2
  *
  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
  *
@@ -293,11 +293,9 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
                   if (ctx->Point.CoordReplace[u]) {
                      GLfloat s = 0.5F + (x + 0.5F - vert->win[0]) / size;
                      GLfloat t;
-#if GL_VERSION_2_0
                      if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT)
                         t = 0.5F + (y + 0.5F - vert->win[1]) / size;
                      else /* GL_UPPER_LEFT */
-#endif
                         t = 0.5F - (y + 0.5F - vert->win[1]) / size;
                      span->array->texcoords[u][count][0] = s;
                      span->array->texcoords[u][count][1] = t;