[Univ of Cambridge] [Dept of Engineering]
next up previous contents
Next: Xlib Up: Examples Previous: Examples

Vogle

CUED people can read the local information on vogle and home-produced additions. There are examples in /export/Examples/graphics/vogle.

// To compile from the command line, use 
//  aCC -I/usr/local/include -L/usr/local/lib ...   -lvogle -lX11

#include <cstdio>
#include <cstdlib>
#include <vogle.h>

int main()
{

   vinit("X11");

   color(WHITE);         // we want to clear in white
   clear();              // clear to current color

   color(RED);           // set current color to red

   move2(-1.0, 0.0);     // draw a horizontal line at y = 0.
   draw2(1.0, 0.0);      // Note:By default x is -1 to 1 and y is -1 to 1

   move2(0.0, 0.0);      // draw a line along x = 0
   draw2(0.0, 1.0);

   rect(.2, .5, .8, .9); // draw a rectangle.

   move2(0.0, 0.0);      // move to the middle of the screen
   drawstr("Hello");     // draw "Hello" starting at the origin

   getkey();             // wait for a keypress

   vexit();           
}








Tim Love
2001-07-26