home *** CD-ROM | disk | FTP | other *** search
/ gondwana.ecr.mu.oz.au/pub/ / Graphics.tar / Graphics / voglew.zip / SIMPLE.C < prev    next >
Text File  |  1993-05-28  |  1KB  |  61 lines

  1. #include <stdio.h>
  2. #include "vogle.h"
  3.  
  4. /*
  5.  * A program showing basic line drawing, text and (if applicable)
  6.  * colour. As none of the projection routines have been called we
  7.  * move and draw in the initial coordinate system -1.0 to 1.0.
  8.  */
  9. main(ac, av)
  10.     int    ac;
  11.     char    **av;
  12. {
  13.     char    *p;
  14.     float    cw, ch;
  15.  
  16.     prefsize(200, 200);
  17.     prefposition(100, 100);
  18.     vinit("mswin");        /* set up device */
  19.  
  20.     if (ac == 2)
  21.         font(av[1]);    /* change font to the argument */
  22.  
  23.     color(BLACK);        /* set current color */
  24.     clear();        /* clear screen to current color */
  25.  
  26.     color(GREEN);
  27.             /* 2 d move to start where we want drawstr to start */
  28.     move2(-0.9, 0.9);
  29.  
  30.     drawstr("A Simple Example");    /* draw string in current color */
  31.  
  32.     /*
  33.      * the next four lines draw the x 
  34.      */
  35.     move2(0.,0.);
  36.     draw2(.76,.76);
  37.     move2(0.,.76);
  38.     draw2(.76,0.);
  39.  
  40.     move2(0.0,0.5);
  41.     drawstr("x done");
  42.     drawstr("next sentence");
  43.  
  44.     move2(0.0,0.1);
  45.     for (p = "hello world"; *p != NULL; p++) 
  46.         drawchar(*p);        /* draw the string one char at a time */
  47.  
  48.     /*
  49.      * the next five lines draw the square
  50.      */
  51.     move2(0.,0.);
  52.     draw2(.76,0.);
  53.     draw2(.76,.76);
  54.     draw2(0.,.76);
  55.     draw2(0.,0.);
  56.  
  57.     getkey();        /* wait for some input */
  58.  
  59.     vexit();        /* set the screen back to its original state */
  60. }
  61.