//
// $Id: Texture.h,v 1.1 2003/07/24 20:00:30 sarfata Exp $
//
// Copyright vNET Project <vnet@vnet-project.org>
//
// 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; see the file COPYING.  If not, write to:
//   The Free Software Foundation, Inc.
//   59 Temple Place, Suite 330
//   Boston, MA 02111 USA
//


#ifndef __TEXTURE_H__
#define __TEXTURE_H__

#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <string>
#include <list>
#include "3d/vec.h"

namespace V3d
{
  class Texture;

  class Texture
  {
  protected:
    std::string filename;
    unsigned char* data;
    int bpp;
    int width;
    int height;
    GLenum format; // GL_RGB | GL_RGBA
    //static std::list<Texture* > textures_list;
    GLuint texname;
    GLint texwrap;
    GLint texfilter;
    bool mipmapping;
    void load(const std::string );
  public:
    Texture(const std::string filename,GLint texwrap,GLint texfilter,bool mipmapping);
    ~Texture();
    int getWidth(void){return width;};
    int getHeight(void){return height;};
    void use();   
  };
}
#endif