home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / EGA_GRAF.ZIP / EGA_DEMO.PAS next >
Encoding:
Pascal/Delphi Source File  |  1985-08-29  |  867 b   |  33 lines

  1. PROGRAM EGA_DEMO; {This program is a simple demonstration of the
  2. EGA graphics primitives found in ega_prim.inc}
  3.  
  4. {$I ega_prim.inc}
  5.  
  6.  
  7. VAR
  8.    i, xpos, ypos : INTEGER;
  9.    answer : CHAR;
  10.  
  11. PROCEDURE triangle(x1, y1, x2, y2, x3, y3 : INTEGER);
  12. BEGIN
  13.    draw(x1, y1, x2, y2);
  14.    draw(x2, y2, x3, y3);
  15.    draw(x3, y3, x1, y1)
  16. END;
  17.  
  18.  
  19. BEGIN
  20.    Init_graphics;
  21.    FOR i := 1 TO 90 DO
  22.       triangle(0 + i SHL 2, 0, 100, 300 - i SHL 2, 100 + i SHL 2, 50);
  23.    FOR i := 0 TO 250 DO
  24.        BEGIN
  25.           xpos := round( 120*cos( i/pi));
  26.           ypos := round( 100*sin( i/pi));
  27.           circle(320 + xpos, 175 + ypos, i MOD 80)
  28.        END;
  29.    FOR i := 5 TO 65 DO circle(585, 300 - i SHL 2, 35);
  30.    {**** No prompt is given the user since it would be printed.}
  31.    READ(kbd, answer);  IF upcase(answer) = 'Y' THEN Screen_dump;
  32.    textmode(bw80)
  33. end.