home *** CD-ROM | disk | FTP | other *** search
/ gondwana.ecr.mu.oz.au/pub/ / Graphics.tar / Graphics / VOGLE.ZIP / EXAMPLES / PSIMPLE.P < prev    next >
Text File  |  2000-02-11  |  1KB  |  65 lines

  1.  
  2. (*
  3.  * A program showing basic line drawing, text and (if applicable)
  4.  * colour. As none of the projection routines have been called we
  5.  * move and draw in the initial coordinate system -1.0 to 1.0.
  6.  *)
  7. program simple(input, output);
  8.  
  9. #include "Vogle.h"
  10.  
  11. var
  12.     device: string_t;
  13.     p: string_t;
  14.     i: integer;
  15.  
  16. begin
  17.     p := 'Hello, world';
  18.  
  19.     Voutput('psimple.ps');
  20.     write('Enter output device: ');
  21.     readln(device);
  22.  
  23.     PrefSize(300, 300);
  24.     PrefPosition(100, 100);
  25.     Vinit(device);        (* set up device *)
  26.  
  27.     Color(BLACK);        (* set current color *)
  28.     Clear;        (* clear screen to current color *)
  29.  
  30.     Color(GREEN);
  31.             (* 2 d move to start where we want drawstr to start *)
  32.     Move2(-0.9, 0.9);
  33.  
  34.     DrawStr('A Simple Example');    (* draw string in current color *)
  35.  
  36.     (*
  37.      * the next four lines draw the x 
  38.      *)
  39.     Move2(0.0, 0.0);
  40.     Draw2(0.76, 0.76);
  41.     Move2(0.0, 0.76);
  42.     Draw2(0.76, 0.0);
  43.  
  44.     Move2(0.0, 0.5);
  45.     DrawStr('x done');
  46.     DrawStr('next sentence');
  47.  
  48.     Move2(0.0, 0.1);
  49.     for i := 1 to 11 do
  50.         DrawChar(p[i]);        (* draw the string one char at a time *)
  51.  
  52.     (*
  53.      * the next five lines draw the square
  54.      *)
  55.     Move2(0.0, 0.0);
  56.     Draw2(0.76, 0.0);
  57.     Draw2(0.76, 0.76);
  58.     Draw2(0.0, 0.76);
  59.     Draw2(0.0, 0.0);
  60.  
  61.     i := GetKey;        (* wait for some input *)
  62.  
  63.     Vexit        (* set the screen back to its original state *)
  64. end.
  65.