GLFW

- Documentation
- Download
- Community

Release notes

# Release notes for version 3.3

These are the release notes for version 3.3. For a more detailed view including all fixed bugs see the version history.

Please review the caveats, deprecations and removals if your project was written against an earlier version of GLFW 3.

## New features in version 3.3

### Gamepad input via SDL_GameControllerDB

GLFW can now remap game controllers to a standard Xbox-like layout using a built-in copy of SDL_GameControllerDB. Call glfwJoystickIsGamepad to check if a joystick has a mapping, glfwGetGamepadState to retrieve its input state, glfwUpdateGamepadMappings to add newer mappings and glfwGetGamepadName and glfwGetJoystickGUID for mapping related information.

For more information see Gamepad input.

### Support for Vulkan on macOS via MoltenVK

GLFW now supports MoltenVK, a Vulkan implementation on top of the Metal API, and its `VK_MVK_macos_surface` window surface creation extension. MoltenVK is included in the macOS Vulkan SDK.

For more information see Vulkan guide.

### Content scale queries for DPI-aware rendering

GLFW now provides content scales for windows and monitors, i.e. the ratio between their current DPI and the platform's default DPI, with glfwGetWindowContentScale and glfwGetMonitorContentScale.

Changes of the content scale of a window can be received with the window content scale callback, set with glfwSetWindowContentScaleCallback.

The GLFW_SCALE_TO_MONITOR window hint enables automatic resizing of a window by the content scale of the monitor it is placed, on platforms like Windows where this is necessary. This takes effect both on creation and when the window is moved between monitors. It is related to but different from GLFW_COCOA_RETINA_FRAMEBUFFER.

For more information see Window content scale.

### Support for updating window attributes

GLFW now supports changing the GLFW_DECORATED, GLFW_RESIZABLE, GLFW_FLOATING, GLFW_AUTO_ICONIFY and GLFW_FOCUS_ON_SHOW attributes for existing windows with glfwSetWindowAttrib.

For more information see Window attributes.

### Support for raw mouse motion

GLFW now supports raw (unscaled and unaccelerated) mouse motion in disabled cursor mode with the GLFW_RAW_MOUSE_MOTION input mode. Raw mouse motion input is not yet implemented on macOS. Call glfwRawMouseMotionSupported to check if GLFW can provide raw mouse motion on the current system.

For more information see Raw mouse motion.

### Joystick hats

GLFW can now return the state of hats (i.e. POVs or D-pads) of a joystick with glfwGetJoystickHats. For compatibility, hats are also exposed as buttons. This can be disabled with the GLFW_JOYSTICK_HAT_BUTTONS initialization hint.

For more information see Joystick hat states.

### Error query

GLFW now supports querying the last error code for the calling thread and its human-readable description with glfwGetError. This can be used instead of or together with the error callback.

For more information see Error handling.

### Support for initialization hints

GLFW now supports setting library initialization hints with glfwInitHint. These must be set before initialization to take effect. Some of these hints are platform specific but are safe to set on any platform.

For more information see Initialization hints.

### User attention request

GLFW now supports requesting user attention with glfwRequestWindowAttention. Where possible this calls attention to the specified window. On platforms like macOS it calls attention to the whole application.

For more information see Window attention request.

### Window maximization callback

GLFW now supports notifying the application that the window has been maximized glfwSetWindowMaximizeCallback. This is called both when the window was maximized by the user and when it was done with glfwMaximizeWindow.

For more information see Window maximization.

### Query for the monitor work area

GLFW now supports querying the work area of a monitor, i.e. the area not occupied by task bars or global menu bars, with glfwGetMonitorWorkarea. On platforms that lack this concept, the whole area of the monitor is returned.

For more information see Work area.

### Transparent windows and framebuffers

GLFW now supports the creation of windows with transparent framebuffers on systems with desktop compositing enabled with the GLFW_TRANSPARENT_FRAMEBUFFER window hint and attribute. This hint must be set before window creation and leaves any window decorations opaque.

GLFW now also supports whole window transparency with glfwGetWindowOpacity and glfwSetWindowOpacity. This value controls the opacity of the whole window including decorations and unlike framebuffer transparency can be changed at any time after window creation.

