From da9f17aa78b7b41424a546a2cf8b2a785f9a030f Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 9 Jan 2010 00:11:35 +0000 Subject: strip legacy plotter interface cleanup line plotting interface move plotter interface structs to apropriate header svn path=/trunk/libnsfb/; revision=9798 --- test/bezier.c | 6 ++++-- test/plottest.c | 21 +++++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) (limited to 'test') diff --git a/test/bezier.c b/test/bezier.c index d44779b..c523da8 100644 --- a/test/bezier.c +++ b/test/bezier.c @@ -22,6 +22,7 @@ int main(int argc, char **argv) nsfb_point_t ctrla; nsfb_point_t ctrlb; int loop; + nsfb_plot_pen_t pen; UNUSED(argc); UNUSED(argv); @@ -64,6 +65,7 @@ int main(int argc, char **argv) nsfb_plot_cubic_bezier(nsfb, &box2, &ctrla, &ctrlb, 0xff000000); } + pen.stroke_colour = 0xff000000; box2.x0=400; box2.y0=100; @@ -71,7 +73,7 @@ int main(int argc, char **argv) box2.x1=600; box2.y1=400; - nsfb_plot_line(nsfb, &box2, 1, 0xff000000, false, false); + nsfb_plot_line(nsfb, &box2, &pen); box2.x0=800; box2.y0=100; @@ -79,7 +81,7 @@ int main(int argc, char **argv) box2.x1=600; box2.y1=400; - nsfb_plot_line(nsfb, &box2, 1, 0xff000000, false, false); + nsfb_plot_line(nsfb, &box2, &pen); box2.x0=400; box2.y0=100; diff --git a/test/plottest.c b/test/plottest.c index 3fc4d83..8be921e 100644 --- a/test/plottest.c +++ b/test/plottest.c @@ -78,6 +78,7 @@ int main(int argc, char **argv) int fbstride; int p[] = { 300,300, 350,350, 400,300, 450,250, 400,200}; int loop; + nsfb_plot_pen_t pen; UNUSED(argc); UNUSED(argv); @@ -109,36 +110,40 @@ int main(int argc, char **argv) nsfb_plot_clg(nsfb, 0xffffff00 | loop); } - /* draw radial lines from the origin */ + /* draw black radial lines from the origin */ + pen.stroke_colour = 0xff000000; for (loop = 0; loop < box.x1; loop += 20) { box2 = box; box2.x1 = loop; - nsfb_plot_line(nsfb, &box2, 1, 0xff000000, false, false); + nsfb_plot_line(nsfb, &box2, &pen); } - /* draw radial lines from the bottom right */ + /* draw blue radial lines from the bottom right */ + pen.stroke_colour = 0xffff0000; for (loop = 0; loop < box.x1; loop += 20) { box2 = box; box2.x0 = loop; - nsfb_plot_line(nsfb, &box2, 1, 0xffff0000, false, false); + nsfb_plot_line(nsfb, &box2, &pen); } - /* draw radial lines from the bottom left */ + /* draw green radial lines from the bottom left */ + pen.stroke_colour = 0xff00ff00; for (loop = 0; loop < box.x1; loop += 20) { box2.x0 = box.x0; box2.x1 = loop; box2.y0 = box.y1; box2.y1 = box.y0; - nsfb_plot_line(nsfb, &box2, 1, 0xff00ff00, false, false); + nsfb_plot_line(nsfb, &box2, &pen); } - /* draw radial lines from the top right */ + /* draw red radial lines from the top right */ + pen.stroke_colour = 0xff0000ff; for (loop = 0; loop < box.x1; loop += 20) { box2.x0 = box.x1; box2.x1 = loop; box2.y0 = box.y0; box2.y1 = box.y1; - nsfb_plot_line(nsfb, &box2, 1, 0xff0000ff, false, false); + nsfb_plot_line(nsfb, &box2, &pen); } /* draw an unclipped rectangle */ -- cgit v1.2.3