diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-07-25 15:48:09 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-07-25 15:48:09 -0600 |
commit | 0360b49afbcd839f99ba0745d01cf9dc5be4d122 (patch) | |
tree | f2746f209352f65cec01360ef88c2a018eb8b68b /src/mesa/pipe/draw/draw_vb.c | |
parent | 1f6b4b0f75d7cd7306e6aa24c27fd478f6b6c52d (diff) |
Implement line stippling.
Also added draw_stage::reset_line_stipple(). There may be a better way
of doing that though.
Diffstat (limited to 'src/mesa/pipe/draw/draw_vb.c')
-rw-r--r-- | src/mesa/pipe/draw/draw_vb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/pipe/draw/draw_vb.c b/src/mesa/pipe/draw/draw_vb.c index ac721c589d..ac126c5baa 100644 --- a/src/mesa/pipe/draw/draw_vb.c +++ b/src/mesa/pipe/draw/draw_vb.c @@ -151,12 +151,14 @@ static void draw_indexed_prim( struct draw_context *draw, prim.v[0] = get_vertex( draw, elts[i + 0] ); prim.v[1] = get_vertex( draw, elts[i + 1] ); + first->reset_stipple_counter( first ); first->line( first, &prim ); } break; case GL_LINE_LOOP: if (count >= 2) { + first->reset_stipple_counter( first ); for (i = 1; i < count; i++) { prim.v[0] = get_vertex( draw, elts[i-1] ); prim.v[1] = get_vertex( draw, elts[i] ); @@ -178,6 +180,7 @@ static void draw_indexed_prim( struct draw_context *draw, * require more complex code here. */ if (count >= 2) { + first->reset_stipple_counter( first ); prim.v[0] = 0; prim.v[1] = get_vertex( draw, elts[0] ); @@ -313,13 +316,15 @@ static void draw_prim( struct draw_context *draw, for (i = 0; i+1 < count; i += 2) { prim.v[0] = get_vertex( draw, start + i + 0 ); prim.v[1] = get_vertex( draw, start + i + 1 ); - + + first->reset_stipple_counter( first ); first->line( first, &prim ); } break; case GL_LINE_LOOP: if (count >= 2) { + first->reset_stipple_counter( first ); for (i = 1; i < count; i++) { prim.v[0] = get_vertex( draw, start + i - 1 ); prim.v[1] = get_vertex( draw, start + i ); @@ -334,6 +339,7 @@ static void draw_prim( struct draw_context *draw, case GL_LINE_STRIP: if (count >= 2) { + first->reset_stipple_counter( first ); prim.v[0] = 0; prim.v[1] = get_vertex( draw, start + 0 ); |