本文整理汇总了C++中renderer::line方法的典型用法代码示例。如果您正苦于以下问题:C++ renderer::line方法的具体用法?C++ renderer::line怎么用?C++ renderer::line使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类renderer
的用法示例。
在下文中一共展示了renderer::line方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
edit_interface_rep::draw_graphics (renderer ren) {
if (got_focus || full_screen) {
cursor cu= get_cursor();
if (over_graphics(cu->ox, cu->oy) && inside_active_graphics ()) {
eval ("(graphics-reset-context 'graphics-cursor)");
draw_graphical_object (ren);
string tm_curs= as_string (eval ("graphics-texmacs-pointer"));
if (tm_curs != "none") {
if (tm_curs == "graphics-cross") {
ren->set_line_style (pixel);
ren->set_color (red);
ren->line (cu->ox, cu->oy-5*pixel, cu->ox, cu->oy+5*pixel);
ren->line (cu->ox-5*pixel, cu->oy, cu->ox+5*pixel, cu->oy);
}
else if (tm_curs == "graphics-cross-arrows") {
static int s= 6*pixel, a= 2*pixel;
ren->set_line_style (pixel);
ren->set_color (red);
ren->line (cu->ox, cu->oy-s, cu->ox, cu->oy+s);
ren->line (cu->ox-s, cu->oy, cu->ox+s, cu->oy);
ren->line (cu->ox, cu->oy-s,cu->ox-a, cu->oy-s+a);
ren->line (cu->ox, cu->oy-s, cu->ox+a, cu->oy-s+a);
ren->line (cu->ox, cu->oy+s, cu->ox-a, cu->oy+s-a);
ren->line (cu->ox, cu->oy+s, cu->ox+a, cu->oy+s-a);
ren->line (cu->ox-s, cu->oy, cu->ox-s+a, cu->oy+a);
ren->line (cu->ox-s, cu->oy, cu->ox-s+a, cu->oy-a);
ren->line (cu->ox+s, cu->oy, cu->ox+s-a, cu->oy+a);
ren->line (cu->ox+s, cu->oy, cu->ox+s-a, cu->oy-a);
}
}
}
else eval ("(graphics-reset-context 'text-cursor)");
}
}
示例2:
void
edit_interface_rep::draw_context (renderer ren, rectangle r) {
int i;
ren->set_color (light_grey);
ren->set_line_style (pixel);
for (i=1; i<N(eb[0]); i++) {
SI y= eb->sy(0)+ eb[0]->sy2(i);
if ((y >= r->y1) && (y < r->y2))
ren->line (r->x1, y, r->x2, y);
}
draw_surround (ren, r);
}