I can't figure out how to load textures in a 2d environment using lwjgl.
I'm using their tutorial's Sprite, Texture and TextureLoader classes. I've simply replaced the original paths/files with my own, which I've checked to make sure are correct about 20 times. Here's the code, and the error it produces.
public Sprite(TextureLoader loader, String ref) {
try
{
texture = loader.getTexture("C:/Users/John/workspace/MyGames/sprites/" + ref);
width = texture.getImageWidth();
height = texture.getImageHeight();
}
catch (IOException ioe)
{
ioe.printStackTrace();
System.exit(-1);
}
}
java.io.IOException: Cannot find: C:/Users/John/workspace/MyGames/sprites/ship.gif
What am I doing wrong?
Edit: When I try to run the lwgjl space invaders game on its own with no modifications I get the same problem. I have all the files in the correct path and have checked that the paths exist within the call.