/* graphics.h
 *
 * Routines to draw everything.
 */


#ifndef GRAPHICS_H
#define GRAPHICS_H

#include "opengl.H"

typedef enum { COLOUR, GREY, MONO } ColourMode;


class Graphics {

public:

    void init( int num_elevators, int num_floors, ColourMode mode );
    void draw_all();

    void white() {
#ifdef GL
	glColor3f( 1, 1, 1 );
#endif
    }

    void black() {
#ifdef GL
	glColor3f( 0, 0, 0 );
#endif
    }

    void grey() {
#ifdef GL
	if (mode == MONO)
	    glColor3f( 1, 1, 1 );
	else
	    glColor3f( 0.8, 0.8, 0.8 );
#endif
    }

    void red() {
#ifdef GL
	switch (mode) {
	case COLOUR: glColor3f( 1, 0, 0 ); break;
	case GREY: glColor3f( .6, .6, .6 ); break;
	case MONO: glColor3f( 0, 0, 0 ); break;
	}
#endif
    }

    void green() {
#ifdef GL
	switch (mode) {
	case COLOUR: glColor3f( 0, 1, 0 ); break;
	case GREY: glColor3f( .3, .3, .3 ); break;
	case MONO: glColor3f( 0, 0, 0 ); break;
	}
#endif
    }

    void blue() {
#ifdef GL
	switch (mode) {
	case COLOUR: glColor3f( 0, 0, 1 ); break;
	case GREY: glColor3f( .1, .1, .1 ); break;
	case MONO: glColor3f( 0, 0, 0 ); break;
	}
#endif
    }

    float elev_width, elev_depth, elev_height; // elevator dimensions
    float elev_sep;                    // separation between adjacent elevators
    float person_width, person_height; // person dimensions
    float person_sep;                  // centre-to-centre distance of persons
    float floor_depth, floor_width;    // floor dimensions
    ColourMode mode;
};

#endif
