I Keep Getting this when trying to load a texture from "/res/texBrick.png":
Exception in thread "Thread-0" java.lang.IllegalArgumentException: input == null!
at javax.imageio.ImageIO.read(Unknown Source)
at com.palo.verde.tut.lwjgl.basic.Main.loadTexture(Main.java:127)
at com.palo.verde.tut.lwjgl.basic.Main.initVar(Main.java:120)
at com.palo.verde.tut.lwjgl.basic.Main.run(Main.java:37)
at java.lang.Thread.run(Unknown Source)
Here is texture load code:
private int loadTexture(String string) {
int tex;
BufferedImage img = null;
try {
img = ImageIO.read(Main.class.getResourceAsStream(string));
} catch (IOException e) {
e.printStackTrace();
return 0;
}
int imgWidth = img.getWidth();
int imgHeight = img.getHeight();
// ...
}
This is really weird, considering in the video I was following it worked! Any Help would be appreciated.