Welcome to version 2.7.7 of the GLFW library. GLFW is a free, Open Source, multi-platform library for OpenGL application development that provides a powerful API for handling operating system specific tasks such as opening an OpenGL window, reading keyboard, mouse, joystick and time input, creating threads, and more.
GLFW 2.7 is expected to be the last major release of the 2.x series, with most development now being done on what will become version 3.0.
This release adds fixes for a few minor bugs on each platform, support for more swap interval methods on X11 and Visual C++ 2012 project files.
For a full list of changes, see the version history.
Please note that this is the Windows 32-bit binary only distribution of GLFW. It contains static, dynamic and link libraries built with and using the runtimes of a number of common Windows compilers. More specifically, it contains files for the following compilers:
For the full source distribition, go to the GLFW website or to the project page on SF.net.
There are two aspects to using GLFW:
The first point is covered in the GLFW Users Guide and the GLFW Reference Manual, and we suggest that you read at least the Users Guide, since it's a good introduction to the GLFW API.
Designing and compiling programs that use GLFW is not very difficult. A few rules for successfully designing GLFW-based programs are presented in the following sections.
In the files of your program where you use OpenGL or GLFW, you should
include the GL/glfw.h
header file, i.e.:
#include <GL/glfw.h>
This defines all the constants, types and function prototypes of the GLFW API. It also includes the OpenGL and GLU header files, and defines all the necessary constants and types that are necessary for these headers to work on that particular platform.
For example, under Microsoft Windows you are normally required to include
windows.h
before you include GL/gl.h
. This would
however make your code dependent on the Windows platform, or at least require
your program to check which platform it is being compiled on.
The GLFW header file takes care of this for you, not by including
windows.h
, but rather by itself duplicating the necessary parts of
it. This way, the namespace won't be cluttered by the entire Windows API.
By default, the regular gl.h
OpenGL header is included. If you
wish to include the draft gl3.h
header instead, define
GLFW_INCLUDE_GL3
before the inclusion of the GLFW header.
By default, the glu.h
GLU header is included. If you wish to
avoid this, define GLFW_NO_GLU
before the inclusion of the GLFW
header.
In other words:
gl.h
or glu.h
yourself, as GLFW does this for youwindows.h
unless you need
direct access to the Windows APIwindows.h
, do it
before including GL/glfw.h
. The GLFW header will
detect this and act appropriately.Also note that if you are using an OpenGL extension loading library such as
GLEW, you should include the GLEW
header before the GLFW one. The GLEW header defines macros that
disable any gl.h
that the GLFW header includes and GLEW will work
as expected.
If you link with the static version of GLFW, it is also necessary to link with some system libraries that GLFW uses.
When linking a program under Windows that uses the static version of GLFW,
you must also link with the following libraries: opengl32
,
user32
and kernel32
. Some of these libraries may be
linked with by default by your compiler. In the table below you can see the
minimum required link options for each supported Windows compiler (you may want
to add other libraries as well, such as glu32
):
Compiler | Link options |
Borland C++ Builder | glfw.lib opengl32.lib |
Cygwin | See Unix static library below |
LCC-Win32 | glfw.lib opengl32.lib |
Microsoft Visual C++ | glfw.lib opengl32.lib |
MinGW and MinGW-w64 | -lglfw -lopengl32 |
OpenWatcom | glfw.lib opengl32.lib user32.lib |
To compile a program that uses the DLL version of GLFW, you need to
define the GLFW_DLL
constant. This can either be done with a
compiler switch, typically by adding -DGLFW_DLL
to the list of
compiler options. You can also do it by adding the following line to all your
source files before including the GLFW header file:
#define GLFW_DLL
When linking a program under Windows that uses the DLL version of GLFW,
the only library you need to link with for GLFW to work is glfwdll
.
In the table below you can see the minimum required link options for each
supported Windows compiler (you may want to add other libraries as well,
such as opengl32
and glu32
):
Compiler | Link options |
Borland C++ Builder | glfwdll.lib |
Cygwin | -lglfwdll |
LCC-Win32 | glfwdll.lib |
Microsoft Visual C++ | glfwdll.lib |
MinGW and MinGW-w64 | -lglfwdll |
OpenWatcom | glfwdll.lib |
glfwTerminate
had been called from the main thread was missingGLFW_OPENGL_DEBUG_CONTEXT
hint did not trigger context re-creation when WGL_ARB_create_context
was availableGLFW_OPENGL_DEBUG_CONTEXT
window parameter was not set after debug context creationGLX_EXT_swap_control
and GLX_MESA_swap_control
extensions as alternatives to GLX_SGI_swap_control
GLFW_OPENGL_DEBUG_CONTEXT
window parameter was not set after debug context creationglfwSetWindowSize
on a non-resizable windowclock_gettime
were not added to the pkg-config fileHere is an overview of the directory structure of the GLFW distribution:
docs | GLFW manuals in PDF format |
include | |
GL | The GLFW C/C++ include file |
lib-mingw | Binaries for MinGW |
lib-msvc90 | Binaries for Visual C++ 2008 release configuration |
lib-msvc100 | Binaries for Visual C++ 2010 release configuration |
lib-msvc110 | Binaries for Visual C++ 2012 release configuration |
The official website for GLFW is glfw.org. It contains the latest version of GLFW, news and other information that is useful for OpenGL development.
If you have questions related to the use of GLFW, we have a
user's web forum,
and a
user's mailing list
on SF.net, and the registered IRC channel #glfw
on
Freenode.
If you have a bug to report, a patch to submit or a feature you'd like to request, please file it in one of the GLFW trackers on SF.net.
Finally, if you're interested in helping out with the development of GLFW or porting it to your favorite platform, we have a developer's mailing list, or you could join us on#glfw
.
GLFW exists because people around the world donated their time and lent their skills. Special thanks go out to:
_NET_WM_PING
response