Hi, we decided to switch our game from LWJGL2 to LWJGL3. Let me share some experiences, and start a little bit of discussion: We tried on Windows 10 and Mac OS-X.
- We needed a jre with Version greater than 1.8. Adopt Open JDK 11 worked well.
- On Windows, it was not a too big issue. Mainly, you have to substitute everything with Display. The Migration guide helped: 2.6.6 LWJGL3 migration · LWJGL/lwjgl3-wiki Wiki · GitHub
- Now to Mac-OSX:
3.1 Take care to have only one thread until the game starts, and avoid everything with awt, swing etc.
3.2. Use the option -XstartOnFirstThread. In eclipse there is in addition a checkbox for this. I needed both.
3.3 Do not call GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice() to get the available fullscreen modes
3.4 Do not use the OSX adapter settings to define the behavior of the OS-X menus.
3.5 Do not use Toolkit.getDefaultToolkit().getScreenSize() to find out the screen size
3.6 Do not use settings.setIcons(…) for the AppSettings
These were the pitfalls where we searched quite long …
Now some points for discussion, maybe somebody can help. Everything for Mac OS-X:
- How to set the the menus in the OSX adapter. It is not possible before the game starts, and in the game, the calls (also in a separate thread) freezed the game.
- How to obtain the screensize of the monitor? The Toolkit things do not work during the game.
- How to obtain the available fullscreen display modes? 3.3. from above does not work also during the game run, we also tried in a different thread.