/**********************************************************************
   File:     CGWorld.h
   Author:   Dr. Dalton R. Hunkins    
   Date:     February 2009     
**********************************************************************/

#ifndef _CGWORLD_H
#define _CGWORLD_H

#include <GL/Utils/ImageMap.h>
#include <GL/Utils/Coordinates.h>
#include <GL/Utils/RGB.h>
#include <GL/Utils/HSV.h>

#define MODULATE 1
#define DECAL    2
#define NONE     3

class CGWorld { 
  public:

    CGWorld();
  
    void createSubWindow(int parentHandle,
                    int parentWidth, int parentHeight,
                    int startX,      int startY,
                    int width,        int height);

   void init(float clearColor[]); 
   
   void display();
   
   void setRed(float red);
   void setGreen(float green);
   void setBlue(float blue);
   void setTextureMethod(int which);
   void setLightingMode(bool state);
   void setImageMap(string directory, string fileName);
   
   int getWindowHandle();
   
   int getCornerX();
   int getCornerY();
   int getWidth();
   int getHeight();
   
private:
    static const int numberOfSquares = 18;
    static const float sizeOfSquare  = 0.2;
    
    int windowHandle;
    int cornerX;
    int cornerY;
    int width;
    int height;

    int  textureChoice;
    bool enableLighting;
    
	float lightColor[3];
	float materialColor[4];
	
	ImageMap *imageMap;
	GLuint textureName[1];

    void setLighting();
    void drawCylinder();
    
    void xzSquare(int which);
    void xzRow(int first, int second); 
    void drawBoard();
    
    RGB rgbSquare[3];
	    
};

#endif