Why I'm stuck on 2.9.3

I've been writing software using the LWJGL libraries since around 2013. A few years back, I wanted to upgrade the libraries to use the latest 3.x version. I spent several days swapping out libraries and converting my code to use GLFW windowing. Eventually, nothing would work, so I gave up and switched to the most recenter version of LWJGL2, which was version 2.9.3. I've been stuck here for years.

If you had asked me at the time if I'd recommend LWJGL v3 to a friend, I'd say "Absolutely not!" Why? Well, I don't want my friends to hate me.

A few days ago, I had some extra vacation time, and decided to give LWJGL3 one more try. Surely, most of the early transition phase issues have been resolved, and hopefully the documentation makes it easier to integrate the libraries. But this time, I'd avoid the pain of converting a large existing program, and would instead try working from the ground up. Let's try the basic tutorial and get the libraries to do something... anything... How hard could it be?

I downloaded the stable release version (3.2.2) and started to do a Grade build using Eclipse as the IDE. The documentation make it sound easy to set up a <lwjgl3> library, but with nearly 37 separate libraries, doing that without error is a daunting task. After a couple of fruitless wasted hours, I decided to hand configure a build space. To minimize issues, I elected to get the simple HelloWorld program running without the use of Grade. I'd also use a shell script to ensure that the library setup was simple and correct for both the class path and load libraries.

The first program is the one posted on the 'Get Started' tab. Hey, I've been writing OpenGL code since the '90s, so this simple example should help wring out issues setting up libraries. Alas, no such luck. Hour after hour was spent trying to isolate why a built program wouldn't compile or execute. I remember first learning OpenGL on C/C++, and it was an outright breeze compared to this. I've even considered that it might be easier to just switch languages, at least my code would run faster.

So here I am on day two. I started keeping a journal of all the problems that I ran into and the eventual solutions. Each program solved caused yet-another to be revealed. I've cracked open jar files, scrubbed through .dylibs and done a ton of other work to diagnose where things have gone wrong.

Version 3 has way too many libraries. Version 2.x had a half dozen or so, but dealing with 37 is a bit extreme. I believe that the following set should get the demo code working:

OK, this last ditch attempt at getting LWJGL3 to run has turned into a bust. Lots of time was spent documenting issues with library internals and loading errors. I've wasted an entire long weekend with not even a single polygon or window display to show for it.

If the code had ever started to work, I was planning on uploading the entire folder for others to try. Perhaps a simple working example, even of the most basic form, would be useful in diagnosing issues and ensuring that the libraries could even do the most basic of tasks.

It looks like I'm back to 2.9.3. Stuck again. Maybe 3.3.x or 4.x will be better. Maybe next year will bring better luck.

Yeh, there are a lot of jars, however most will not need need to use them all.

Personally, if using eclipse and wanting to run a simple first test, i'd do the following:

1) Go to the LWJGL customize download page.2) Grab the 'Minimal OpenGL' zip bundle (untick the source and javadoc jars to reduce number of jars).3) Create a new eclipse project and add all the jars to the build path (in LWJGL3 you don't need to extract the natives from the jars like with LWJGL2).4) If on mac, you must set the VM argument -XstartOnFirstThread5) The sample code from https://www.lwjgl.org/guide should now just work (you shouldn't have to do more than the above to get it to work).

I'm sorry to hear about your experience, but it sounds like you tried random solutions without doing any research. I'm not suggesting anything difficult, LWJGL doesn't exist in a void, there's the website, the source in the github repository, README files, open & closed issues, the forum, javadoc. Actually, the amount of documentation in LWJGL is ridiculous, there's so much more documentation than code.

Or you could simply have asked before wasting time. That's why we have the forum, the Slack team, the Twitter account.

So, here are some simple instructions for running the HelloWorld sample code:

1. Go to https://www.lwjgl.org/customize and download LWJGL. You don't need "37 libraries", you need just 3: core, GLFW, OpenGL.2. Extract the downloaded .zip file to a folder3. Create HelloWorld.java and copy the code.

You don't need a million jars, you don't have to list them one-by-one, you don't have to mess with the library path. A lot of effort has been spent on making this possible and I don't know what could possibly be simpler than the above, given what LWJGL is and what it does.

