-/* $Id: lines.c,v 1.3 1999/10/08 09:27:11 keithw Exp $ */
+/* $Id: lines.c,v 1.9 2000/03/03 18:55:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "depth.h"
#include "feedback.h"
#include "texstate.h"
#include "types.h"
#include "vb.h"
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#endif
#endif
-void gl_LineWidth( GLcontext *ctx, GLfloat width )
+void
+_mesa_LineWidth( GLfloat width )
{
+ GET_CURRENT_CONTEXT(ctx);
if (width<=0.0) {
gl_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
return;
ctx->TriangleCaps &= ~DD_LINE_WIDTH;
if (width != 1.0) ctx->TriangleCaps |= DD_LINE_WIDTH;
ctx->NewState |= NEW_RASTER_OPS;
+ if (ctx->Driver.LineWidth)
+ (*ctx->Driver.LineWidth)(ctx, width);
}
}
-void gl_LineStipple( GLcontext *ctx, GLint factor, GLushort pattern )
+void
+_mesa_LineStipple( GLint factor, GLushort pattern )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLineStipple");
ctx->Line.StippleFactor = CLAMP( factor, 1, 256 );
ctx->Line.StipplePattern = pattern;
ctx->NewState |= NEW_RASTER_OPS;
+
+ if (ctx->Driver.LineStipple)
+ ctx->Driver.LineStipple( ctx, factor, pattern );
}
#include "linetemp.h"
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
#include "linetemp.h"
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
#include "linetemp.h"
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
#include "linetemp.h"
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
#include "linetemp.h"
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
#include "linetemp.h"
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
#include "linetemp.h"
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
#include "linetemp.h"
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
}
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
}
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
}
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
}
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
}
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
}
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
}
ctx->PB->count = count;
- PB_CHECK_FLUSH( ctx, ctx->PB );
+ gl_flush_pb(ctx);
}
else {
if (ctx->Light.ShadeModel==GL_SMOOTH) {
/* Width==1, non-stippled, smooth-shaded */
- if (ctx->Depth.Test
- || (ctx->Fog.Enabled && ctx->Hint.Fog==GL_NICEST)) {
+ if (ctx->Depth.Test || ctx->FogMode == FOG_FRAGMENT) {
if (rgbmode)
ctx->Driver.LineFunc = smooth_rgba_z_line;
else
}
else {
/* Width==1, non-stippled, flat-shaded */
- if (ctx->Depth.Test
- || (ctx->Fog.Enabled && ctx->Hint.Fog==GL_NICEST)) {
+ if (ctx->Depth.Test || ctx->FogMode == FOG_FRAGMENT) {
if (rgbmode)
ctx->Driver.LineFunc = flat_rgba_z_line;
else