For more information see Window transparency.

### Query for the scancode of a key

GLFW now supports querying the platform dependent scancode of any physical key with glfwGetKeyScancode.

For more information see Key input.

### Cursor centering window hint

GLFW now supports controlling whether the cursor is centered over newly created full screen windows with the GLFW_CENTER_CURSOR window hint. It is enabled by default.

### Mouse cursor hover window attribute

GLFW now supports polling whether the cursor is hovering over the window content area with the GLFW_HOVERED window attribute. This attribute corresponds to the cursor enter/leave event.

### Window hint and attribute for input focus on show

GLFW now has the GLFW_FOCUS_ON_SHOW window hint and attribute for controlling whether a window gets input focus when shown. It is enabled by default. It applies both when creating an visible window with glfwCreateWindow and when showing it with glfwShowWindow.

This is a workaround for GLFW 3.0 lacking glfwFocusWindow and will be corrected in the next major version.

For more information see Window visibility.

### Monitor and joystick user pointers

GLFW now supports setting and querying user pointers for connected monitors and joysticks with glfwSetMonitorUserPointer, glfwGetMonitorUserPointer, glfwSetJoystickUserPointer and glfwGetJoystickUserPointer.

For more information see User pointer and Joystick user pointer.

### macOS menu bar from nib file

GLFW will now load a `MainMenu.nib` file if found in the `Contents/Resources` directory of the application bundle, as a way to replace the GLFW menu bar without recompiling GLFW. This behavior can be disabled with the GLFW_COCOA_MENUBAR initialization hint.

### Support for more context creation extensions

The context hint GLFW_SRGB_CAPABLE now supports OpenGL ES via `WGL_EXT_colorspace`, the context hint GLFW_CONTEXT_NO_ERROR now supports `WGL_ARB_create_context_no_error` and `GLX_ARB_create_context_no_error`, the context hint GLFW_CONTEXT_RELEASE_BEHAVIOR now supports `EGL_KHR_context_flush_control` and glfwGetProcAddress now supports `EGL_KHR_get_all_proc_addresses`.

### OSMesa off-screen context creation support

GLFW now supports creating off-screen OpenGL contexts using OSMesa by setting GLFW_CONTEXT_CREATION_API to `GLFW_OSMESA_CONTEXT_API`. Native access function have been added to retrieve the OSMesa color and depth buffers.

There is also a new null backend that uses OSMesa as its native context creation API, intended for automated testing. This backend does not provide input.

## Caveats for version 3.3

### Layout of joysticks have changed

The way joystick elements are arranged have changed to match SDL2 in order to support SDL_GameControllerDB mappings. The layout of joysticks may change again if required for compatibility with SDL2. If you need a known and stable layout for game controllers, see if you can switch to Gamepad input.

Existing code that depends on a specific joystick layout will likely have to be updated.

### No window required to wait for events

The glfwWaitEvents and glfwWaitEventsTimeout functions no longer need a window to be created to wait for events. Before version 3.3 these functions would return immediately if there were no user-created windows. On platforms where only windows can receive events, an internal helper window is used.

Existing code that depends on the earlier behavior will likely have to be updated.

### Gamma ramp size of 256 may be rejected

The documentation for versions before 3.3 stated that a gamma ramp size of 256 would always be accepted. This was never the case on X11 and could lead to artifacts on macOS. The glfwSetGamma function has been updated to always generate a ramp of the correct size.

Existing code that hardcodes a size of 256 should be updated to use the size of the current ramp of a monitor when setting a new ramp for that monitor.

### Windows XInput deadzone removed

GLFW no longer applies any deadzone to the input state received from the XInput API. This was never done for any other platform joystick API so this change makes the behavior more consistent but you will need to apply your own deadzone if desired.

### X11 clipboard transfer limits

GLFW now supports reading clipboard text via the `INCR` method, which removes the limit on how much text can be read with glfwGetClipboardString. However, writing via this method is not yet supported, so you may not be able to write a very large string with glfwSetClipboardString even if you read it from the clipboard earlier.

The exact size limit for writing to the clipboard is negotiated with each receiving application but is at least several tens of kilobytes. Note that only the read limit has changed. Any string that could be written before still can be.

