home *** CD-ROM | disk | FTP | other *** search
/ gondwana.ecr.mu.oz.au/pub/ / Graphics.tar / Graphics / avogl.tar.gz / avogl.tar / vogl / examples / trivial.c < prev    next >
C/C++ Source or Header  |  1992-09-22  |  1KB  |  51 lines

  1. #include <stdio.h>
  2.  
  3. #ifdef SGI
  4. #include "gl.h"
  5. #include "device.h"
  6. #else
  7. #include "vogl.h"
  8. #include "vodevice.h"
  9. #endif
  10.  
  11. /*
  12.  * the basic test program for a driver if we can draw a line and do
  13.  * hardware text we are almost there!
  14.  */
  15. main(argc, argv)
  16.     int    argc;
  17.     char    **argv;
  18. {
  19.     short    val;
  20.  
  21.     winopen("trivial");
  22.  
  23.     if (argc == 2)
  24.         font(atoi(argv[1]));        /* set font to argument */
  25.  
  26.     qdevice(KEYBD);            /* enable the keyboard */
  27.     unqdevice(INPUTCHANGE);
  28.  
  29.     color(BLACK);            /* we want to clear in black */
  30.     clear();            /* clear to current color */
  31.  
  32.     ortho2(-1.0, 1.0, -1.0, 1.0);    /* set up the coordinate system */
  33.  
  34.     color(GREEN);            /* set current color to green */
  35.  
  36.     move2(-1.0, 0.0);        /* draw a horizontal line at y = 0 */
  37.     draw2(1.0, 0.0);
  38.  
  39.     qread(&val);            /* pause for some input */
  40.  
  41.     move2(0.0, 0.0);        /* draw a line along x = 0 */
  42.     draw2(0.0, 1.0);
  43.  
  44.     cmov2(0.0, 0.0);        /* move to the middle of the screen */
  45.     charstr("Hello");        /* draw "Hello" starting at the origin */
  46.  
  47.     qread(&val);            /* pause again */
  48.  
  49.     gexit();            /* set screen back to original state */
  50. }
  51.