Im having problems with reading form files using getResourceAsStream(). I understadnd that the problem is the address i give it, so it get nullpointer all the time, but i dont understand why.
i give it C:/Users/Marko/git/Over-The-Galaxy/src/shader.frag i have tried everything in between and i still get the error.
[quote]java.lang.NullPointerException
at java.io.Reader.(Unknown Source)
at java.io.InputStreamReader.(Unknown Source)
at test.OBJloader.ShaderProgram.readFromFile(ShaderProgram.java:82)
at test.OBJloader.ShaderProgram.attachFragmentShader(ShaderProgram.java:35)
at test.OBJloader.Model.prepareVBO(Model.java:300)
at test.OBJloader.OBJLoader.loadModel(OBJLoader.java:71)
at controller.Controller.(Controller.java:52)
at controller.Controller.main(Controller.java:110)
[/quote]
What kind of address does it want?
BufferedReader reader = new BufferedReader(new InputStreamReader(
ShaderProgram.class.getClassLoader()
.getResourceAsStream(name)));