Package org.lwjgl.glfw


@NonnullDefault package org.lwjgl.glfw
Contains bindings to the GLFW library.

GLFW comes with extensive documentation, which you can read online here. The Frequently Asked Questions are also useful.

Using GLFW on macOS

On macOS the JVM must be started with the -XstartOnFirstThread argument for GLFW to work. This is necessary because most GLFW functions must be called on the main thread and the Cocoa API requires that thread to be the first thread in the process. GLFW windows and the GLFW event loop are incompatible with other window toolkits (such as AWT/Swing or JavaFX).

Applications that cannot function with the above limitation may set GLFW_LIBRARY_NAME to the value "glfw_async". This will instruct LWJGL to load an alternative GLFW build that dispatches Cocoa calls to the main thread in blocking mode. The other window toolkit must be initialized (e.g. with AWT's Toolkit.getDefaultToolkit()) before Init is called.