-/* $Id: polygon.c,v 1.6 1999/11/08 15:28:08 brianp Exp $ */
+/* $Id: polygon.c,v 1.11 2000/03/13 18:32:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
*/
-/* $XFree86: xc/lib/GL/mesa/src/polygon.c,v 1.3 1999/04/04 00:20:29 dawes Exp $ */
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "image.h"
#include "enums.h"
#include "macros.h"
+#include "mem.h"
#include "polygon.h"
#include "types.h"
#endif
-void gl_CullFace( GLcontext *ctx, GLenum mode )
+void
+_mesa_CullFace( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCullFace");
if (MESA_VERBOSE&VERBOSE_API)
-void gl_FrontFace( GLcontext *ctx, GLenum mode )
+void
+_mesa_FrontFace( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glFrontFace");
if (MESA_VERBOSE&VERBOSE_API)
-void gl_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode )
+void
+_mesa_PolygonMode( GLenum face, GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonMode");
if (MESA_VERBOSE&VERBOSE_API)
-/*
- * NOTE: stipple pattern has already been unpacked.
- */
-void gl_PolygonStipple( GLcontext *ctx, const GLuint pattern[32] )
+void
+_mesa_PolygonStipple( const GLubyte *pattern )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonStipple");
if (MESA_VERBOSE&VERBOSE_API)
fprintf(stderr, "glPolygonStipple\n");
- MEMCPY( ctx->PolygonStipple, pattern, 32 * 4 );
+ _mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack);
if (ctx->Polygon.StippleFlag) {
ctx->NewState |= NEW_RASTER_OPS;
}
+
+ if (ctx->Driver.PolygonStipple)
+ ctx->Driver.PolygonStipple( ctx, (const GLubyte *) ctx->PolygonStipple );
}
-void gl_GetPolygonStipple( GLcontext *ctx, GLubyte *dest )
+void
+_mesa_GetPolygonStipple( GLubyte *dest )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonOffset");
if (MESA_VERBOSE&VERBOSE_API)
fprintf(stderr, "glGetPolygonStipple\n");
- gl_pack_polygon_stipple( ctx, ctx->PolygonStipple, dest );
+ _mesa_pack_polygon_stipple(ctx->PolygonStipple, dest, &ctx->Pack);
}
-void gl_PolygonOffset( GLcontext *ctx,
- GLfloat factor, GLfloat units )
+void
+_mesa_PolygonOffset( GLfloat factor, GLfloat units )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonOffset");
if (MESA_VERBOSE&VERBOSE_API)
ctx->Polygon.OffsetUnits = units;
}
+
+
+void
+_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonOffsetEXT");
+ _mesa_PolygonOffset(factor, bias * ctx->Visual->DepthMaxF );
+}