#include <GL/glut.h>
#include <cmath>
#include <list>
#include <string>
#include <strstream>
#include <vector>

#include "globale.h"
#include "CVector3.h"
#include "CCamera.h"
#include "Temps.h"
#include "CCube.h"
#include "CBloc.h"
#include "CJeu.h"
#include "AnimDebut.h"
#include "CWinStream.h"

// Globales
short SCREEN_WIDTH;
short SCREEN_HEIGHT;
short CENTRE_X;
short CENTRE_Y;

CCamera gCamera;
CJeu gJeu;
CWinStream wout;




// Fonction qui gère la redimension de la fenêtre

void reshape(int w, int h)
{
	glViewport(0, 0, w - LARGEURTEXTE, h);
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	gluPerspective(50.0, (float) (w - LARGEURTEXTE) / (float) h, 0.1, 10000);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();

	SCREEN_WIDTH = w;
	CENTRE_X = SCREEN_WIDTH >> 1;
	SCREEN_HEIGHT = h;
	CENTRE_Y = SCREEN_HEIGHT >> 1;

	wout.SetToWindow();
}




// Fonction principale du programme: ne fait presque rien

int main(int argc, char** argv)
{
	glutInit(&argc, argv);
	gJeu.Init();

	SetIntroFunc();

	glutReshapeFunc(reshape);

	glutMainLoop();
	
	return 0;
}
