//Source de l'interface

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

#include <stdio.h>
#include <stdlib.h>
#include <vector>

using namespace std;

#include "Moteur.h"
#include "Interface.h"

CInterface::CInterface()
{
	
}

CInterface::~CInterface()
{
	
}

void CInterface::LoadInterface()
{
	TexBarreVie = Moteur.NouvelleTexture("./Images/Interface/barrevie.png");
	TexBarreMana = Moteur.NouvelleTexture("./Images/Interface/barremana.png");
	TexInterface = Moteur.NouvelleTexture("./Images/Interface/interface.png");
}

void CInterface::DessineInterface(int Vie, int VieMax, int Mana, int ManaMax)
{
 	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity(); 
 	 

	Moteur.AfficheTexture(TexBarreVie, 8, 8, (int)200*Vie/VieMax, 13);
	Moteur.AfficheTexture(TexBarreMana, 8, 30, (int)200*Mana/ManaMax, 13);
	Moteur.AfficheTexture(TexInterface, 0, 0, 300, 50);
	char temp[5];
	sprintf(temp, "%d", Vie);
	Moteur.DessineTexte(0, temp, 12, 220, 8, 0, 165, 8);
	sprintf(temp, "%d", Mana);
	Moteur.DessineTexte(0, temp, 12, 220, 31, 0, 165, 8);
	 //TexInterface;
}


