-/* $Id: polygon.c,v 1.17 2000/12/26 05:09:29 keithw Exp $ */
+/* $Id: polygon.c,v 1.21 2001/03/22 00:36:27 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 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"),
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glCullFace %s\n", gl_lookup_enum_by_nr(mode));
+ fprintf(stderr, "glCullFace %s\n", _mesa_lookup_enum_by_nr(mode));
if (mode!=GL_FRONT && mode!=GL_BACK && mode!=GL_FRONT_AND_BACK) {
- gl_error( ctx, GL_INVALID_ENUM, "glCullFace" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" );
return;
}
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "glFrontFace %s\n", gl_lookup_enum_by_nr(mode));
+ fprintf(stderr, "glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode));
if (mode!=GL_CW && mode!=GL_CCW) {
- gl_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
return;
}
if (MESA_VERBOSE&VERBOSE_API)
fprintf(stderr, "glPolygonMode %s %s\n",
- gl_lookup_enum_by_nr(face),
- gl_lookup_enum_by_nr(mode));
+ _mesa_lookup_enum_by_nr(face),
+ _mesa_lookup_enum_by_nr(mode));
if (mode!=GL_POINT && mode!=GL_LINE && mode!=GL_FILL) {
- gl_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
return;
}
ctx->Polygon.BackMode = mode;
break;
default:
- gl_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" );
return;
}
ctx->_TriangleCaps &= ~DD_TRI_UNFILLED;
- if (ctx->Polygon.FrontMode!=GL_FILL || ctx->Polygon.BackMode!=GL_FILL)
+ if (ctx->Polygon.FrontMode!=GL_FILL || ctx->Polygon.BackMode!=GL_FILL)
ctx->_TriangleCaps |= DD_TRI_UNFILLED;
if (ctx->Driver.PolygonMode) {
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.OffsetFactor = factor;
ctx->Polygon.OffsetUnits = units;
- ctx->Polygon.OffsetMRD = units * ctx->Visual.MRD;
+ ctx->Polygon.OffsetMRD = units * ctx->MRD;
+
+ if (ctx->Driver.PolygonOffset)
+ ctx->Driver.PolygonOffset( ctx, factor, units );
}
_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_PolygonOffset(factor, bias * ctx->Visual.DepthMaxF );
+ _mesa_PolygonOffset(factor, bias * ctx->DepthMaxF );
}