|This article needs additional citations for verification. (May 2015)|
|Developer(s)||The GLFW Development Team|
|Stable release||3.1.1 / March 19, 2015|
|Operating system||Linux, OS X, Microsoft Windows, FreeBSD|
GLFW is a lightweight utility library for use with OpenGL. It provides programmers with the ability to create and manage windows and OpenGL contexts, as well as receive input from joystick, keyboard, mouse, time and clipboard.
GLFW is a small C library that enables the creation and management of windows with OpenGL contexts, enumerate monitors and video modes as well as handle inputs such as keyboard, mouse, joystick, clipboard and time. GLFW provides a thin, multi-platform abstraction layer, primarily for applications whose sole graphics output is through the OpenGL API. While GLFW is very useful when developing multi-platform OpenGL applications, single-platform developers can also benefit from avoiding having to deal with kludgy platform-specific APIs.
A possible reason that libraries like GLFW are needed is that OpenGL by itself does not provide any mechanisms for creating the necessary context, managing windows, user input, timing etc. There are several other libraries available for aiding OpenGL development. The most common ones are freeglut, an Open Source implementation of GLUT, and SDL. However, freeglut is mostly concerned with providing a stable clone of GLUT, while SDL is too large for some people and has never had OpenGL as its main focus. GLFW is predicated on the assumption that there is room for a lightweight, modern library for managing OpenGL contexts, windows and input.
GLFW is by design not
- a user interface library. It allows the programmer to create top-level windows with OpenGL contexts. No menus, no buttons.
- a Windows-only library. Requests for features that cannot be portably implemented will be denied unless they are unobtrusive, like the Windows port looking for a GLFW_ICON resource at window creation.
- a threading library. There are already good cross-platform threading libraries and threading has been added to both the C11 and C++11 standard libraries.
- an image loading library. There are already good cross-platform image loading libraries.
- capable of rendering text. There are already several libraries that render text with OpenGL and consistent cross-platform text rendering cannot depend on the platform’s text rendering facilities anyway.
- capable of rendering anything at all. Rendering is up to the programmer and/or other libraries.
- integrated with any user interface toolkit on any platform. Good UI toolkits already provide OpenGL-capable widgets and having two libraries both talking to the vast global state of a window system is asking for trouble.
- able to play back sound.
- GLUT or SDL.
Programming language bindings
- GLFW Screenshots – Screenshots making use of GLFW.