Added fade effect

This commit is contained in:
Ziver Koc 2007-04-08 15:57:10 +00:00
parent 793b3a99da
commit e3b9e3165a
16 changed files with 345 additions and 3 deletions

View file

@ -2,6 +2,8 @@ package ei.engine.texture;
import org.lwjgl.opengl.GL11;
import ei.engine.math.Vector4f;
/**
* A texture to be bound within JOGL. This object is responsible for
* keeping track of a given OpenGL texture and for calculating the
@ -14,6 +16,7 @@ import org.lwjgl.opengl.GL11;
*
* @author Kevin Glass
* @author Brian Matzon
* @author Ziver Koc
*/
public class Texture {
/** The GL target type */
@ -32,6 +35,8 @@ public class Texture {
private float widthRatio;
/** The ratio of the height of the image to the texture */
private float heightRatio;
/** The color and alpha of this texture */
private Vector4f color;
/**
* Create a empty texture
@ -40,6 +45,7 @@ public class Texture {
public Texture(){
this.target = -1;
this.textureID = -1;
color = new Vector4f(1,1,1,1);
}
/**
@ -51,6 +57,25 @@ public class Texture {
public Texture(int target,int textureID) {
this.target = target;
this.textureID = textureID;
color = new Vector4f(1,1,1,1);
}
/**
* Set the color of this texture
*
* @param v The color of this texture
*/
public void setColor(Vector4f v){
color = v;
}
/**
* Get the color of this texture
*
* @return The color of this texture
*/
public Vector4f getColor(){
return color;
}
/**
@ -60,7 +85,7 @@ public class Texture {
*/
public void bindGL() {
GL11.glBindTexture(target, textureID);
GL11.glColor3f(1,1,1);
GL11.glColor4f(color.getR(),color.getG(),color.getB(),color.getA());
}
/**