-/* $Id: s_pointtemp.h,v 1.22 2003/01/14 04:55:46 brianp Exp $ */
-
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.0
*
- * Copyright (C) 1999-2002 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"),
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/*
+ * Regarding GL_NV_point_sprite:
+ *
+ * Portions of this software may use or implement intellectual
+ * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims
+ * any and all warranties with respect to such intellectual property,
+ * including any use thereof or modifications thereto.
+ */
+
/*
* Point rendering template code.
* SPECULAR = do separate specular color
* LARGE = do points with diameter > 1 pixel
* ATTENUATE = compute point size attenuation
- * SPRITE = GL_NV_point_sprite
+ * SPRITE = GL_ARB_point_sprite / GL_NV_point_sprite
*
* Notes: LARGE and ATTENUATE are exclusive of each other.
* TEXTURE requires RGBA
#if FLAGS & (ATTENUATE | LARGE | SMOOTH | SPRITE)
GLfloat size;
#endif
-#if FLAGS & ATTENUATE
+#if FLAGS & RGBA
+#if (FLAGS & ATTENUATE) && (FLAGS & SMOOTH)
GLfloat alphaAtten;
#endif
-#if FLAGS & RGBA
const GLchan red = vert->color[0];
const GLchan green = vert->color[1];
const GLchan blue = vert->color[2];
#if FLAGS & ATTENUATE
if (vert->pointSize >= ctx->Point.Threshold) {
size = MIN2(vert->pointSize, ctx->Point.MaxSize);
+#if (FLAGS & RGBA) && (FLAGS & SMOOTH)
alphaAtten = 1.0F;
+#endif
}
else {
+#if (FLAGS & RGBA) && (FLAGS & SMOOTH)
GLfloat dsize = vert->pointSize / ctx->Point.Threshold;
- size = MAX2(ctx->Point.Threshold, ctx->Point.MinSize);
alphaAtten = dsize * dsize;
+#endif
+ size = MAX2(ctx->Point.Threshold, ctx->Point.MinSize);
}
#elif FLAGS & (LARGE | SMOOTH | SPRITE)
size = ctx->Point._Size;
(swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) {
#if FLAGS & (TEXTURE | SPRITE)
if (ctx->Texture._EnabledUnits)
- _mesa_write_texture_span(ctx, span);
+ _swrast_write_texture_span(ctx, span);
else
- _mesa_write_rgba_span(ctx, span);
+ _swrast_write_rgba_span(ctx, span);
#elif FLAGS & RGBA
- _mesa_write_rgba_span(ctx, span);
+ _swrast_write_rgba_span(ctx, span);
#else
- _mesa_write_index_span(ctx, span);
+ _swrast_write_index_span(ctx, span);
#endif
span->end = 0;
}
(swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) {
#if FLAGS & (TEXTURE | SPRITE)
if (ctx->Texture._EnabledUnits)
- _mesa_write_texture_span(ctx, span);
+ _swrast_write_texture_span(ctx, span);
else
- _mesa_write_rgba_span(ctx, span);
+ _swrast_write_rgba_span(ctx, span);
#elif FLAGS & RGBA
- _mesa_write_rgba_span(ctx, span);
+ _swrast_write_rgba_span(ctx, span);
#else
- _mesa_write_index_span(ctx, span);
+ _swrast_write_index_span(ctx, span);
#endif
span->end = 0;
}