replaced experimental MESA_sprite_point with NV_point_sprite
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: attrib.c,v 1.63 2002/04/01 17:03:38 brianp Exp $ */
|
/* $Id: attrib.c,v 1.64 2002/05/27 17:04:52 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -527,6 +527,10 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
|
|||||||
GL_POINT_SMOOTH);
|
GL_POINT_SMOOTH);
|
||||||
TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth,
|
TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth,
|
||||||
GL_POINT_SMOOTH);
|
GL_POINT_SMOOTH);
|
||||||
|
if (ctx->Extensions.NV_point_sprite) {
|
||||||
|
TEST_AND_UPDATE(ctx->Point.PointSprite, enable->PointSprite,
|
||||||
|
GL_POINT_SPRITE_NV);
|
||||||
|
}
|
||||||
TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint,
|
TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint,
|
||||||
GL_POLYGON_OFFSET_POINT);
|
GL_POLYGON_OFFSET_POINT);
|
||||||
TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine,
|
TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine,
|
||||||
@@ -991,6 +995,16 @@ _mesa_PopAttrib(void)
|
|||||||
_mesa_PointParameterfEXT(GL_POINT_SIZE_MAX_EXT, point->MaxSize);
|
_mesa_PointParameterfEXT(GL_POINT_SIZE_MAX_EXT, point->MaxSize);
|
||||||
_mesa_PointParameterfEXT(GL_POINT_FADE_THRESHOLD_SIZE_EXT,
|
_mesa_PointParameterfEXT(GL_POINT_FADE_THRESHOLD_SIZE_EXT,
|
||||||
point->Threshold);
|
point->Threshold);
|
||||||
|
if (ctx->Extensions.NV_point_sprite) {
|
||||||
|
GLuint u;
|
||||||
|
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
|
||||||
|
_mesa_TexEnvi(GL_POINT_SPRITE_NV, GL_COORD_REPLACE_NV,
|
||||||
|
(GLint) point->CoordReplace[u]);
|
||||||
|
}
|
||||||
|
_mesa_set_enable(ctx, GL_POINT_SPRITE_NV,point->PointSprite);
|
||||||
|
_mesa_PointParameteriNV(GL_POINT_SPRITE_R_MODE_NV,
|
||||||
|
ctx->Point.SpriteRMode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GL_POLYGON_BIT:
|
case GL_POLYGON_BIT:
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: config.h,v 1.37 2001/12/18 04:06:45 brianp Exp $ */
|
/* $Id: config.h,v 1.38 2002/05/27 17:04:52 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
|
|
||||||
/* Min and Max point sizes and granularity */
|
/* Min and Max point sizes and granularity */
|
||||||
#define MIN_POINT_SIZE 1.0
|
#define MIN_POINT_SIZE 1.0
|
||||||
#define MAX_POINT_SIZE 10.0
|
#define MAX_POINT_SIZE 20.0
|
||||||
#define POINT_SIZE_GRANULARITY 0.1
|
#define POINT_SIZE_GRANULARITY 0.1
|
||||||
|
|
||||||
/* Min and Max line widths and granularity */
|
/* Min and Max line widths and granularity */
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: context.c,v 1.162 2002/05/09 21:54:16 brianp Exp $ */
|
/* $Id: context.c,v 1.163 2002/05/27 17:04:52 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -1116,7 +1116,11 @@ init_attrib_groups( GLcontext *ctx )
|
|||||||
ctx->Point.MinSize = 0.0;
|
ctx->Point.MinSize = 0.0;
|
||||||
ctx->Point.MaxSize = ctx->Const.MaxPointSize;
|
ctx->Point.MaxSize = ctx->Const.MaxPointSize;
|
||||||
ctx->Point.Threshold = 1.0;
|
ctx->Point.Threshold = 1.0;
|
||||||
ctx->Point.SpriteMode = GL_FALSE; /* GL_MESA_sprite_point */
|
ctx->Point.PointSprite = GL_FALSE; /* GL_NV_point_sprite */
|
||||||
|
ctx->Point.SpriteRMode = GL_ZERO; /* GL_NV_point_sprite */
|
||||||
|
for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
|
||||||
|
ctx->Point.CoordReplace[i] = GL_FALSE; /* GL_NV_point_sprite */
|
||||||
|
}
|
||||||
|
|
||||||
/* Polygon group */
|
/* Polygon group */
|
||||||
ctx->Polygon.CullFlag = GL_FALSE;
|
ctx->Polygon.CullFlag = GL_FALSE;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: enable.c,v 1.62 2002/04/21 18:49:18 brianp Exp $ */
|
/* $Id: enable.c,v 1.63 2002/05/27 17:04:53 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -794,13 +794,13 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
|
|||||||
ctx->Transform.RasterPositionUnclipped = state;
|
ctx->Transform.RasterPositionUnclipped = state;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_MESA_sprite_point */
|
/* GL_NV_point_sprite */
|
||||||
case GL_SPRITE_POINT_MESA:
|
case GL_POINT_SPRITE_NV:
|
||||||
CHECK_EXTENSION(MESA_sprite_point);
|
CHECK_EXTENSION(NV_point_sprite);
|
||||||
if (ctx->Point.SpriteMode == state)
|
if (ctx->Point.PointSprite == state)
|
||||||
return;
|
return;
|
||||||
FLUSH_VERTICES(ctx, _NEW_POINT);
|
FLUSH_VERTICES(ctx, _NEW_POINT);
|
||||||
ctx->Point.SpriteMode = state;
|
ctx->Point.PointSprite = state;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_NV_vertex_program */
|
/* GL_NV_vertex_program */
|
||||||
@@ -1158,9 +1158,9 @@ _mesa_IsEnabled( GLenum cap )
|
|||||||
CHECK_EXTENSION(IBM_rasterpos_clip);
|
CHECK_EXTENSION(IBM_rasterpos_clip);
|
||||||
return ctx->Transform.RasterPositionUnclipped;
|
return ctx->Transform.RasterPositionUnclipped;
|
||||||
|
|
||||||
/* GL_MESA_sprite_point */
|
/* GL_NV_point_sprite */
|
||||||
case GL_SPRITE_POINT_MESA:
|
case GL_POINT_SPRITE_NV:
|
||||||
return ctx->Point.SpriteMode;
|
return ctx->Point.PointSprite;
|
||||||
|
|
||||||
/* GL_NV_vertex_program */
|
/* GL_NV_vertex_program */
|
||||||
case GL_VERTEX_PROGRAM_NV:
|
case GL_VERTEX_PROGRAM_NV:
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: extensions.c,v 1.73 2002/05/02 00:59:20 brianp Exp $ */
|
/* $Id: extensions.c,v 1.74 2002/05/27 17:04:53 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -111,9 +111,9 @@ static struct {
|
|||||||
{ OFF, "GL_INGR_blend_func_separate", F(INGR_blend_func_separate) },
|
{ OFF, "GL_INGR_blend_func_separate", F(INGR_blend_func_separate) },
|
||||||
{ OFF, "GL_MESA_packed_depth_stencil", 0 },
|
{ OFF, "GL_MESA_packed_depth_stencil", 0 },
|
||||||
{ OFF, "GL_MESA_resize_buffers", F(MESA_resize_buffers) },
|
{ OFF, "GL_MESA_resize_buffers", F(MESA_resize_buffers) },
|
||||||
{ OFF, "GL_MESA_sprite_point", F(MESA_sprite_point) },
|
|
||||||
{ ON, "GL_MESA_window_pos", F(MESA_window_pos) },
|
{ ON, "GL_MESA_window_pos", F(MESA_window_pos) },
|
||||||
{ OFF, "GL_NV_blend_square", F(NV_blend_square) },
|
{ OFF, "GL_NV_blend_square", F(NV_blend_square) },
|
||||||
|
{ OFF, "GL_NV_point_sprite", F(NV_point_sprite) },
|
||||||
{ ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) },
|
{ ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) },
|
||||||
{ OFF, "GL_NV_vertex_program", F(NV_vertex_program) },
|
{ OFF, "GL_NV_vertex_program", F(NV_vertex_program) },
|
||||||
{ OFF, "GL_NV_vertex_program1_1", F(NV_vertex_program1_1) },
|
{ OFF, "GL_NV_vertex_program1_1", F(NV_vertex_program1_1) },
|
||||||
@@ -177,6 +177,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
|
|||||||
"GL_INGR_blend_func_separate",
|
"GL_INGR_blend_func_separate",
|
||||||
"GL_MESA_resize_buffers",
|
"GL_MESA_resize_buffers",
|
||||||
"GL_NV_blend_square",
|
"GL_NV_blend_square",
|
||||||
|
"GL_NV_point_sprite",
|
||||||
"GL_NV_texgen_reflection",
|
"GL_NV_texgen_reflection",
|
||||||
"GL_NV_vertex_program",
|
"GL_NV_vertex_program",
|
||||||
"GL_NV_vertex_program1_1",
|
"GL_NV_vertex_program1_1",
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: get.c,v 1.78 2002/05/09 21:54:16 brianp Exp $ */
|
/* $Id: get.c,v 1.79 2002/05/27 17:04:53 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -1325,10 +1325,14 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
|
|||||||
*params = ctx->Transform.RasterPositionUnclipped;
|
*params = ctx->Transform.RasterPositionUnclipped;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_MESA_sprite_point */
|
/* GL_NV_point_sprite */
|
||||||
case GL_SPRITE_POINT_MESA:
|
case GL_POINT_SPRITE_NV:
|
||||||
CHECK_EXTENSION_B(MESA_sprite_point);
|
CHECK_EXTENSION_B(NV_point_sprite);
|
||||||
*params = ctx->Point.SpriteMode;
|
*params = ctx->Point.PointSprite;
|
||||||
|
break;
|
||||||
|
case GL_POINT_SPRITE_R_MODE_NV:
|
||||||
|
CHECK_EXTENSION_B(NV_point_sprite);
|
||||||
|
*params = ENUM_TO_BOOL(ctx->Point.SpriteRMode);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_SGIS_generate_mipmap */
|
/* GL_SGIS_generate_mipmap */
|
||||||
@@ -2654,10 +2658,14 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
|
|||||||
*params = (GLdouble) ctx->Transform.RasterPositionUnclipped;
|
*params = (GLdouble) ctx->Transform.RasterPositionUnclipped;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_MESA_sprite_point */
|
/* GL_NV_point_sprite */
|
||||||
case GL_SPRITE_POINT_MESA:
|
case GL_POINT_SPRITE_NV:
|
||||||
CHECK_EXTENSION_D(MESA_sprite_point);
|
CHECK_EXTENSION_B(NV_point_sprite);
|
||||||
*params = (GLdouble) ctx->Point.SpriteMode;
|
*params = (GLdouble) ctx->Point.PointSprite;
|
||||||
|
break;
|
||||||
|
case GL_POINT_SPRITE_R_MODE_NV:
|
||||||
|
CHECK_EXTENSION_B(NV_point_sprite);
|
||||||
|
*params = (GLdouble) ctx->Point.SpriteRMode;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_SGIS_generate_mipmap */
|
/* GL_SGIS_generate_mipmap */
|
||||||
@@ -3869,10 +3877,14 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
|
|||||||
*params = (GLfloat) ctx->Transform.RasterPositionUnclipped;
|
*params = (GLfloat) ctx->Transform.RasterPositionUnclipped;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_MESA_sprite_point */
|
/* GL_NV_point_sprite */
|
||||||
case GL_SPRITE_POINT_MESA:
|
case GL_POINT_SPRITE_NV:
|
||||||
CHECK_EXTENSION_F(MESA_sprite_point);
|
CHECK_EXTENSION_B(NV_point_sprite);
|
||||||
*params = (GLfloat) ctx->Point.SpriteMode;
|
*params = (GLfloat) ctx->Point.PointSprite;
|
||||||
|
break;
|
||||||
|
case GL_POINT_SPRITE_R_MODE_NV:
|
||||||
|
CHECK_EXTENSION_B(NV_point_sprite);
|
||||||
|
*params = (GLfloat) ctx->Point.SpriteRMode;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_SGIS_generate_mipmap */
|
/* GL_SGIS_generate_mipmap */
|
||||||
@@ -5122,10 +5134,14 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
|
|||||||
*params = (GLint) ctx->Transform.RasterPositionUnclipped;
|
*params = (GLint) ctx->Transform.RasterPositionUnclipped;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_MESA_sprite_point */
|
/* GL_NV_point_sprite */
|
||||||
case GL_SPRITE_POINT_MESA:
|
case GL_POINT_SPRITE_NV:
|
||||||
CHECK_EXTENSION_I(MESA_sprite_point);
|
CHECK_EXTENSION_B(NV_point_sprite);
|
||||||
*params = (GLint) ctx->Point.SpriteMode;
|
*params = (GLint) ctx->Point.PointSprite;
|
||||||
|
break;
|
||||||
|
case GL_POINT_SPRITE_R_MODE_NV:
|
||||||
|
CHECK_EXTENSION_B(NV_point_sprite);
|
||||||
|
*params = (GLint) ctx->Point.SpriteRMode;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_SGIS_generate_mipmap */
|
/* GL_SGIS_generate_mipmap */
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: mtypes.h,v 1.75 2002/05/09 21:54:16 brianp Exp $ */
|
/* $Id: mtypes.h,v 1.76 2002/05/27 17:04:53 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -434,10 +434,10 @@ struct gl_enable_attrib {
|
|||||||
GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */
|
GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */
|
||||||
GLuint Texture[MAX_TEXTURE_UNITS];
|
GLuint Texture[MAX_TEXTURE_UNITS];
|
||||||
GLuint TexGen[MAX_TEXTURE_UNITS];
|
GLuint TexGen[MAX_TEXTURE_UNITS];
|
||||||
/* GL_NV_vertex_program */
|
GLboolean VertexProgram; /* GL_NV_vertex_program */
|
||||||
GLboolean VertexProgram;
|
GLboolean VertexProgramPointSize; /* GL_NV_vertex_program */
|
||||||
GLboolean VertexProgramPointSize;
|
GLboolean VertexProgramTwoSide; /* GL_NV_vertex_program */
|
||||||
GLboolean VertexProgramTwoSide;
|
GLboolean PointSprite; /* GL_NV_point_sprite */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -669,13 +669,15 @@ struct gl_pixel_attrib {
|
|||||||
|
|
||||||
struct gl_point_attrib {
|
struct gl_point_attrib {
|
||||||
GLboolean SmoothFlag; /* True if GL_POINT_SMOOTH is enabled */
|
GLboolean SmoothFlag; /* True if GL_POINT_SMOOTH is enabled */
|
||||||
GLboolean SpriteMode; /* GL_MESA_sprite_point extension */
|
|
||||||
GLfloat Size; /* User-specified point size */
|
GLfloat Size; /* User-specified point size */
|
||||||
GLfloat _Size; /* Size clamped to Const.Min/MaxPointSize */
|
GLfloat _Size; /* Size clamped to Const.Min/MaxPointSize */
|
||||||
GLfloat Params[3]; /* GL_EXT_point_parameters */
|
GLfloat Params[3]; /* GL_EXT_point_parameters */
|
||||||
GLfloat MinSize, MaxSize; /* GL_EXT_point_parameters */
|
GLfloat MinSize, MaxSize; /* GL_EXT_point_parameters */
|
||||||
GLfloat Threshold; /* GL_EXT_point_parameters */
|
GLfloat Threshold; /* GL_EXT_point_parameters */
|
||||||
GLboolean _Attenuated; /* True if Params != [1, 0, 0] */
|
GLboolean _Attenuated; /* True if Params != [1, 0, 0] */
|
||||||
|
GLboolean PointSprite; /* GL_NV_point_sprite */
|
||||||
|
GLboolean CoordReplace[MAX_TEXTURE_UNITS]; /* GL_NV_point_sprite */
|
||||||
|
GLenum SpriteRMode; /* GL_NV_point_sprite */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -1427,6 +1429,7 @@ struct gl_extensions {
|
|||||||
GLboolean MESA_resize_buffers;
|
GLboolean MESA_resize_buffers;
|
||||||
GLboolean MESA_sprite_point;
|
GLboolean MESA_sprite_point;
|
||||||
GLboolean NV_blend_square;
|
GLboolean NV_blend_square;
|
||||||
|
GLboolean NV_point_sprite;
|
||||||
GLboolean NV_texgen_reflection;
|
GLboolean NV_texgen_reflection;
|
||||||
GLboolean NV_vertex_program;
|
GLboolean NV_vertex_program;
|
||||||
GLboolean NV_vertex_program1_1;
|
GLboolean NV_vertex_program1_1;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: points.c,v 1.32 2002/04/02 16:15:16 brianp Exp $ */
|
/* $Id: points.c,v 1.33 2002/05/27 17:04:53 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -70,6 +70,29 @@ _mesa_PointSize( GLfloat size )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Added by GL_NV_point_sprite
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
_mesa_PointParameteriNV( GLenum pname, GLint param )
|
||||||
|
{
|
||||||
|
const GLfloat value = (GLfloat) param;
|
||||||
|
_mesa_PointParameterfvEXT(pname, &value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Added by GL_NV_point_sprite
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
_mesa_PointParameterivNV( GLenum pname, const GLint *params )
|
||||||
|
{
|
||||||
|
const GLfloat value = (GLfloat) params[0];
|
||||||
|
_mesa_PointParameterfvEXT(pname, &value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Same for both GL_EXT_point_parameters and GL_ARB_point_parameters.
|
* Same for both GL_EXT_point_parameters and GL_ARB_point_parameters.
|
||||||
*/
|
*/
|
||||||
@@ -90,14 +113,9 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
|
|||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||||
|
|
||||||
if (!ctx->Extensions.EXT_point_parameters) {
|
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glPointParameterf[v]{EXT,ARB}(pname)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (pname) {
|
switch (pname) {
|
||||||
case GL_DISTANCE_ATTENUATION_EXT:
|
case GL_DISTANCE_ATTENUATION_EXT:
|
||||||
{
|
if (ctx->Extensions.EXT_point_parameters) {
|
||||||
const GLboolean tmp = ctx->Point._Attenuated;
|
const GLboolean tmp = ctx->Point._Attenuated;
|
||||||
if (TEST_EQ_3V(ctx->Point.Params, params))
|
if (TEST_EQ_3V(ctx->Point.Params, params))
|
||||||
return;
|
return;
|
||||||
@@ -118,39 +136,88 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
|
|||||||
ctx->_NeedEyeCoords ^= NEED_EYE_POINT_ATTEN;
|
ctx->_NeedEyeCoords ^= NEED_EYE_POINT_ATTEN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||||
|
"glPointParameterf[v]{EXT,ARB}(pname)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GL_POINT_SIZE_MIN_EXT:
|
case GL_POINT_SIZE_MIN_EXT:
|
||||||
if (*params < 0.0F) {
|
if (ctx->Extensions.EXT_point_parameters) {
|
||||||
_mesa_error( ctx, GL_INVALID_VALUE, "glPointParameterf[v]{EXT,ARB}(param)" );
|
if (params[0] < 0.0F) {
|
||||||
|
_mesa_error( ctx, GL_INVALID_VALUE,
|
||||||
|
"glPointParameterf[v]{EXT,ARB}(param)" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ctx->Point.MinSize == *params)
|
if (ctx->Point.MinSize == params[0])
|
||||||
return;
|
return;
|
||||||
FLUSH_VERTICES(ctx, _NEW_POINT);
|
FLUSH_VERTICES(ctx, _NEW_POINT);
|
||||||
ctx->Point.MinSize = *params;
|
ctx->Point.MinSize = params[0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||||
|
"glPointParameterf[v]{EXT,ARB}(pname)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GL_POINT_SIZE_MAX_EXT:
|
case GL_POINT_SIZE_MAX_EXT:
|
||||||
if (*params < 0.0F) {
|
if (ctx->Extensions.EXT_point_parameters) {
|
||||||
_mesa_error( ctx, GL_INVALID_VALUE, "glPointParameterf[v]{EXT,ARB}(param)" );
|
if (params[0] < 0.0F) {
|
||||||
|
_mesa_error( ctx, GL_INVALID_VALUE,
|
||||||
|
"glPointParameterf[v]{EXT,ARB}(param)" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ctx->Point.MaxSize == *params)
|
if (ctx->Point.MaxSize == params[0])
|
||||||
return;
|
return;
|
||||||
FLUSH_VERTICES(ctx, _NEW_POINT);
|
FLUSH_VERTICES(ctx, _NEW_POINT);
|
||||||
ctx->Point.MaxSize = *params;
|
ctx->Point.MaxSize = params[0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||||
|
"glPointParameterf[v]{EXT,ARB}(pname)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
|
case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
|
||||||
if (*params < 0.0F) {
|
if (ctx->Extensions.EXT_point_parameters) {
|
||||||
_mesa_error( ctx, GL_INVALID_VALUE, "glPointParameterf[v]{EXT,ARB}(param)" );
|
if (params[0] < 0.0F) {
|
||||||
|
_mesa_error( ctx, GL_INVALID_VALUE,
|
||||||
|
"glPointParameterf[v]{EXT,ARB}(param)" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ctx->Point.Threshold == *params)
|
if (ctx->Point.Threshold == params[0])
|
||||||
return;
|
return;
|
||||||
FLUSH_VERTICES(ctx, _NEW_POINT);
|
FLUSH_VERTICES(ctx, _NEW_POINT);
|
||||||
ctx->Point.Threshold = *params;
|
ctx->Point.Threshold = params[0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||||
|
"glPointParameterf[v]{EXT,ARB}(pname)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GL_POINT_SPRITE_R_MODE_NV:
|
||||||
|
if (ctx->Extensions.NV_point_sprite) {
|
||||||
|
GLenum value = (GLenum) params[0];
|
||||||
|
if (value != GL_ZERO && value != GL_S && value != GL_R) {
|
||||||
|
_mesa_error(ctx, GL_INVALID_VALUE,
|
||||||
|
"glPointParameterf[v]{EXT,ARB}(param)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (ctx->Point.SpriteRMode == value)
|
||||||
|
return;
|
||||||
|
FLUSH_VERTICES(ctx, _NEW_POINT);
|
||||||
|
ctx->Point.SpriteRMode = value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||||
|
"glPointParameterf[v]{EXT,ARB}(pname)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_mesa_error( ctx, GL_INVALID_ENUM, "glPointParameterf[v]{EXT,ARB}(pname)" );
|
_mesa_error( ctx, GL_INVALID_ENUM,
|
||||||
|
"glPointParameterf[v]{EXT,ARB}(pname)" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: points.h,v 1.6 2002/04/02 16:15:17 brianp Exp $ */
|
/* $Id: points.h,v 1.7 2002/05/27 17:04:53 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -35,6 +35,12 @@
|
|||||||
extern void
|
extern void
|
||||||
_mesa_PointSize( GLfloat size );
|
_mesa_PointSize( GLfloat size );
|
||||||
|
|
||||||
|
extern void
|
||||||
|
_mesa_PointParameteriNV( GLenum pname, GLint param );
|
||||||
|
|
||||||
|
extern void
|
||||||
|
_mesa_PointParameterivNV( GLenum pname, const GLint *params );
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
_mesa_PointParameterfEXT( GLenum pname, GLfloat param );
|
_mesa_PointParameterfEXT( GLenum pname, GLfloat param );
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: texstate.c,v 1.71 2002/05/02 00:59:20 brianp Exp $ */
|
/* $Id: texstate.c,v 1.72 2002/05/27 17:04:53 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -403,23 +403,51 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) {
|
else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) {
|
||||||
|
/* GL_EXT_texture_lod_bias */
|
||||||
if (!ctx->Extensions.EXT_texture_lod_bias) {
|
if (!ctx->Extensions.EXT_texture_lod_bias) {
|
||||||
_mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" );
|
_mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target)" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (pname) {
|
if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
|
||||||
case GL_TEXTURE_LOD_BIAS_EXT:
|
|
||||||
if (texUnit->LodBias == param[0])
|
if (texUnit->LodBias == param[0])
|
||||||
return;
|
return;
|
||||||
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
|
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
|
||||||
texUnit->LodBias = CLAMP(param[0], -ctx->Const.MaxTextureLodBias,
|
texUnit->LodBias = CLAMP(param[0], -ctx->Const.MaxTextureLodBias,
|
||||||
ctx->Const.MaxTextureLodBias);
|
ctx->Const.MaxTextureLodBias);
|
||||||
break;
|
}
|
||||||
default:
|
else {
|
||||||
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
|
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (target == GL_POINT_SPRITE_NV) {
|
||||||
|
/* GL_NV_point_sprite */
|
||||||
|
if (!ctx->Extensions.NV_point_sprite) {
|
||||||
|
_mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target)" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pname == GL_COORD_REPLACE_NV) {
|
||||||
|
const GLenum value = (GLenum) param[0];
|
||||||
|
if (value == GL_TRUE || value == GL_FALSE) {
|
||||||
|
/* It's kind of weird to set point state via glTexEnv,
|
||||||
|
* but that's what the spec calls for.
|
||||||
|
*/
|
||||||
|
const GLboolean state = (GLboolean) value;
|
||||||
|
if (ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] == state)
|
||||||
|
return;
|
||||||
|
FLUSH_VERTICES(ctx, _NEW_POINT);
|
||||||
|
ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] = state;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_mesa_error( ctx, GL_INVALID_VALUE, "glTexEnv(param)" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname)" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
_mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target)" );
|
_mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target)" );
|
||||||
return;
|
return;
|
||||||
@@ -482,11 +510,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
|
|||||||
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
|
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
|
||||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||||
|
|
||||||
if (target!=GL_TEXTURE_ENV) {
|
if (target == GL_TEXTURE_ENV) {
|
||||||
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (pname) {
|
switch (pname) {
|
||||||
case GL_TEXTURE_ENV_MODE:
|
case GL_TEXTURE_ENV_MODE:
|
||||||
*params = ENUM_TO_FLOAT(texUnit->EnvMode);
|
*params = ENUM_TO_FLOAT(texUnit->EnvMode);
|
||||||
@@ -654,6 +678,39 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
|
|||||||
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" );
|
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) {
|
||||||
|
/* GL_EXT_texture_lod_bias */
|
||||||
|
if (!ctx->Extensions.EXT_texture_lod_bias) {
|
||||||
|
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
|
||||||
|
*params = texUnit->LodBias;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (target == GL_POINT_SPRITE_NV) {
|
||||||
|
/* GL_NV_point_sprite */
|
||||||
|
if (!ctx->Extensions.NV_point_sprite) {
|
||||||
|
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pname == GL_COORD_REPLACE_NV) {
|
||||||
|
*params = (GLfloat) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -663,11 +720,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
|
|||||||
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
|
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
|
||||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||||
|
|
||||||
if (target != GL_TEXTURE_ENV) {
|
if (target == GL_TEXTURE_ENV) {
|
||||||
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (pname) {
|
switch (pname) {
|
||||||
case GL_TEXTURE_ENV_MODE:
|
case GL_TEXTURE_ENV_MODE:
|
||||||
*params = (GLint) texUnit->EnvMode;
|
*params = (GLint) texUnit->EnvMode;
|
||||||
@@ -838,6 +891,39 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
|
|||||||
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" );
|
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) {
|
||||||
|
/* GL_EXT_texture_lod_bias */
|
||||||
|
if (!ctx->Extensions.EXT_texture_lod_bias) {
|
||||||
|
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
|
||||||
|
*params = (GLint) texUnit->LodBias;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (target == GL_POINT_SPRITE_NV) {
|
||||||
|
/* GL_NV_point_sprite */
|
||||||
|
if (!ctx->Extensions.NV_point_sprite) {
|
||||||
|
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pname == GL_COORD_REPLACE_NV) {
|
||||||
|
*params = (GLint) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: s_points.c,v 1.17 2002/02/02 17:24:11 brianp Exp $ */
|
/* $Id: s_points.c,v 1.18 2002/05/27 17:04:53 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -147,12 +147,12 @@
|
|||||||
/*
|
/*
|
||||||
* Sprite (textured point)
|
* Sprite (textured point)
|
||||||
*/
|
*/
|
||||||
#define FLAGS (RGBA | TEXTURE | SPRITE)
|
#define FLAGS (RGBA | SPRITE)
|
||||||
#define NAME sprite_point
|
#define NAME sprite_point
|
||||||
#include "s_pointtemp.h"
|
#include "s_pointtemp.h"
|
||||||
|
|
||||||
|
|
||||||
#define FLAGS (RGBA | ATTENUATE | TEXTURE | SPRITE)
|
#define FLAGS (RGBA | ATTENUATE | SPRITE)
|
||||||
#define NAME atten_sprite_point
|
#define NAME atten_sprite_point
|
||||||
#include "s_pointtemp.h"
|
#include "s_pointtemp.h"
|
||||||
|
|
||||||
@@ -201,7 +201,8 @@ _swrast_choose_point( GLcontext *ctx )
|
|||||||
GLboolean rgbMode = ctx->Visual.rgbMode;
|
GLboolean rgbMode = ctx->Visual.rgbMode;
|
||||||
|
|
||||||
if (ctx->RenderMode==GL_RENDER) {
|
if (ctx->RenderMode==GL_RENDER) {
|
||||||
if (ctx->Point.SpriteMode) {
|
if (ctx->Point.PointSprite) {
|
||||||
|
/* GL_NV_point_sprite */
|
||||||
/* XXX this might not be good enough */
|
/* XXX this might not be good enough */
|
||||||
if (ctx->Point._Attenuated)
|
if (ctx->Point._Attenuated)
|
||||||
USE(atten_sprite_point);
|
USE(atten_sprite_point);
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: s_pointtemp.h,v 1.15 2002/04/19 14:05:50 brianp Exp $ */
|
/* $Id: s_pointtemp.h,v 1.16 2002/05/27 17:04:53 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
* SPECULAR = do separate specular color
|
* SPECULAR = do separate specular color
|
||||||
* LARGE = do points with diameter > 1 pixel
|
* LARGE = do points with diameter > 1 pixel
|
||||||
* ATTENUATE = compute point size attenuation
|
* ATTENUATE = compute point size attenuation
|
||||||
* SPRITE = GL_MESA_sprite_point
|
* SPRITE = GL_NV_point_sprite
|
||||||
*
|
*
|
||||||
* Notes: LARGE and ATTENUATE are exclusive of each other.
|
* Notes: LARGE and ATTENUATE are exclusive of each other.
|
||||||
* TEXTURE requires RGBA
|
* TEXTURE requires RGBA
|
||||||
@@ -64,7 +64,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
|||||||
#if FLAGS & TEXTURE
|
#if FLAGS & TEXTURE
|
||||||
GLuint u;
|
GLuint u;
|
||||||
#endif
|
#endif
|
||||||
#if FLAGS & (ATTENUATE | LARGE | SMOOTH)
|
#if FLAGS & (ATTENUATE | LARGE | SMOOTH | SPRITE)
|
||||||
GLfloat size;
|
GLfloat size;
|
||||||
#endif
|
#endif
|
||||||
#if FLAGS & ATTENUATE
|
#if FLAGS & ATTENUATE
|
||||||
@@ -93,8 +93,10 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
|||||||
|
|
||||||
#if (FLAGS & RGBA)
|
#if (FLAGS & RGBA)
|
||||||
#if (FLAGS & SMOOTH)
|
#if (FLAGS & SMOOTH)
|
||||||
|
/* because we need per-fragment alpha values */
|
||||||
span->arrayMask |= SPAN_RGBA;
|
span->arrayMask |= SPAN_RGBA;
|
||||||
#else
|
#else
|
||||||
|
/* same RGBA for all fragments */
|
||||||
span->interpMask |= SPAN_RGBA;
|
span->interpMask |= SPAN_RGBA;
|
||||||
span->red = ChanToFixed(vert->color[0]);
|
span->red = ChanToFixed(vert->color[0]);
|
||||||
span->green = ChanToFixed(vert->color[1]);
|
span->green = ChanToFixed(vert->color[1]);
|
||||||
@@ -116,6 +118,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
|||||||
span->indexStep = 0;
|
span->indexStep = 0;
|
||||||
#endif
|
#endif
|
||||||
#if FLAGS & TEXTURE
|
#if FLAGS & TEXTURE
|
||||||
|
/* but not used for sprite mode */
|
||||||
span->interpMask |= SPAN_TEXTURE;
|
span->interpMask |= SPAN_TEXTURE;
|
||||||
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
|
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
|
||||||
if (ctx->Texture.Unit[u]._ReallyEnabled) {
|
if (ctx->Texture.Unit[u]._ReallyEnabled) {
|
||||||
@@ -135,6 +138,9 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
|||||||
#if FLAGS & SMOOTH
|
#if FLAGS & SMOOTH
|
||||||
span->arrayMask |= SPAN_COVERAGE;
|
span->arrayMask |= SPAN_COVERAGE;
|
||||||
#endif
|
#endif
|
||||||
|
#if FLAGS & SPRITE
|
||||||
|
span->arrayMask |= SPAN_TEXTURE;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if FLAGS & ATTENUATE
|
#if FLAGS & ATTENUATE
|
||||||
if (vert->pointSize >= ctx->Point.Threshold) {
|
if (vert->pointSize >= ctx->Point.Threshold) {
|
||||||
@@ -146,68 +152,11 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
|||||||
size = MAX2(ctx->Point.Threshold, ctx->Point.MinSize);
|
size = MAX2(ctx->Point.Threshold, ctx->Point.MinSize);
|
||||||
alphaAtten = dsize * dsize;
|
alphaAtten = dsize * dsize;
|
||||||
}
|
}
|
||||||
#elif FLAGS & (LARGE | SMOOTH)
|
#elif FLAGS & (LARGE | SMOOTH | SPRITE)
|
||||||
size = ctx->Point._Size;
|
size = ctx->Point._Size;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FLAGS & SPRITE
|
#if FLAGS & (LARGE | ATTENUATE | SMOOTH | SPRITE)
|
||||||
{
|
|
||||||
SWcontext *swctx = SWRAST_CONTEXT(ctx);
|
|
||||||
const GLfloat radius = 0.5F * vert->pointSize; /* XXX threshold, alpha */
|
|
||||||
SWvertex v0, v1, v2, v3;
|
|
||||||
GLuint unit;
|
|
||||||
|
|
||||||
#if (FLAGS & RGBA) && (FLAGS & SMOOTH)
|
|
||||||
(void) red;
|
|
||||||
(void) green;
|
|
||||||
(void) blue;
|
|
||||||
(void) alpha;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* lower left corner */
|
|
||||||
v0 = *vert;
|
|
||||||
v0.win[0] -= radius;
|
|
||||||
v0.win[1] -= radius;
|
|
||||||
|
|
||||||
/* lower right corner */
|
|
||||||
v1 = *vert;
|
|
||||||
v1.win[0] += radius;
|
|
||||||
v1.win[1] -= radius;
|
|
||||||
|
|
||||||
/* upper right corner */
|
|
||||||
v2 = *vert;
|
|
||||||
v2.win[0] += radius;
|
|
||||||
v2.win[1] += radius;
|
|
||||||
|
|
||||||
/* upper left corner */
|
|
||||||
v3 = *vert;
|
|
||||||
v3.win[0] -= radius;
|
|
||||||
v3.win[1] += radius;
|
|
||||||
|
|
||||||
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
|
|
||||||
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
|
|
||||||
v0.texcoord[unit][0] = 0.0;
|
|
||||||
v0.texcoord[unit][1] = 0.0;
|
|
||||||
v1.texcoord[unit][0] = 1.0;
|
|
||||||
v1.texcoord[unit][1] = 0.0;
|
|
||||||
v2.texcoord[unit][0] = 1.0;
|
|
||||||
v2.texcoord[unit][1] = 1.0;
|
|
||||||
v3.texcoord[unit][0] = 0.0;
|
|
||||||
v3.texcoord[unit][1] = 1.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* XXX if radius < threshold, attenuate alpha? */
|
|
||||||
|
|
||||||
/* XXX need to implement clipping!!! */
|
|
||||||
|
|
||||||
/* render */
|
|
||||||
swctx->Triangle(ctx, &v0, &v1, &v2);
|
|
||||||
swctx->Triangle(ctx, &v0, &v2, &v3);
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif FLAGS & (LARGE | ATTENUATE | SMOOTH)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
GLint x, y;
|
GLint x, y;
|
||||||
const GLfloat radius = 0.5F * size;
|
const GLfloat radius = 0.5F * size;
|
||||||
@@ -249,6 +198,9 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
|||||||
(void) radius;
|
(void) radius;
|
||||||
for (y = ymin; y <= ymax; y++) {
|
for (y = ymin; y <= ymax; y++) {
|
||||||
for (x = xmin; x <= xmax; x++) {
|
for (x = xmin; x <= xmax; x++) {
|
||||||
|
#if FLAGS & SPRITE
|
||||||
|
GLuint u;
|
||||||
|
#endif
|
||||||
#if FLAGS & SMOOTH
|
#if FLAGS & SMOOTH
|
||||||
/* compute coverage */
|
/* compute coverage */
|
||||||
const GLfloat dx = x - vert->win[0] + 0.5F;
|
const GLfloat dx = x - vert->win[0] + 0.5F;
|
||||||
@@ -284,10 +236,32 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
|||||||
count++;
|
count++;
|
||||||
} /*if*/
|
} /*if*/
|
||||||
#else /*SMOOTH*/
|
#else /*SMOOTH*/
|
||||||
/* not smooth (square points */
|
/* not smooth (square points) */
|
||||||
span->xArray[count] = x;
|
span->xArray[count] = x;
|
||||||
span->yArray[count] = y;
|
span->yArray[count] = y;
|
||||||
span->zArray[count] = z;
|
span->zArray[count] = z;
|
||||||
|
#if FLAGS & SPRITE
|
||||||
|
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
|
||||||
|
if (ctx->Texture.Unit[u]._ReallyEnabled) {
|
||||||
|
if (ctx->Point.CoordReplace[u]) {
|
||||||
|
GLfloat s = 0.5F + (x + 0.5F - vert->win[0]) / size;
|
||||||
|
GLfloat t = 0.5F - (y + 0.5F - vert->win[1]) / size;
|
||||||
|
span->texcoords[u][count][0] = s;
|
||||||
|
span->texcoords[u][count][1] = t;
|
||||||
|
span->texcoords[u][count][3] = 1.0F;
|
||||||
|
if (ctx->Point.SpriteRMode == GL_ZERO)
|
||||||
|
span->texcoords[u][count][2] = 0.0F;
|
||||||
|
else if (ctx->Point.SpriteRMode == GL_S)
|
||||||
|
span->texcoords[u][count][2] = vert->texcoord[u][0];
|
||||||
|
else /* GL_R */
|
||||||
|
span->texcoords[u][count][2] = vert->texcoord[u][2];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
COPY_4V(span->texcoords[u][count], vert->texcoord[u]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /*SPRITE*/
|
||||||
count++;
|
count++;
|
||||||
#endif /*SMOOTH*/
|
#endif /*SMOOTH*/
|
||||||
} /*for x*/
|
} /*for x*/
|
||||||
@@ -295,7 +269,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
|||||||
span->end = count;
|
span->end = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* LARGE || ATTENUATE || SMOOTH*/
|
#else /* LARGE | ATTENUATE | SMOOTH | SPRITE */
|
||||||
|
|
||||||
{
|
{
|
||||||
/* size == 1 */
|
/* size == 1 */
|
||||||
@@ -309,7 +283,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
|||||||
|
|
||||||
ASSERT(span->end > 0);
|
ASSERT(span->end > 0);
|
||||||
|
|
||||||
#if FLAGS & TEXTURE
|
#if FLAGS & (TEXTURE | SPRITE)
|
||||||
if (ctx->Texture._ReallyEnabled)
|
if (ctx->Texture._ReallyEnabled)
|
||||||
_mesa_write_texture_span(ctx, span);
|
_mesa_write_texture_span(ctx, span);
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user