#include <sphigs.h>
#include <sphigslocal.h>
#include <stdio.h>

#define WINDOW_WIDTH 500
#define WINDOW_HEIGHT 500
#define PLANES 5
#define SHADES 4

#define DEFAULT_VIEW 0

#define HOUSE 0
#define NUM_VERTICES 4

void init_vertices (point vertices[]) {
   SPH_defPoint (vertices[0], 0.1,0.1,0.0);
   SPH_defPoint (vertices[1], 0.1,0.9,0.0);
   SPH_defPoint (vertices[2], 0.9,0.9,0.0);
   SPH_defPoint (vertices[3], 0.9,0.1,0.0);
   }
   
void main (void) {
   point vertices[NUM_VERTICES];
   long int i;

   init_vertices (vertices);

   SPH_begin (WINDOW_WIDTH, WINDOW_HEIGHT, PLANES, SHADES);

   SPH_openStructure (HOUSE);
   SPH_polyLine (NUM_VERTICES, vertices);
   SPH_closeStructure ();
   SPH_postRoot (HOUSE, DEFAULT_VIEW);

   printf ("There are %d settable colors, of which %d are flexicolors.\n",
           NUM_OF_APPL_SETTABLE_COLORS, NUM_OF_FLEXICOLORS);
   for (i=10000000; i--;) ;
   SPH_end ();
   }
