Addded particle engine but it is not finnished yet its some configuration left

This commit is contained in:
Ziver Koc 2007-03-21 19:02:53 +00:00
parent 01af69cbc8
commit 7c8dba70d1
10 changed files with 577 additions and 33 deletions

View file

@ -73,6 +73,15 @@ public class Texture {
setWidth();
}
/**
* Get the target of the buffer
*
* @return The target of the buffer
*/
public int getGLTarget() {
return target;
}
/**
* Get the height of the original image
*

View file

@ -23,6 +23,8 @@ import javax.imageio.ImageIO;
import org.lwjgl.opengl.GL11;
import ei.engine.util.MultiPrintStream;
/**
* A utility class to load textures for lwjgl. This source is based
* on a texture that can be found in the Java Gaming (www.javagaming.org)
@ -88,18 +90,25 @@ public class TextureLoader {
* @return The loaded texture
* @throws IOException Indicates a failure to access the resource
*/
public Texture getTexture(String resourceName) throws IOException {
public Texture getTexture(String resourceName){
MultiPrintStream.out.println("Loading texture: "+resourceName);
Texture tex = (Texture) table.get(resourceName);
if (tex != null) {
return tex;
}
tex = getTexture(resourceName,
GL11.GL_TEXTURE_2D, // target
GL11.GL_RGBA, // dst pixel format
GL11.GL_LINEAR, // min filter (unused)
GL11.GL_LINEAR);
try {
tex = getTexture(resourceName,
GL11.GL_TEXTURE_2D, // target
GL11.GL_RGBA, // dst pixel format
GL11.GL_LINEAR, // min filter (unused)
GL11.GL_LINEAR);
} catch (IOException e) {
MultiPrintStream.out.println("Unable to load texture: "+resourceName);
MultiPrintStream.out.println(e);
e.printStackTrace();
}
table.put(resourceName,tex);