/* These are definitions that need to be included for your scanconverter to
   work, but you really don't need to know what they are (yet) */ 

typedef void Shader();

typedef struct vertex_t {
    Vector            pos;    /* vertex position */
    Vector            normal;    /* average normal at vertex */
    Vector            texture;    /* texture parameters (if any) */
    bool              fixed_normal; /* Normal is fixed (supplied by user) */
    struct vertex_t  *big, *sml;  /* pointers to children in the tree */
} Vertex;

typedef struct {
    double  ambient;       /* Fraction of color visible in ambient light */
    double  specular;      /* Fraction of colour specularly reflected */
    double  c3;            /* "Shinyness" 0 = shiny,  1 = dull */
    Color   color;         /* Colour of the surface */
    Color   opacity;       /* Opacity of the surface */
} Surf_desc;

typedef struct {
    int         ref_count;       /* # of references surface description */
    void      (*free_func) ();   /* function to call when no more refs   */
    void       *client_data;     /* arbitrary data for free_func to use  */
} Surf_desc_hdr;

typedef struct polygon_t {
    int         nvertices;
    Vertex    **vertex;
    bool        backface;   /* polygon is backfacing (used at rendering) */
    struct polygon_t *next;
} Polygon;

typedef struct surface_t {
    Vertex           *vertices;          /* vertex tree */
    Polygon          *polygons;          /* polygon list */
    Surf_desc_hdr    *surf_desc_hdr;     /* header for surface if not NULL */
    void             *surface;           /* surface description */
    Shader           *shader;            /* shader function */
/*    Vector            max, min;          / * Bounding box (Future use) */
#ifdef FFD
    Surf_desc_hdr    *ffd_desc_hdr;      /* header for ffd_data if not NULL */
    void             *ffd_data;
    FFD_func         *ffd_func;
#endif 
    int               ref_count;         /* # of references to this surface */
} Surface;

extern void     *im_data;
