home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP30-3.ZIP / EXAMPLES.ZIP / PIXEL.CPP < prev    next >
C/C++ Source or Header  |  1992-02-18  |  1KB  |  29 lines

  1. // Borland C++ - (C) Copyright 1991 by Borland International
  2.  
  3. /* PIXEL.CPP--Example from Getting Started */
  4.  
  5. // PIXEL.CPP demonstrates the Point and Location classes
  6. // compile with POINT2.CPP and link with GRAPHICS.LIB
  7.  
  8. #include <graphics.h>   // declarations for graphics library
  9. #include <conio.h>      // for getch() function
  10. #include "point.h"      // declarations for Point and Location classes
  11.  
  12. int main()
  13. {
  14.    // initialize the graphics system
  15.    int graphdriver = DETECT, graphmode;
  16.    initgraph(&graphdriver, &graphmode, "..\\bgi");
  17.  
  18.    // move a point across the screen
  19.    Point APoint(100, 50);   // Initial X, Y at 100, 50
  20.    APoint.Show();           // APoint turns itself on
  21.    getch();                 // Wait for keypress
  22.    APoint.MoveTo(300, 150); // APoint moves to 300,150
  23.    getch();                 // Wait for keypress
  24.    APoint.Hide();           // APoint turns itself off
  25.    getch();                 // Wait for keypress
  26.    closegraph();            // Restore original screen
  27.    return 0;
  28. }
  29.