LWJGL Forum
Programming => LWJGL Documentation => Topic started by: iamcreasy on May 22, 2018, 05:10:05
-
Hello. In the getting started tutorial available here : https://www.lwjgl.org/guide
Line 50 is the following,
if ( window == NULL )
But the variable window is declared as a primitive long in Line 17,
private long window;
A primitive long can never be null. So is this a mistake in line 50?
-
-
NULL is not null. NULL instead is defined as a static field whose type is long and value is 0. It should resemble http://en.cppreference.com/w/cpp/types/NULL
-
Oh I see. Thank you. It's a bit confusing though.
-
For a Java developer, maybe. But it shows that LWJGL also tries to attract C/C++ developers to the JVM platform by making it easy to adapt the vast amounts of familiar C/C++ OpenGL/GLFW examples/tutorials to the JVM/Java. It is (almost) really only copy and paste.
-
Hmm, didn't think of it in that way. Interesting observation. Thank you.