A few more comments, so that you don't waste more time:

- Eclipse has trouble with Java modules. Every user that has tried to use LWJGL as modules with Eclipse has failed. This is not a problem with LWJGL, which is correctly configured as explicit modules and works fine in every other IDE or cli environment. As a workaround, ignoring modules and putting LWJGL in the classpath will work fine.- GLFW requires that most of its functions are called from the main thread. On macOS, that thread must also be the first thread in the process (that's why -XstartOnMainThread is needed). This is not a problem with LWJGL and not a problem with GLFW, it's how macOS works.- When getting started, it's highly recommended to use https://github.com/LWJGLX/debug. If you're doing something obviously wrong, it will tell you immediately.

I'm finishing off a port from 2.9.3 to 3.2.2 because 2.9.3 is completely dead for me (Ubuntu J11).The event handling and startup code were major work, but fairly painless. Oh, I did lose fullscreen mode and mouse capture, which I haven't figured out.The loss of Slick was problematic; rewriting the texture handling was easy but the bulk of my time was spent figuring out font handling. Bleh.

Just getting all the jars bootstrapped was an adventure. Normally, I like to maven/gradle everything from mvnrepository.com. However, the natives aren't up there, they require downloading and manually dropping in, so why not just download all of lwjgl to ensure matched versions.I think the eclipse page could use some updating. What works for me is to create a ${projectroot}/lwjgl directory and put the 27 jars I want in there.Then I created an LWJGL user library with the build/runtime jars in there. Then I could attach the *-sources.jar to each jar to get useful development info out of lwjgl.

A lot of the tutorials are based on 2.9.x, including the front lwjgl wiki page, so that can be confusing and not helpful.

Normally, I like to maven/gradle everything from mvnrepository.com. However, the natives aren't up there, they require downloading and manually dropping in, so why not just download all of lwjgl to ensure matched versions.

It's a bit more than that, isn't it? You also need the -natives-os.jar(s) to go with the "just 3", yes?

My point is you simply need to choose the bindings you're interested in. You get all necessary files in a single .zip file, you extract it and are ready to go. There are more files in there anyway (licenses, sources, javadoc, etc.).

4) I finished my upgrade from 2.9.3 to 3.2.2. Interesting that it's different. I would think the underlying opengl library would be the same, and it would be the same. On one machine (GTX 1080) the color transitions, and fades are subtle and just brilliant and runs a solid 60 fps.My dev box, (i7 with onboard GT 625) is not a game machine. But it plays videos at 1920x1200 just fine and Minecraft runs at 30-22 fps. Acceptable for what it is.My game however, with 2.9.3 runs at 60 fps slowing to 40 with decent busyness on the screen. Acceptable. But 3.2.2 quickly drops to 20 fps, (which I think is optimistic ), and playing against humans becomes impossible. I guess if I'm going to continue this game stuff I need a new power supply.

It's the same reason that you don't see the javadoc and sources jars there. The web interface of repo1.maven.org simply only displays the artifacts with classifier 'jar' (the default) and not any other classifier, such as javadoc, sources or natives-<OS>.

> in eclipse, one cannot attach source/javadoc to an "External jar or dependency" anywaysIf by that you mean Library dependencies (such as the "Maven Dependencies" library automatically added by Eclipse when importing a Maven project) then this simply is not true. Maven will attach the sources and javadoc jars automatically. See https://i.imgur.com/NVmXvtz.png for a view of my Eclipse build settings of the lwjgl3-demos repository https://github.com/LWJGL/lwjgl3-demos which was fully automatically set up in Eclipse when choosing Import Maven Project in Eclipse, with sources and javadocs attached completely automatically. You do not have to do ANYTHING (such as downloading zips, jars or anything) manually.All you need to do is go to lwjgl.org/customize and select Maven and the artifacts you need and paste the resulting pom.xml snippet into your pom.xml.

There simply is no easier way to setup an LWJGL3 project than to use Maven/Gradle. Literally!Probably hundreds of people have managed to setup LWJGL3 in their Maven project, and so can you!