/*====================ÉCOLE POLYTECHNIQUE DE MONTRÉAL============================

	NOM DU FICHIER :CPngTexture.h

	DESCRIPTION :	Classe qui gère les fichiers .PNG des textures

	AUTEUR : Martin Bisson, Anne-Marie Buki, Mylene Denis & Jean-Francois Pérusse

	DATE DE CRÉATION : 2004-3-16

	MISES À JOUR :

===============================================================================*/
#ifndef CPNGTEXTURE_H
#define CPNGTEXTURE_H

typedef struct {
	unsigned int Width;
	unsigned int Height;
	unsigned int Depth;
	unsigned int Alpha;
} MyPngInfo;

typedef struct {
	unsigned int Width;
	unsigned int Height;
	unsigned int Depth;
	unsigned int Alpha;

	unsigned int Components;
	unsigned char *Data;
	unsigned char *Palette;
} MyPngRawInfo;

class CPngTexture
{
    unsigned int ID;
	MyPngInfo		Info;
	MyPngRawInfo	RawInfo;
public:

	CPngTexture();
	~CPngTexture();
	int GetID() {return ID;}
	int GetWidth() {return RawInfo.Width;}
	int GetHeight() {return RawInfo.Height;}
	MyPngRawInfo GetRawInfo() {return RawInfo;}
	void UpdateData(unsigned char *data);

	int LoadPNG(const char* FileName, int Mipmap = 0, int Transparency = -2, int TextureWrap = 0x2900, int MagFilterParam = 0x2601, int MinFilterParam = 0x2601);
	void Unload();
};

#endif