### X11 extension libraries are loaded dynamically

GLFW now loads all X11 extension libraries at initialization. The only X11 library you need to link against is `libX11`. The header files for the extension libraries are still required for compilation.

Existing projects and makefiles that link GLFW directly against the extension libraries should still build correctly but will add these libraries as load-time dependencies.

### CMake 3.0 or later is required

The minimum CMake version has been raised from 2.8.12 to 3.0. This is only a requirement of the GLFW CMake files. The GLFW source files do not depend on CMake.

### Framebuffer transparency requires DWM transparency

GLFW no longer supports framebuffer transparency enabled via GLFW_TRANSPARENT_FRAMEBUFFER on Windows 7 if DWM transparency is off (the Transparency setting under Personalization > Window Color).

## Deprecations in version 3.3

### Character with modifiers callback

The character with modifiers callback set with glfwSetCharModsCallback has been deprecated and should if possible not be used.

Existing code should still work but further bug fixes will likely not be made. The callback will be removed in the next major version.

### Window parameter to clipboard functions

The window parameter of the clipboard functions glfwGetClipboardString and glfwSetClipboardString has been deprecated and is no longer used on any platform. On platforms where the clipboard must be owned by a specific window, an internal helper window is used.

Existing code should still work unless it depends on a specific window owning the clipboard. New code may pass `NULL` as the window argument. The parameter will be removed in a future release.

## Removals in 3.3

### macOS specific CMake options and macros

The `GLFW_USE_RETINA`, `GLFW_USE_CHDIR` and `GLFW_USE_MENUBAR` CMake options and the `_GLFW_USE_RETINA`, `_GLFW_USE_CHDIR` and `_GLFW_USE_MENUBAR` compile-time macros have been removed.

These options and macros are replaced by the window hint GLFW_COCOA_RETINA_FRAMEBUFFER and the init hints GLFW_COCOA_CHDIR_RESOURCES and GLFW_COCOA_MENUBAR.

Existing projects and makefiles that set these options or define these macros during compilation of GLFW will still build but it will have no effect and the default behaviors will be used.

### LunarG Vulkan SDK dependency

The GLFW test programs that previously depended on the LunarG Vulkan SDK now instead uses a Vulkan loader generated by glad2. This means the GLFW CMake files no longer look for the Vulkan SDK.

Existing CMake projects that depended on the Vulkan SDK cache variables from GLFW will need to call `find_package(Vulkan)` themselves. CMake 3.7 and later already comes with a Vulkan find module similar to the one GLFW previously included.

### CMake option LIB_SUFFIX

The `LIB_SUFFIX` CMake option has been removed. GLFW now uses the GNUInstallDirs CMake package to handle platform specific details like the library directory suffix and the `LIB_SUFFIX` CMake option has been removed.

Existing projects and makefiles that set the `LIB_SUFFIX` option will use the suffix chosen by the GNUInstallDirs package and the option will be ignored.

### Mir support

The experimental Mir support has been completely removed as the Mir project has implemented support for the Wayland protocol and is recommending that applications use that instead.

Existing projects and makefiles that select Mir when compiling GLFW will fail. Use Wayland or X11 instead.

## New symbols in version 3.3

### New functions in version 3.3

- glfwInitHint
- glfwGetError
- glfwGetMonitorWorkarea
- glfwGetMonitorContentScale
- glfwGetMonitorUserPointer
- glfwSetMonitorUserPointer
- glfwWindowHintString
- glfwGetWindowContentScale
- glfwGetWindowOpacity
- glfwSetWindowOpacity
- glfwRequestWindowAttention
- glfwSetWindowAttrib
- glfwSetWindowMaximizeCallback
- glfwSetWindowContentScaleCallback
- glfwRawMouseMotionSupported
- glfwGetKeyScancode
- glfwGetJoystickHats
- glfwGetJoystickGUID
- glfwGetJoystickUserPointer
- glfwSetJoystickUserPointer
- glfwJoystickIsGamepad
- glfwUpdateGamepadMappings
- glfwGetGamepadName
- glfwGetGamepadState

### New types in version 3.3

- GLFWwindowmaximizefun
- GLFWwindowcontentscalefun
- GLFWgamepadstate

