diff options
Diffstat (limited to 'xc/extras/Mesa/src/points.c')
-rw-r--r-- | xc/extras/Mesa/src/points.c | 103 |
1 files changed, 59 insertions, 44 deletions
diff --git a/xc/extras/Mesa/src/points.c b/xc/extras/Mesa/src/points.c index 4334be44c..1643e8f8a 100644 --- a/xc/extras/Mesa/src/points.c +++ b/xc/extras/Mesa/src/points.c @@ -1,8 +1,8 @@ -/* $Id: points.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */ +/* $Id: points.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -23,18 +23,12 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/points.c,v 1.4 1999/04/04 00:20:29 dawes Exp $ */ - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include <math.h> -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "feedback.h" #include "macros.h" @@ -45,18 +39,20 @@ #include "texstate.h" #include "types.h" #include "vb.h" -#include "mmath.h" #endif -void gl_PointSize( GLcontext *ctx, GLfloat size ) +void +_mesa_PointSize( GLfloat size ) { - if (size<=0.0) { + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointSize"); + + if (size <= 0.0) { gl_error( ctx, GL_INVALID_VALUE, "glPointSize" ); return; } - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointSize"); if (ctx->Point.Size != size) { ctx->Point.Size = size; @@ -68,42 +64,61 @@ void gl_PointSize( GLcontext *ctx, GLfloat size ) -void gl_PointParameterfvEXT( GLcontext *ctx, GLenum pname, - const GLfloat *params) +void +_mesa_PointParameterfEXT( GLenum pname, GLfloat param) { + _mesa_PointParameterfvEXT(pname, ¶m); +} + + +void +_mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params) +{ + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointParameterfvEXT"); - if(pname==GL_DISTANCE_ATTENUATION_EXT) { - GLboolean tmp = ctx->Point.Attenuated; - COPY_3V(ctx->Point.Params,params); - ctx->Point.Attenuated = (params[0] != 1.0 || - params[1] != 0.0 || - params[2] != 0.0); - - if (tmp != ctx->Point.Attenuated) { - ctx->Enabled ^= ENABLE_POINT_ATTEN; - ctx->TriangleCaps ^= DD_POINT_ATTEN; - ctx->NewState |= NEW_RASTER_OPS; - } - } else { - if (*params<0.0 ) { + + switch (pname) { + case GL_DISTANCE_ATTENUATION_EXT: + { + const GLboolean tmp = ctx->Point.Attenuated; + COPY_3V(ctx->Point.Params, params); + ctx->Point.Attenuated = (params[0] != 1.0 || + params[1] != 0.0 || + params[2] != 0.0); + + if (tmp != ctx->Point.Attenuated) { + ctx->Enabled ^= ENABLE_POINT_ATTEN; + ctx->TriangleCaps ^= DD_POINT_ATTEN; + ctx->NewState |= NEW_RASTER_OPS; + } + } + break; + case GL_POINT_SIZE_MIN_EXT: + if (*params < 0.0F) { gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" ); return; - } - switch (pname) { - case GL_POINT_SIZE_MIN_EXT: - ctx->Point.MinSize=*params; - break; - case GL_POINT_SIZE_MAX_EXT: - ctx->Point.MaxSize=*params; - break; - case GL_POINT_FADE_THRESHOLD_SIZE_EXT: - ctx->Point.Threshold=*params; - break; - default: - gl_error( ctx, GL_INVALID_ENUM, "glPointParameterfvEXT" ); - return; - } + } + ctx->Point.MinSize = *params; + break; + case GL_POINT_SIZE_MAX_EXT: + if (*params < 0.0F) { + gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" ); + return; + } + ctx->Point.MaxSize = *params; + break; + case GL_POINT_FADE_THRESHOLD_SIZE_EXT: + if (*params < 0.0F) { + gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" ); + return; + } + ctx->Point.Threshold = *params; + break; + default: + gl_error( ctx, GL_INVALID_ENUM, "glPointParameterfvEXT" ); + return; } + ctx->NewState |= NEW_RASTER_OPS; } |