-/* $Id: ss_triangle.c,v 1.19 2002/10/29 20:29:00 brianp Exp $ */
+/* $Id: ss_triangle.c,v 1.20 2002/10/29 22:25:57 brianp Exp $ */
/*
* Mesa 3-D graphics library
static void _swsetup_render_line_tri( GLcontext *ctx,
- GLuint e0, GLuint e1, GLuint e2 )
+ GLuint e0, GLuint e1, GLuint e2,
+ GLuint facing )
{
SScontext *swsetup = SWSETUP_CONTEXT(ctx);
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLchan s[2][4];
GLuint i[2];
+ /* cull testing */
+ if (ctx->Polygon.CullFlag) {
+ if (facing == 1 && ctx->Polygon.CullFaceMode != GL_FRONT)
+ return;
+ if (facing == 0 && ctx->Polygon.CullFaceMode != GL_BACK)
+ return;
+ }
+
if (ctx->_TriangleCaps & DD_FLATSHADE) {
COPY_CHAN4(c[0], v0->color);
COPY_CHAN4(c[1], v1->color);
}
static void _swsetup_render_point_tri( GLcontext *ctx,
- GLuint e0, GLuint e1, GLuint e2 )
+ GLuint e0, GLuint e1, GLuint e2,
+ GLuint facing )
{
SScontext *swsetup = SWSETUP_CONTEXT(ctx);
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLchan s[2][4];
GLuint i[2];
+ /* cull testing */
+ if (ctx->Polygon.CullFlag) {
+ if (facing == 1 && ctx->Polygon.CullFaceMode != GL_FRONT)
+ return;
+ if (facing == 0 && ctx->Polygon.CullFaceMode != GL_BACK)
+ return;
+ }
+
if (ctx->_TriangleCaps & DD_FLATSHADE) {
COPY_CHAN4(c[0], v0->color);
COPY_CHAN4(c[1], v1->color);
-/* $Id: ss_tritmp.h,v 1.18 2002/10/29 20:29:00 brianp Exp $ */
+/* $Id: ss_tritmp.h,v 1.19 2002/10/29 22:25:57 brianp Exp $ */
/*
* Mesa 3-D graphics library
v[1]->win[2] += offset;
v[2]->win[2] += offset;
}
- _swsetup_render_point_tri( ctx, e0, e1, e2 );
+ _swsetup_render_point_tri( ctx, e0, e1, e2, facing );
} else if (mode == GL_LINE) {
if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetLine) {
v[0]->win[2] += offset;
v[1]->win[2] += offset;
v[2]->win[2] += offset;
}
- _swsetup_render_line_tri( ctx, e0, e1, e2 );
+ _swsetup_render_line_tri( ctx, e0, e1, e2, facing );
} else {
if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetFill) {
v[0]->win[2] += offset;