diff options
author | Brian <[email protected]> | 2007-07-10 11:54:03 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-07-10 11:54:03 -0600 |
commit | 1fe4cf83cd929a0ecc1119d3bb541e80618d3987 (patch) | |
tree | 295e3f207ab7684bf2006a0ea2ef6765e556c5e9 /src/mesa/pipe/draw/draw_unfilled.c | |
parent | 24b68f4184c1f899f21038508068631184ca736a (diff) |
Fix front/back mix-up. added comments.
Diffstat (limited to 'src/mesa/pipe/draw/draw_unfilled.c')
-rw-r--r-- | src/mesa/pipe/draw/draw_unfilled.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mesa/pipe/draw/draw_unfilled.c b/src/mesa/pipe/draw/draw_unfilled.c index a1d9d143520..8ee23d7493b 100644 --- a/src/mesa/pipe/draw/draw_unfilled.c +++ b/src/mesa/pipe/draw/draw_unfilled.c @@ -25,6 +25,11 @@ * **************************************************************************/ +/** + * \brief Drawing stage for handling glPolygonMode(line/point). + * Convert triangles to points or lines as needed. + */ + /* Authors: Keith Whitwell <[email protected]> */ @@ -36,6 +41,10 @@ struct unfilled_stage { struct prim_stage stage; + /** [0] = front face, [1] = back face. + * legal values: PIPE_POLYGON_MODE_FILL, PIPE_POLYGON_MODE_LINE, + * and PIPE_POLYGON_MODE_POINT, + */ GLuint mode[2]; }; @@ -50,8 +59,8 @@ static void unfilled_begin( struct prim_stage *stage ) { struct unfilled_stage *unfilled = unfilled_stage(stage); - unfilled->mode[0] = stage->draw->setup.fill_ccw; - unfilled->mode[1] = stage->draw->setup.fill_cw; + unfilled->mode[0] = stage->draw->setup.fill_ccw; /* front */ + unfilled->mode[1] = stage->draw->setup.fill_cw; /* back */ stage->next->begin( stage->next ); } @@ -87,6 +96,7 @@ static void points( struct prim_stage *stage, if (v2->edgeflag) point( stage, v2 ); } + static void lines( struct prim_stage *stage, struct prim_header *header ) { @@ -109,7 +119,7 @@ static void unfilled_tri( struct prim_stage *stage, struct prim_header *header ) { struct unfilled_stage *unfilled = unfilled_stage(stage); - GLuint mode = unfilled->mode[header->det < 0]; + GLuint mode = unfilled->mode[header->det > 0.0]; switch (mode) { case PIPE_POLYGON_MODE_FILL: |