Mercurial > hg > octave-lojdl
changeset 7906:b3becd212f3f
Draw markers above lines
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 09 Jul 2008 11:00:45 -0400 |
parents | bcacdcc726f7 |
children | c350329da645 |
files | src/ChangeLog src/gl-render.cc |
diffstat | 2 files changed, 22 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2008-07-09 Michael Goffioul <michael.goffioul@gmail.com> + * gl-render.cc (opengl_renderer::set_polygon_offset): Also enable + polygon offseting in GL_LINE mode. + (opengl_renderer::draw_marker): Offset markers foward instead of + backward (to draw them above lines). + * Makefile.in: new substituted variables GL_RENDER_SRC and FLTK_BACKEND_SRC.
--- a/src/gl-render.cc +++ b/src/gl-render.cc @@ -2518,9 +2518,13 @@ { glPolygonOffset (offset, offset); glEnable (GL_POLYGON_OFFSET_FILL); + glEnable (GL_POLYGON_OFFSET_LINE); } else - glDisable (GL_POLYGON_OFFSET_FILL); + { + glDisable (GL_POLYGON_OFFSET_FILL); + glDisable (GL_POLYGON_OFFSET_LINE); + } } void @@ -2648,9 +2652,19 @@ if (fc.numel () > 0) { glColor3dv (fc.data ()); - set_polygon_offset (true, 1.0); + set_polygon_offset (true, -1.0); glCallList (filled_marker_id); + if (lc.numel () > 0) + { + glColor3dv (lc.data ()); + glPolygonMode (GL_FRONT_AND_BACK, GL_LINE); + glEdgeFlag (GL_TRUE); + set_polygon_offset (true, -2.0); + glCallList (filled_marker_id); + glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); + } set_polygon_offset (false); + return; } if (lc.numel () > 0) @@ -2764,6 +2778,7 @@ glVertex2f (sz/2 ,-sz/2); glVertex2f (sz/2 ,sz/2 ); glEnd (); + break; default: warning ("opengl_renderer: unsupported marker `%s'", marker.c_str ());