jme-lwjgl3: config GLFW using AppSettings and org.lwjgl.system.Platform#1779
jme-lwjgl3: config GLFW using AppSettings and org.lwjgl.system.Platform#1779stephengold wants to merge 1 commit intomasterfrom
Conversation
| I think it would be better to set Configuration.GLFW_LIBRARY_NAME only if the libraryName != null or platform == MACOS, so that the default becomes whatever LWJGL3 think the default is (except on macos). |
| I'm converting this to a draft PR both because of the suggestion from @riccardobl and also because I'm unsure the best place to set "glfw_async". |
| This PR is still on hold because I've been investigating issues with "glfw_async". I'm convinced it's unreliable in LWJGL v3.3.1, causing certain apps to crash (in a highly reproducible fashion) with "BUG IN CLIENT OF LIBDISPATCH: dispatch_sync called on queue already owned by current thread". The same apps work OK with ordinary "glfw" and -XstartOnFirstThread. When I have time, I hope to create a compact test case to send to the LWJGL and/or GLFW folks. |
This a step toward allowing JME applications developed for Linux/Windows to run on macOS without any changes. Since LWJGL v2, doesn't support the newer "Apple Silicon" hardware, the focus is on LWJGL v3. For portability, we want to use the "glfw_async" library (added in LWJGL v3.3.1) when running on macOS. To reduce the risk of regressions, we'll use the old library when running on other operating systems.
For extra flexibility, a new
AppSettingnamed "GlfwLibraryName" specifies which library to use: "glfw" or "glfw_async". If this setting is unset or null,org.lwjgl.system.Platformis used to determine which library to use.