### New constants in version 3.3

- GLFW_NO_ERROR
- GLFW_JOYSTICK_HAT_BUTTONS
- GLFW_COCOA_CHDIR_RESOURCES
- GLFW_COCOA_MENUBAR
- GLFW_CENTER_CURSOR
- GLFW_TRANSPARENT_FRAMEBUFFER
- GLFW_HOVERED
- GLFW_FOCUS_ON_SHOW
- GLFW_SCALE_TO_MONITOR
- GLFW_COCOA_RETINA_FRAMEBUFFER
- GLFW_COCOA_FRAME_NAME
- GLFW_COCOA_GRAPHICS_SWITCHING
- GLFW_X11_CLASS_NAME
- GLFW_X11_INSTANCE_NAME
- GLFW_OSMESA_CONTEXT_API
- GLFW_HAT_CENTERED
- GLFW_HAT_UP
- GLFW_HAT_RIGHT
- GLFW_HAT_DOWN
- GLFW_HAT_LEFT
- GLFW_HAT_RIGHT_UP
- GLFW_HAT_RIGHT_DOWN
- GLFW_HAT_LEFT_UP
- GLFW_HAT_LEFT_DOWN
- GLFW_MOD_CAPS_LOCK
- GLFW_MOD_NUM_LOCK
- GLFW_LOCK_KEY_MODS
- GLFW_RAW_MOUSE_MOTION
- GLFW_GAMEPAD_BUTTON_A
- GLFW_GAMEPAD_BUTTON_B
- GLFW_GAMEPAD_BUTTON_X
- GLFW_GAMEPAD_BUTTON_Y
- GLFW_GAMEPAD_BUTTON_LEFT_BUMPER
- GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER
- GLFW_GAMEPAD_BUTTON_BACK
- GLFW_GAMEPAD_BUTTON_START
- GLFW_GAMEPAD_BUTTON_GUIDE
- GLFW_GAMEPAD_BUTTON_LEFT_THUMB
- GLFW_GAMEPAD_BUTTON_RIGHT_THUMB
- GLFW_GAMEPAD_BUTTON_DPAD_UP
- GLFW_GAMEPAD_BUTTON_DPAD_RIGHT
- GLFW_GAMEPAD_BUTTON_DPAD_DOWN
- GLFW_GAMEPAD_BUTTON_DPAD_LEFT
- GLFW_GAMEPAD_BUTTON_LAST
- GLFW_GAMEPAD_BUTTON_CROSS
- GLFW_GAMEPAD_BUTTON_CIRCLE
- GLFW_GAMEPAD_BUTTON_SQUARE
- GLFW_GAMEPAD_BUTTON_TRIANGLE
- GLFW_GAMEPAD_AXIS_LEFT_X
- GLFW_GAMEPAD_AXIS_LEFT_Y
- GLFW_GAMEPAD_AXIS_RIGHT_X
- GLFW_GAMEPAD_AXIS_RIGHT_Y
- GLFW_GAMEPAD_AXIS_LEFT_TRIGGER
- GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER
- GLFW_GAMEPAD_AXIS_LAST

# Release notes for 3.2

These are the release notes for version 3.2. For a more detailed view including all fixed bugs see the version history.

## New features in version 3.2

### Support for Vulkan

GLFW now supports basic integration with Vulkan with glfwVulkanSupported, glfwGetRequiredInstanceExtensions, glfwGetInstanceProcAddress, glfwGetPhysicalDevicePresentationSupport and glfwCreateWindowSurface. Vulkan header inclusion can be selected with GLFW_INCLUDE_VULKAN.

### Window mode switching

GLFW now supports switching between windowed and full screen modes and updating the monitor and desired resolution and refresh rate of full screen windows with glfwSetWindowMonitor.

### Window maxmimization support

GLFW now supports window maximization with glfwMaximizeWindow and the GLFW_MAXIMIZED window hint and attribute.

### Window input focus control

GLFW now supports giving windows input focus with glfwFocusWindow.

### Window size limit support

GLFW now supports setting both absolute and relative window size limits with glfwSetWindowSizeLimits and glfwSetWindowAspectRatio.

### Localized key names

GLFW now supports querying the localized name of printable keys with glfwGetKeyName, either by key token or by scancode.

