package JautOGL;
import javax.media.opengl.*;
import javax.media.opengl.glu.*;
import java.awt.image.BufferedImage;
import java.nio.ByteBuffer;

public class Texture{
   
   private String name;
   protected int width, height;
   protected int textureID;

   //protected BufferedImage bufferedImage;
   protected int target;
   protected int srcPixelFormat;
   protected int dstPixelFormat;
   protected int minFilter;
   protected int magFilter;
   protected boolean wrap;
   protected boolean mipmapped;
   protected ByteBuffer pixels;

   public Texture( String name, int target, int srcPixelFormat,
                         int dstPixelFormat, int minFilter, int magFilter,
                  		 boolean wrap, boolean mipmapped){
           
           this.name = name;
           this.target = target;
           this.srcPixelFormat = srcPixelFormat;
           this.dstPixelFormat = dstPixelFormat;
           this.minFilter = minFilter;
           this.magFilter = magFilter;
           this.wrap = wrap;
       this.mipmapped = mipmapped;
   }

   public String getName(){
          return name;
   }

   public void setName(String name){
         this.name = name;
   }
/*
   public BufferedImage getBufferedImage(){
       return bufferedImage;
   }

   public void setBufferedImage(BufferedImage bufferedImage){
       this.bufferedImage = bufferedImage;
   }
*/
   public ByteBuffer getPixels(){
       return pixels;
   }

   public void setPixels(ByteBuffer pixels){
       this.pixels = pixels;
   }
   public int getWidth(){
         return width;
   }

   public void setWidth(int width){
         this.width = width;
   }

   public int getHeight(){
         return height;
   }

   public void setHeight(int height){
         this.height = height;
   }

   public int getTextureID(){
         return textureID;
   }

   public void setTextureID(int textureID){
         this.textureID = textureID;
   }

   public int getTarget(){
        return target;
   }

   public void setTarget(int target){
        this.target = target;
   }

   public int getSrcPixelFormat(){
        return srcPixelFormat;
   }

   public void setSrcPixelFormat(int srcPixelFormat){
         this.srcPixelFormat = srcPixelFormat;
   }

   public int getDstPixelFormat(){
         return dstPixelFormat;
   }

   public void setDstPixelFormat(int dstPixelFormat){
         this.dstPixelFormat = dstPixelFormat;
   }

   public int getMinFilter(){
         return minFilter;
   }

   public void setMinFilter(int minFilter){
         this.minFilter = minFilter;
   }

   public int getMagFilter(){
         return magFilter;
   }

   public void setMagFilter(int magFilter){
         this.magFilter = magFilter;
   }

   public boolean isWrap(){
         return wrap;
   }

   public void setWrap(boolean wrap){
        this.wrap = wrap;
   }

   public boolean isMipmapped(){
      return mipmapped;
   }

   public void setMipmapped(boolean mipmapped){
       this.mipmapped = mipmapped;
   }

    protected void bind( GL gl ){
    	
           gl.glBindTexture( target, textureID );
     }

}