#include <SDL/SDL.h>
#include <SDL/SDL_opengl.h>
#include <GL/gl.h>
#include <GL/glu.h>

#include <stdio.h>
#include <stdlib.h>
#include <stdexcept>
#include <string>
#include <vector>
#include <time.h>
#include <iostream>

using namespace std;

#include "Moteur.h"
#include "PersoPrincipal.h"
#include "Map.h"
#include "Interface.h"
#include "Sorts.h"

#include "main.h"
#include "Intro.h"
#include "Menu.h"
#include "RenderJeu.h"

#define TITRE "The Paradize Battle : Angel VS Evil"


int main(int argc, char *argv[])
{
	
	srand(time(NULL));
	
	//if(Moteur.Init(((rand()/(double)RAND_MAX) > 0.5), TITRE) < 0) return -1;
	if(Moteur.Init(false, TITRE) < 0) return -1;
	
	FonteStandard = Moteur.NouvelleFonte("Standard");
	ImgArrierePlan = Moteur.NouvelleTexture("./Images/ArrierePlanMenu.png");
	ImgMotifArrierePlan = Moteur.NouvelleTexture("./Images/MotifAP.png");
	
	Map.LoadTextures();
	LoadSorts();
	
	PersoPrincipal = Map.LoadMap("Map1.map");
	
	Interface.LoadInterface();

	while(continuer)
	{
		switch(nbRender)
		{
			case RENDER_MENU_PRINCIPAL:
				nbRender = BoucleRenderMenu();
				break;

			case RENDER_JEU:
				nbRender = BoucleRenderJeu();
				break;

			case RENDER_INTRO:
				nbRender = BoucleRenderIntro();
				break;

		}
	}

	SDL_Quit();

	return 0;
}
