summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/points.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>1999-11-11 01:22:25 +0000
committerBrian Paul <[email protected]>1999-11-11 01:22:25 +0000
commitfbd8f212c3866ec98c1d8c9d3db3ddb7e7c479a5 (patch)
treefb9ea4452e1f65c6e3c11ee4c4f17c023f8262e5 /src/mesa/main/points.c
parent06ac59281bdad6679fb1941e31e3c4df1c12cede (diff)
first big check-in of new Mesa 3.3 code
Diffstat (limited to 'src/mesa/main/points.c')
-rw-r--r--src/mesa/main/points.c74
1 files changed, 40 insertions, 34 deletions
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index 3ecbd105065..a7b0eed4cca 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -1,8 +1,8 @@
-/* $Id: points.c,v 1.4 1999/10/21 12:45:53 brianp Exp $ */
+/* $Id: points.c,v 1.5 1999/11/11 01:22:27 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,11 +64,20 @@ 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, &param);
+}
+
+
+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) {
+
+ if (pname == GL_DISTANCE_ATTENUATION_EXT) {
GLboolean tmp = ctx->Point.Attenuated;
COPY_3V(ctx->Point.Params,params);
ctx->Point.Attenuated = (params[0] != 1.0 ||
@@ -84,25 +89,26 @@ void gl_PointParameterfvEXT( GLcontext *ctx, GLenum pname,
ctx->TriangleCaps ^= DD_POINT_ATTEN;
ctx->NewState |= NEW_RASTER_OPS;
}
- } else {
- if (*params<0.0 ) {
- gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" );
+ }
+ else {
+ if (*params<0.0 ) {
+ 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;
- }
- 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->NewState |= NEW_RASTER_OPS;
}