/* * bar3d — трёхмерный брусок: передняя грань залита текущим стилем * заливки, рёбра — текущим цветом рисования. depth — глубина (вправо- * вверх), topflag != 0 рисует верхнюю грань. */ #include "../_bgi.h" void bar3d(int left, int top, int right, int bottom, int depth, int topflag) { int t; if (right < left) { t = left; left = right; right = t; } if (bottom < top) { t = top; top = bottom; bottom = t; } bar(left, top, right, bottom); /* передняя грань — заливка */ rectangle(left, top, right, bottom); /* рамка переда — тек. цвет */ if (depth != 0) { line(right, top, right + depth, top - depth); line(right, bottom, right + depth, bottom - depth); line(right + depth, top - depth, right + depth, bottom - depth); if (topflag) { line(left, top, left + depth, top - depth); line(left + depth, top - depth, right + depth, top - depth); } } }