LWJGL 3 Shader Problems...[SOLVED]

Started by Wolfman13, October 30, 2018, 11:00:08

Previous topic - Next topic

Wolfman13

I'm working through the "3D game development with lwjgl" book by Antonio Hernández Bejarano. I'm stuck at chapter 4(Rendering). I followed along with the source code but I keep getting this error message:
/home/*username*/jdk1.8.0_181/bin/java ...
java.lang.NullPointerException: source
    at java.util.Objects.requireNonNull(Objects.java:228)
    at java.util.Scanner.<init>(Scanner.java:578)
    at main.java.org.lwjglb.engine.Utils.loadResources(Utils.java:11)
    at main.java.org.lwjglb.game.Renderer.init(Renderer.java:26)
    at main.java.org.lwjglb.game.DummyGame.init(DummyGame.java:22)
    at main.java.org.lwjglb.engine.GameEngine.init(GameEngine.java:50)
    at main.java.org.lwjglb.engine.GameEngine.run(GameEngine.java:38)
    at java.lang.Thread.run(Thread.java:748)

Process finished with exit code 0

I also tried the "lwjgl3-demos-master" , and I also got a NullPointerException. I'm using IntelliJ IDEA Community 2018.2, LWJGL Release 3.2.0 and I'm programming on Linux Ubuntu 18.10

KaiHH

Quote from: Wolfman13 on October 30, 2018, 11:00:08
I also tried the "lwjgl3-demos-master" , and I also got a NullPointerException.
You tried what exactly and were getting a NPE where exactly with what exact stacktrace?

Make sure to actually import the project as a Maven project!
You are likely missing the res/ folder as a classpath resource root, so that at runtime the ClassLoader cannot find the shader/texture/etc. resources in the classpath.

Wolfman13

Yes I imported as maven project and the shader programs were in the resource folder. :'(