Hello Guest

LWJGL 3 Shader Problems...[SOLVED]

  • 2 Replies
  • 175 Views
LWJGL 3 Shader Problems...[SOLVED]
« on: October 30, 2018, 11:00:08 »
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
« Last Edit: November 07, 2018, 21:44:00 by Wolfman13 »

*

Offline KaiHH

  • ***
  • 149
Re: LWJGL 3 Shader Problems...
« Reply #1 on: October 30, 2018, 11:04:47 »
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.

Re: LWJGL 3 Shader Problems...
« Reply #2 on: October 31, 2018, 15:02:29 »
Yes I imported as maven project and the shader programs were in the resource folder. :'(