home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0000 - 0009 / ibm0000-0009 / ibm0003.tar / ibm0003 / C_DISK5.ZIP / MICROCAD / SQUARE.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-26  |  656 b   |  27 lines

  1. // Copyright 1988 Bruce Eckel
  2. // Permission required to distribute source
  3.  
  4. // file: square.cpp
  5. #include "square.hpp"
  6. #include <fg.h>
  7.  
  8. void square::draw() {
  9.     msm_hidecursor();
  10.     small_box [FG_X1] = x_center;
  11.     small_box [FG_X2] = x_center + 20;
  12.     small_box [FG_Y1] = y_center;
  13.     small_box [FG_Y2] = y_center + 20;
  14.     fg_drawbox (FG_WHITE, FG_MODE_SET, ~0,
  15.                 FG_LINE_SOLID,
  16.                 small_box, fg_displaybox);
  17.     msm_showcursor();
  18. }
  19.  
  20. void square::erase() {
  21.     msm_hidecursor();
  22.     fg_drawbox (FG_BLACK, FG_MODE_SET, ~0,
  23.          FG_LINE_SOLID, small_box, fg_displaybox);
  24.     msm_showcursor();
  25. }
  26.  
  27.