### Wait for events with timeout

GLFW now supports waiting for events for a set amount of time with glfwWaitEventsTimeout.

### Window icon support

GLFW now supports setting the icon of windows with glfwSetWindowIcon.

### Raw timer access

GLFW now supports raw timer values with glfwGetTimerValue and glfwGetTimerFrequency.

### Joystick connection callback

GLFW now supports notifying when a joystick has been connected or disconnected with glfwSetJoystickCallback.

### Context-less windows

GLFW now supports creating windows without a OpenGL or OpenGL ES context by setting the GLFW_CLIENT_API hint to `GLFW_NO_API`.

### Run-time context creation API selection

GLFW now supports selecting and querying the context creation API at run-time with the GLFW_CONTEXT_CREATION_API hint and attribute.

### Error-free context creation

GLFW now supports creating and querying OpenGL and OpenGL ES contexts that do not emit errors with the GLFW_CONTEXT_NO_ERROR hint, provided the machine supports the `GL_KHR_no_error` extension.

### CMake config-file package support

GLFW now supports being used as a config-file package from other projects for easy linking with the library and its dependencies.

# Release notes for 3.1

These are the release notes for version 3.1. For a more detailed view including all fixed bugs see the version history.

## New features in version 3.1

### Custom mouse cursor images

GLFW now supports creating and setting both custom cursor images and standard cursor shapes. They are created with glfwCreateCursor or glfwCreateStandardCursor, set with glfwSetCursor and destroyed with glfwDestroyCursor.

See also
  Cursor objects

### Path drop event

GLFW now provides a callback for receiving the paths of files and directories dropped onto GLFW windows. The callback is set with glfwSetDropCallback.

See also
  Path drop input

### Main thread wake-up

GLFW now provides the glfwPostEmptyEvent function for posting an empty event from another thread to the main thread event queue, causing glfwWaitEvents to return.

See also
  Event processing

### Window frame size query

GLFW now supports querying the size, on each side, of the frame around the content area of a window, with glfwGetWindowFrameSize.

See also
  Window size

### Simultaneous multi-monitor rendering

GLFW now supports disabling auto-iconification of full screen windows with the GLFW_AUTO_ICONIFY window hint. This is intended for people building multi-monitor installations, where you need windows to stay in full screen despite losing input focus.

### Floating windows

GLFW now supports floating windows, also called topmost or always on top, for easier debugging with the GLFW_FLOATING window hint and attribute.

### Initially unfocused windows

GLFW now supports preventing a windowed mode window from gaining input focus on creation, with the GLFW_FOCUSED window hint.

### Direct access for window attributes and cursor position

GLFW now queries the window input focus, visibility and iconification attributes and the cursor position directly instead of returning cached data.

### Character with modifiers callback

GLFW now provides a callback for character events with modifier key bits. The callback is set with glfwSetCharModsCallback. Unlike the regular character callback, this will report character events that will not result in a character being input, for example if the Control key is held down.

See also
  Text input

### Single buffered framebuffers

GLFW now supports the creation of single buffered windows, with the GLFW_DOUBLEBUFFER hint.

### Macro for including extension header

GLFW now includes the extension header appropriate for the chosen OpenGL or OpenGL ES header when GLFW_INCLUDE_GLEXT is defined. GLFW does not provide these headers. They must be provided by your development environment or your OpenGL or OpenGL ES SDK.

### Context release behaviors

GLFW now supports controlling and querying whether the pipeline is flushed when a context is made non-current, with the GLFW_CONTEXT_RELEASE_BEHAVIOR hint and attribute, provided the machine supports the `GL_KHR_context_flush_control` extension.

### (Experimental) Wayland support

GLFW now has an experimental Wayland display protocol backend that can be selected on Linux with a CMake option.

### (Experimental) Mir support

GLFW now has an experimental Mir display server backend that can be selected on Linux with a CMake option.

# Release notes for 3.0

These are the release notes for version 3.0. For a more detailed view including all fixed bugs see the version history.

## New features in version 3.0

### CMake build system

GLFW now uses the CMake build system instead of the various makefiles and project files used by earlier versions. CMake is available for all platforms supported by GLFW, is present in most package systems and can generate makefiles and/or project files for most popular development environments.

