Package org.lwjgl.glfw
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.
Resources
-
ClassDescriptionUtility class for GLFW callbacks.Contains the function pointers loaded from the glfw
SharedLibrary
.Callback function:GLFWallocatefun
Callback function:GLFWallocatefun
struct GLFWallocator { {@link GLFWAllocateCallbackI GLFWallocatefun} allocate; {@link GLFWReallocateCallbackI GLFWreallocatefun} reallocate; {@link GLFWDeallocateCallbackI GLFWdeallocatefun} deallocate; void * user; }
An array ofGLFWAllocator
structs.Callback function:GLFWcharfun
Callback function:GLFWcharfun
Callback function:GLFWcharmodsfun
Callback function:GLFWcharmodsfun
Callback function:GLFWcursorenterfun
Callback function:GLFWcursorenterfun
Callback function:GLFWcursorposfun
Callback function:GLFWcursorposfun
Callback function:GLFWdeallocatefun
Callback function:GLFWdeallocatefun
Callback function:GLFWdropfun
Callback function:GLFWdropfun
Callback function:GLFWerrorfun
Callback function:GLFWerrorfun
Callback function:GLFWframebuffersizefun
Callback function:GLFWframebuffersizefun
struct GLFWgamepadstate { unsigned char buttons[15]; float axes[6]; }
An array ofGLFWGamepadState
structs.struct GLFWgammaramp { unsigned short * red; unsigned short * green; unsigned short * blue; unsigned int size; }
An array ofGLFWGammaRamp
structs.struct GLFWimage { int width; int height; unsigned char * pixels; }
An array ofGLFWImage
structs.Callback function:GLFWimestatusfun
Callback function:GLFWimestatusfun
Callback function:GLFWjoystickfun
Callback function:GLFWjoystickfun
Callback function:GLFWkeyfun
Callback function:GLFWkeyfun
Callback function:GLFWmonitorfun
Callback function:GLFWmonitorfun
Callback function:GLFWmousebuttonfun
Callback function:GLFWmousebuttonfun
Contains the function pointers loaded fromGLFW.getLibrary()
.Contains the function pointers loaded fromGLFW.getLibrary()
.Contains the function pointers loaded fromGLFW.getLibrary()
.Contains the function pointers loaded fromGLFW.getLibrary()
.Contains the function pointers loaded fromGLFW.getLibrary()
.Contains the function pointers loaded fromGLFW.getLibrary()
.Contains the function pointers loaded fromGLFW.getLibrary()
.Contains the function pointers loaded fromGLFW.getLibrary()
.Contains the function pointers loaded fromGLFW.getLibrary()
.Callback function:GLFWpreeditfun
Callback function:GLFWpreeditfun
Callback function:GLFWpreeditcandidatefun
Callback function:GLFWpreeditcandidatefun
Callback function:GLFWreallocatefun
Callback function:GLFWreallocatefun
Callback function:GLFWscrollfun
Callback function:GLFWscrollfun
struct GLFWvidmode { int width; int height; int redBits; int greenBits; int blueBits; int refreshRate; }
An array ofGLFWVidMode
structs.Contains the function pointers loaded fromGLFW.getLibrary()
.Callback function:GLFWwindowclosefun
Callback function:GLFWwindowclosefun
Callback function:GLFWwindowcontentscalefun
Callback function:GLFWwindowcontentscalefun
Callback function:GLFWwindowfocusfun
Callback function:GLFWwindowfocusfun
Callback function:GLFWwindowiconifyfun
Callback function:GLFWwindowiconifyfun
Callback function:GLFWwindowmaximizefun
Callback function:GLFWwindowmaximizefun
Callback function:GLFWwindowposfun
Callback function:GLFWwindowposfun
Callback function:GLFWwindowrefreshfun
Callback function:GLFWwindowrefreshfun
Callback function:GLFWwindowsizefun
Callback function:GLFWwindowsizefun