#ifndef GLSCENE_H
#define GLSCENE_H

#include <GL/glut.h>
#include "types.h"

typedef struct vertex_s
{
  coord x,y,z ;
  int triangles[6] ; /* there can be up to 6 triangles using a vertex */
} vertex_t, *vertex_p ;

typedef struct triangle_s
{
  int v1,v2,v3 ; /* vertices */
  coord x,y,z ; /* normal vector */
  int t1,t2,t3,t4 ; /* "sons" of this triangle */
} triangle_t, *triangle_p ;

/*
            v1              t1's v1 is v1
           /  \             t2's v2 is v2
          / t1 \            t3's v3 is v3
         /------\           t4's v1 is pointing down
        / \ t4 / \
       /   \  /   \
      / t3  \/ t2  \
     v3------------v2
 */

/* remember to update these constants when changing above structures ! */
const int vertex_list_padding = 6*sizeof(int) ;
const int triangle_list_padding = 4*sizeof(int)+3*sizeof(coord) ;

#endif
