/*********************************************************************
*                                                                    *          
*                              FLY                                   *
*                           --E#Y#E--				     *
*                         ===MUSCLE===                               *
*                                                                    *
*********************************************************************/
#ifndef OPENGL_H_
#define OPENGL_H_

/* C++ Header Files */
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <fstream>
#include <iostream>
#include <vector>
#include <ctime>
#include <cmath>
#include <cassert>
#include <limits>
/* OpenGL */
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glx.h>
#include <GL/glu.h>
#include <GL/glext.h>
#include <GL/glxext.h>
/* Flysimulator */
#include "../WIN/win.h"
#include "../TEX/targa.h"
#include "../TEX/texture.h"
#include "../CONF/config.h"
#include "../CONF/uniform.h"
#include "../CONF/geometry.h"
#include "../FONT/font.h"
#include "../OGL/move.h"
#include "../OGL/cube.h"
#include "../OGL/flybox.h"
#include "../OGL/cockpit.h"

//---------------------------------------------------------------------------

/* Standard */
using namespace std;

using std::vector;
using std::string;
using std::ifstream;
using std::map;

//---------------------------------------------------------------------------

/* Class FLY */
class FLY
{
private:       
        struct F_Color {
                float fr, fg, fb, fa;
        };

        struct F_Textur {
                float fs, ft;
        };

        struct F_Vertex {
                float fx, fy, fz;
        };

public:	
	/* Init */
        void loadTexture();
        void glewStatus();
        bool textureShader3();
        bool initMain();
	bool initGrid();
	
	/* Coordinates */
	float F_Vertex(float fx, float fy, float fz);
	float F_Color(float fr, float fg, float fb, float fa);
	float F_Textur(float fs, float ft);
	
	/* Render */
	void GridRender(const char *nFile);
	void PolygonCircle(const GLenum mode, const GLenum front, const char *nFile);
        void DrawCircle(const GLenum mode, const GLenum front, const GLint count, const GLint offset);
        
        /* Image */
        void SubImage(const GLint count, const char *nFile, GLubyte *pixel);
	
        /* Move */
        void pointSpeed(float dt);
        void pointGrid(float dt);
        
        /* Objects */
        void vectorObjects();
        void polygonObjects(); 
        void textureObjects(); 
        void vertexObjects(); 
        void renderObjects(); 
	void Landscape(int width, int height);
	
        /* Cupe Map */
        void CubeMap();
	
	/* Process Event */
	void process_event1(XEvent report);
};

//---------------------------------------------------------------------------

#endif