For more information on how to use CMake, see the CMake manual.

### Multi-window support

GLFW now supports the creation of multiple windows, each with their own OpenGL or OpenGL ES context, and all window functions now take a window handle. Event callbacks are now per-window and are provided with the handle of the window that received the event. The glfwMakeContextCurrent function has been added to select which context is current on a given thread.

### Multi-monitor support

GLFW now explicitly supports multiple monitors. They can be enumerated with glfwGetMonitors, queried with glfwGetVideoModes, glfwGetMonitorPos, glfwGetMonitorName and glfwGetMonitorPhysicalSize, and specified at window creation to make the newly created window full screen on that specific monitor.

### Unicode support

All string arguments to GLFW functions and all strings returned by GLFW now use the UTF-8 encoding. This includes the window title, error string, clipboard text, monitor and joystick names as well as the extension function arguments (as ASCII is a subset of UTF-8).

### Clipboard text I/O

GLFW now supports reading and writing plain text to and from the system clipboard, with the glfwGetClipboardString and glfwSetClipboardString functions.

### Gamma ramp support

GLFW now supports setting and reading back the gamma ramp of monitors, with the glfwGetGammaRamp and glfwSetGammaRamp functions. There is also glfwSetGamma, which generates a ramp from a gamma value and then sets it.

### OpenGL ES support

GLFW now supports the creation of OpenGL ES contexts, by setting the GLFW_CLIENT_API hint to `GLFW_OPENGL_ES_API`, where creation of such contexts are supported. Note that GLFW does not implement OpenGL ES, so your driver must provide support in a way usable by GLFW. Modern Nvidia and Intel drivers support creation of OpenGL ES context using the GLX and WGL APIs, while AMD provides an EGL implementation instead.

### (Experimental) EGL support

GLFW now has an experimental EGL context creation back end that can be selected through CMake options.

### High-DPI support

GLFW now supports high-DPI monitors on both Windows and macOS, giving windows full resolution framebuffers where other UI elements are scaled up. To achieve this, glfwGetFramebufferSize and glfwSetFramebufferSizeCallback have been added. These work with pixels, while the rest of the GLFW API works with screen coordinates. This is important as OpenGL uses pixels, not screen coordinates.

### Error callback

GLFW now has an error callback, which can provide your application with much more detailed diagnostics than was previously possible. The callback is passed an error code and a description string.

### Per-window user pointer

Each window now has a user-defined pointer, retrieved with glfwGetWindowUserPointer and set with glfwSetWindowUserPointer, to make it easier to integrate GLFW into C++ code.

### Window iconification callback

Each window now has a callback for iconification and restoration events, which is set with glfwSetWindowIconifyCallback.

### Window position callback

Each window now has a callback for position events, which is set with glfwSetWindowPosCallback.

### Window position query

The position of a window can now be retrieved using glfwGetWindowPos.

### Window focus callback

Each windows now has a callback for focus events, which is set with glfwSetWindowFocusCallback.

### Cursor enter/leave callback

Each window now has a callback for when the mouse cursor enters or leaves its content area, which is set with glfwSetCursorEnterCallback.

### Initial window title

The title of a window is now specified at creation time, as one of the arguments to glfwCreateWindow.

### Hidden windows

Windows can now be hidden with glfwHideWindow, shown using glfwShowWindow and created initially hidden with the GLFW_VISIBLE window hint and attribute. This allows for off-screen rendering in a way compatible with most drivers, as well as moving a window to a specific position before showing it.

### Undecorated windows

Windowed mode windows can now be created without decorations, e.g. things like a frame, a title bar, with the GLFW_DECORATED window hint and attribute. This allows for the creation of things like splash screens.

### Modifier key bit masks

Modifier key bit mask parameters have been added to the mouse button and key callbacks.

### Platform-specific scancodes

A scancode parameter has been added to the key callback. Keys that don't have a key token still get passed on with the key parameter set to `GLFW_KEY_UNKNOWN`. These scancodes will vary between machines and are intended to be used for key bindings.

### Joystick names

The name of a joystick can now be retrieved using glfwGetJoystickName.

### Doxygen documentation

You are reading it.