/***************************************************************************
 *            textures.h
 *
 *  Thu Dec  1 17:46:28 2005
 *  Copyright  2005  Joe Venzon
 *  joe@venzon.net
 ****************************************************************************/

/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
 
#ifndef _TEXTURES_H

#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glext.h>
#include <SDL/SDL.h>
#ifdef __APPLE__
#include <SDL_image/SDL_image.h>
#else
#include <SDL/SDL_image.h>
#endif
#include <math.h>
#include <string>
#include <fstream>
#include <iostream>

#include "utility.h"

#include "globals.h"

using namespace std;

class TEXTURENODE
{
public:
	TEXTURENODE();
	~TEXTURENODE();
	bool loaded;
	string texfile;
	GLuint texid;
	bool mipmap;
	TEXTURENODE * next;
};

class TEXTURES
{
private:
	TEXTURENODE * texnodes;
	
public:
	TEXTURES();
	~TEXTURES();
	void DeleteAll();
	GLuint Load(string newtexfile) {return Load(newtexfile, true);}
	GLuint Load(string newtexfile, bool mipmap) {int w,h; return Load(newtexfile, mipmap, w, h);}
	GLuint Load(string newtexfile, bool mipmap, int &w, int &h);
	
	void ReloadAll();
};

#define _TEXTURES_H
#endif /* _TEXTURES_H */
