home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
microcrn
/
issue_44.arc
/
MICROCAD.ARC
/
LINE.CPP
< prev
next >
Wrap
Text File
|
1988-09-27
|
678b
|
28 lines
// Figure 10 for "A Little CAD with C++"
// Copyright 1988 Bruce Eckel
// Permission required to distribute source
// file: line.cpp
#include "line.hpp"
#include <msmouse.h>
#include <fg.h>
void line::draw() {
msm_hidecursor();
line_data [FG_X1] = x_center;
line_data [FG_X2] = x_center + 30;
line_data [FG_Y1] = y_center;
line_data [FG_Y2] = y_center + 30;
fg_drawline (FG_WHITE, FG_MODE_SET, ~0,
FG_LINE_SOLID, line_data);
msm_showcursor();
}
void line::erase() {
msm_hidecursor();
fg_drawline (FG_BLACK, FG_MODE_SET, ~0,
FG_LINE_SOLID, line_data);
msm_showcursor();
}