From: Brian Paul Date: Mon, 13 Sep 2004 19:58:27 +0000 (+0000) Subject: Handle GL_MAX_VERTEX_ATTRIBS_ARB in glGet*(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c3912b66abb23ce2db00723a4cb79ac84ae4a086;p=mesa.git Handle GL_MAX_VERTEX_ATTRIBS_ARB in glGet*(). Define 2.0 point-sprite related tokens in glheader.h (temporary). --- diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index dabb622ce08..1f490540d89 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -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; diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index aaff7176f9f..98ab70eb4d0 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -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); diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index c548ed70800..025b3a5857d 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -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 -/* 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 diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index 5f5e01039c6..2ffb1a42125 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -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 */ } diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h index 1cfdf002afd..de940b355c9 100644 --- a/src/mesa/swrast/s_pointtemp.h +++ b/src/mesa/swrast/s_pointtemp.h @@ -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;