GLFW 3.0 source distribution
- Introduction
- Compiling GLFW and the example programs
- Installing GLFW
- Using GLFW
- Version history
- Directory structure of the GLFW distribution
- Contacting the project
- Acknowledgements
1. Introduction
Welcome to version 3.0 of the GLFW library. GLFW is a free, open source,
portable library for OpenGL application development. It provides a powerful
API for handling operating system specific tasks, such as opening an OpenGL
window, reading keyboard, mouse, joystick and time input, and more.
This is an experimental series intended to allow the new API to
settle.
Note that the threading and image loading APIs from the 2.x
series have been removed.
2. Compiling GLFW and the example programs
To compile GLFW and the accompanying example programs, you will need the
CMake build system.
3. Installing GLFW
A rudimentary installation target is provided for all supported platforms
via the CMake build system.
4. Using GLFW
There are two aspects to using GLFW:
- How does the GLFW API work
- How to compile programs that use 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.
4.1 Include the GLFW header file
In the files of your program where you use OpenGL or GLFW, you should
include the GL/glfw3.h
header file, i.e.:
#include <GL/glfw3.h>
This defines all the constants, types and function prototypes of the GLFW
API. It also includes the gl.h
and GL/glu.h header
files, and - this is very important - it defines all the necessary
constants and types that are necessary for the OpenGL headers to work on
different platforms.
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.
In other words:
- Do not include
GL/gl.h
or GL/glu.h
yourself, as GLFW does this for you
- Do not include
windows.h
unless you actually need
direct access to the Windows API
- If you do need to include
windows.h
, do it
before including GL/glfw3.h
and the GLFW header will
detect this.
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.
4.2 Link with the right libraries
4.2.1 Windows static library
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 user32.lib |
MinGW32 |
-lglfw -lopengl32 |
OpenWatcom |
glfw.lib opengl32.lib user32.lib |
4.2.2 Windows DLL
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 |
MinGW32 |
-lglfwdll |
OpenWatcom |
glfwdll.lib |
4.2.3 Unix static library
GLFW supports
pkg-config,
and a libglfw.pc
file is generated and installed when you install
the library. For systems that do not provide pkg-config, you should look in
this file for the proper compile and link flags for your system, as determined
by compile.sh at compile time.
A typical compile and link command-line may look like this:
cc `pkg-config --cflags libglfw` -o myprog myprog.c `pkg-config --libs libglfw`
If you use GLU functions in your program you should also add
-lGLU
to your link flags.
4.2.5 Mac OS X static library
When compiling and linking a program under Mac OS X that uses GLFW, you
must also link with Cocoa and OpenGL frameworks.
If you are using Xcode, you simply add the GLFW library libglfw.a
and
these frameworks to your project. If, however, you are building your program
from the command-line, there are two methods for correctly linking your GLFW
program.
GLFW supports
pkg-config, and a
libglfw.pc file is generated and installed when you install the library. You
can find pkg-config in most packaging systems, such as
Fink and
MacPorts, so if you have one of them
installed, simply install pkg-config. Once you have pkg-config available, the
command-line for compiling and linking your program is:
cc `pkg-config --cflags libglfw` -o myprog myprog.c `pkg-config --libs libglfw`
If you do not wish to use pkg-config, you will need to add the required
frameworks and libraries to your command-line using the -l
and
-framework
switches, i.e.:
cc -o myprog myprog.c -lglfw -framework Cocoa -framework OpenGL
Note that you do not add the .framework extension to a framework when adding
it from the command-line.
These frameworks contain all OpenGL and GLU functions, so there is no need to
add additional libraries or frameworks when using GLU functionality. Also note
that even though your machine may have Unix-style OpenGL libraries, they are for
use with the X Window System, and will not work with the Mac OS X native
version of GLFW.
5. Version history
v3.0
- Added
GLFWmonitor
monitor handle type and updated monitor-related functions to take a monitor handle
- Added
glfwGetMonitors
and glfwGetPrimaryMonitor
for enumerating available monitors
- Added
glfwGetMonitorParam
and glfwGetMonitorName
for retrieving monitor properties
- Added
glfwSetMonitorUserPointer
and glfwGetMonitorUserPointer
for per-monitor user pointers
- Added
glfwSetMonitorCallback
and GLFWmonitorfun
for notification of changes in the set of available monitors
- Added
GLFWwindow
window handle type and updated window-related functions and callbacks to take a window handle
- Added
glfwDefaultWindowHints
function for resetting all window hints to their default values
- Added
glfwMakeContextCurrent
function for making the context of the specified window current
- Added
glfwGetError
and glfwErrorString
error reporting functions and a number of error tokens
- Added
glfwSetErrorCallback
function and GLFWerrorfun
type for receiving more specific and/or nested errors
- Added
glfwSetWindowUserPointer
and glfwGetWindowUserPointer
functions for per-window user pointers
- Added
glfwGetVersionString
function for determining which code paths were enabled at compile time
- Added
glfwGetWindowMonitor
for querying the monitor, if any, of the specified window
- Added
glfwSetWindowPosCallback
function and GLFWwindowposfun
type for reciving window position events
- Added
glfwSetWindowFocusCallback
function and GLFWwindowfocusfun
type for receiving window focus events
- Added
glfwSetWindowIconifyCallback
function and GLFWwindowiconifyfun
type for receiving window iconification events
- Added
glfwGetClipboardString
and glfwSetClipboardString
functions for interacting with the system clipboard
- Added
glfwGetJoystickName
for retrieving the name of a joystick
- Added
glfwGetCurrentContext
function for retrieving the window whose OpenGL context is current
- Added
GLFW_SRGB_CAPABLE
for requesting sRGB capable framebuffers
- Added
GLFW_CLIENT_API
, GLFW_OPENGL_API
and GLFW_OPENGL_ES_API
for selecting client API
- Added
GLFW_OPENGL_ROBUSTNESS
window hint and associated strategy tokens for GL_ARB_robustness
support
- Added
GLFW_OPENGL_REVISION
window parameter to make up for removal of glfwGetGLVersion
- Added
GLFW_INCLUDE_GLCOREARB
macro for including glcorearb.h
instead of gl.h
- Added
GLFW_INCLUDE_ES2
macro for telling the GLFW header to include the OpenGL ES 2.0 header instead of gl.h
- Added
GLFW_VISIBLE
window hint and parameter for controlling and polling window visibility
- Added
GLFW_POSITION_X
and GLFW_POSITION_Y
window hints and parameter for controlling and polling window position
- Added
windows
simple multi-window test program
- Added
sharing
simple OpenGL object sharing test program
- Added
modes
video mode enumeration and setting test program
- Added
threads
simple multi-threaded rendering test program
- Added
glfw3native.h
header and platform-specific functions for explicit access to native display, window and context handles
- Added
glfwSetGamma
, glfwSetGammaRamp
and glfwGetGammaRamp
functions and GLFWgammaramp
type for monitor gamma ramp control
- Added window parameter to
glfwSwapBuffers
- Changed buffer bit depth parameters of
glfwOpenWindow
to window hints
- Changed
glfwOpenWindow
and glfwSetWindowTitle
to use UTF-8 encoded strings
- Changed
glfwGetProcAddress
to return a (generic) function pointer
- Changed
glfwGetVideoModes
to return a dynamic, unlimited number of video modes for the specified monitor
- Renamed
glfw.h
to glfw3.h
to avoid conflicts with 2.x series
- Renamed
glfwOpenWindowHint
to glfwWindowHint
- Renamed
GLFW_ACTIVE
to GLFW_FOCUSED
- Renamed
GLFW_WINDOW_NO_RESIZE
to GLFW_RESIZABLE
- Renamed
GLFW_BUILD_DLL
to _GLFW_BUILD_DLL
- Renamed
version
test to glfwinfo
- Renamed
GLFW_NO_GLU
to GLFW_INCLUDE_GLU
and made it disabled by default
- Renamed
glfwGetJoystickPos
to glfwGetJoystickAxes
to match glfwGetJoystickButtons
- Renamed mouse position functions to cursor position equivalents
- Replaced
glfwOpenWindow
and glfwCloseWindow
with glfwCreateWindow
and glfwDestroyWindow
- Replaced
glfwGetDesktopMode
width glfwGetVideoMode
- Replaced ad hoc build system with CMake
- Replaced layout-dependent key codes with single, platform-independent set based on US layout
- Replaced mouse wheel interface with two-dimensional, floating point scrolling interface
- Replaced
glfwEnable
and glfwDisable
with glfwGetInputMode
and glfwSetInputMode
- Replaced
joystick
test with graphical version
- Replaced automatic closing of windows with
GLFW_CLOSE_REQUESTED
window parameter
- Removed the
GLFW_KEY_REPEAT
input option
- Removed event auto-polling and the
GLFW_AUTO_POLL_EVENTS
window enable
- Removed the Win32 port .def files
- Removed the entire threading API
- Removed the entire image loading API
- Removed deprecated Carbon port
- Removed registering
glfwTerminate
with atexit
- Removed
glfwSleep
function
- Removed
glfwGetNumberOfProcessors
function
- Removed
glfwGetGLVersion
function
- Removed
GLFW_OPENED
window parameter
- Removed
GLFW_WINDOW
and GLFW_FULLSCREEN
- Removed nonsensical key actions for Unicode character input
- Removed
GLFWCALL
and GLFWAPIENTRY
macros for stdcall calling convention
- Removed
GLFW_ACCELERATED
window parameter
- Removed default framebuffer attributes from
glfwGetWindowParam
- Bugfix: The default OpenGL version in the
glfwinfo
test was set to 1.1
- Bugfix: The OpenGL profile and forward-compatibility window parameters were not saved after context creation
- Bugfix: The FSAA test did not check for the availability of
GL_ARB_multisample
- Bugfix: Cursor centering upon leaving captured cursor mode was reported before the mode was changed to non-captured
- [Cocoa] Added support for OpenGL 3.2 core profile in 10.7 Lion and above
- [Cocoa] Added support for joysticks
- [Cocoa] Postponed menu creation to first window creation
- [Cocoa] Replaced
NSDate
time source with mach_absolute_time
- [Cocoa] Replaced all deprecated CoreGraphics calls with non-deprecated counterparts
- [Cocoa] Bugfix: The
NSOpenGLPFAFullScreen
pixel format attribute caused creation to fail on some machines
- [Cocoa] Bugfix:
glfwOpenWindow
did not properly enforce the forward-compatible and context profile hints
- [Cocoa] Bugfix: The loop condition for saving video modes used the wrong index variable
- [Cocoa] Bugfix: The OpenGL framework was not retrieved, making glfwGetProcAddress crash
- [Cocoa] Bugfix:
glfwInit
changed the current directory for unbundled executables
- [Cocoa] Bugfix: The
GLFW_WINDOW_NO_RESIZE
window parameter was always zero
- [Cocoa] Bugfix: The cursor position incorrectly rounded during conversion
- [Cocoa] Bugfix: Cursor positioning led to nonsensical results for fullscreen windows
- [Cocoa] Bugfix: The GLFW window was flagged as restorable
- [X11] Added support for the
GLX_EXT_swap_control
and GLX_MESA_swap_control
extensions as alternatives to GLX_SGI_swap_control
- [X11] Added the POSIX
CLOCK_MONOTONIC
time source as the preferred method
- [X11] Added dependency on libm, where present
- [X11] Added support for the
_NET_WM_NAME
and _NET_WM_ICON_NAME
EWMH window properties
- [X11] Bugfix: Some window properties required by the ICCCM were not set
- [X11] Bugfix: Calling
glXCreateContextAttribsARB
with an unavailable OpenGL version caused the application to terminate with a BadMatch
Xlib error
- [X11] Bugfix: A synchronization point necessary for jitter-free locked cursor mode was incorrectly removed
- [X11] Bugfix: The window size hints were not updated when calling
glfwSetWindowSize
on a non-resizable window
- [Win32] Changed port to use Unicode mode only
- [Win32] Removed explicit support for versions of Windows older than Windows XP
- [Win32] Bugfix: Window activation and iconification did not work as expected
- [Win32] Bugfix: Software rasterizer pixel formats were not discarded by the WGL_ARB_pixel_format code path
- [Win32] Bugfix: The array for WGL context attributes was too small and could overflow
- [Win32] Bugfix: Alt+F4 hot key was not translated into
WM_CLOSE
- [Win32] Bugfix: The
GLFW_WINDOW_NO_RESIZE
window parameter was always zero
- [Win32] Bugfix: A test was missing for whether all available pixel formats had been disqualified
v2.7
- Added
GLFW_OPENGL_VERSION_MAJOR
and GLFW_OPENGL_VERSION_MINOR
hints for versioned context creation
- Added
GLFW_OPENGL_FORWARD_COMPAT
hint for forward compatible context creation
- Added
GLFW_OPENGL_DEBUG_CONTEXT
hint for debug context creation
- Added
GLFW_OPENL_PROFILE
hint for context creation using profiles
- Added
GLFW_NO_GLU
macro for disabling the inclusion of the GLU header by the GLFW header
- Added platform-independent pixel format selection (not used on Mac OS X)
- Added support and symbols for several additional keys, including Windows/Command keys, Pause, Caps Lock and Menu
- Added conservative value clamping to
glfwOpenWindowHint
- Added a number of test programs mostly useful to developers of GLFW
- Added error messages and graceful failure to example programs
- Added Cocoa port for Mac OS X 10.5 Leopard and later
- Added vsync to all relevant example programs
- Added a rudimentary OpenGL 3.2+ core profile example program
- Updated Pascal (formerly Delphi) bindings to support more compilers
- Clarified and expanded the User's Guide and Reference Manual
- Fixed a number of compiler warnings in the example programs
- OpenGL version is now only parsed once, at window creation time
- Changed
glfwSwapBuffers
to call glfwPollEvents
after buffer swap
- Changed all comments in public header file to plain C style
- Removed the
keytest
example program, as it was superseded by the events
test
- Removed deprecated AmigaOS and DOS ports
- Removed all FPS counters from example programs
- Removed all unmaintained language bindings
- Removed support for Pelles C
- Removed broken Microsoft Visual C++ 6.0 build path
- [X11] Added
x11-dist-install
install target, intended for packagers of GLFW
- [X11] Added
x11-dist-clean
build target, intended for developers of GLFW
- [X11] Added support for
GLX_SGIX_fbconfig
- [X11] Added support for user-specified compilation flags via
CFLAGS
- [X11] Added documentation of configuration macros
- [X11] Implemented support for
GLFW_SYSTEM_KEYS
- [X11] Improved configuration and makefile creation logic
- [X11] Removed support for GLX version 1.2 and below
- [X11] Removed unnecessary calls to XSync
- [X11] Removed use of legacy window style atoms
- [X11] Bugfix: Repeated keys would sometimes leak through despite key repeat being disabled
- [X11] Bugfix: Fullscreen window resizing would cause color buffer clearing without taking framebuffer objects into account
- [X11] Bugfix: AltGr was not reported as right Alt
- [X11] Bugfix: Window colormap was not freed
- [X11] Bugfix: Close callback was called for
glfwCloseWindow
- [X11] Bugfix: Misspelt struct member in XF86VidMode code path
- [X11] Bugfix: Window decorations would not appear using certain versions of Compiz on Intel hardware
- [X11] Bugfix: Numeric keypad key symbols would change depending on Num Lock state
- [X11] Bugfix: Hidden cursor position snapped back when halfway from window center to edge
- [X11] Bugfix: Not properly verifying that the window was mapped before making certain calls caused a
BadMatch
error
- [X11] Bugfix: The response to
_NET_WM_PING
events was malformed
- [X11] Bugfix: Hidden cursor mode interfered with other applications when GLFW window was unfocused
- [X11] Bugfix: The invisible cursor objects used for hidden cursor mode were not freed
- [X11] Bugfix: EWMH-compliant window managers were incorrectly detected
- [X11] Bugfix: The EWMH code path for fullscreen windows did not present the window using
_NET_ACTIVE_WINDOW
- [X11] Bugfix: The EWMH code path for fullscreen windows did not send a
_NET_WM_STATE
client message
- [Carbon] Added Universal Binary build targets for all examples
- [Carbon] Renamed MacOSX port to Carbon
- [Carbon] Removed support for 10.2 Jaguar
- [Carbon] Deprecated Carbon port
- [Carbon] Bugfix: Using the Dock or menu Quit command did not call the close callback
- [Carbon] Bugfix: Key repeat events were not caught on 10.5 Leopard
- [Carbon] Bugfix: Certain keys were not reported
- [Carbon] Bugfix: Missing
-m32
flag caused build failure on 10.6 Snow Leopard
- [Carbon] Bugfix: Missing
-mmacosx-version-min
flag caused build failure on 10.5 Leopard
- [Carbon] Bugfix:
glfwOpenWindow
did not call glClear
- [Win32] Added Visual C++ project files for all examples and test programs
- [Win32] Removed iterative context re-creation attempts for FSAA sample count
- [Win32] Bugfix: The Visual C++ GLFW DLL project file did not use the correct DEF file
- [Win32] Bugfix: WGL extensions were not detected and/or used correctly
- [Win32] Bugfix: Improper use of wParam for
WM_SYSCOMMAND
- [Win32] Bugfix: Derivatives of stream.c were not cleaned up by compile.bat
- [Win32] Bugfix: Pointer for
GetExtensionsStringARB
was not initialized
- [Win32] Bugfix: Makefiles contained the wrong GLFW API version
- [Win32] Bugfix: Numeric keypad key symbols would change depending on Num Lock state
- [Win32] Bugfix:
DllMain
performed a number of forbidden actions (by calling glfwTerminate
)
v2.6
- Added
GLFW_FSAA_SAMPLES
multisampling hint
- Added
GLFW_WINDOW_NO_RESIZE
hint for non-resizable windows
- Added install targets for all Unix-like build targets
- Added
glfwReadMemoryImage
function for creating a GLFWImage
object from an image file in a memory buffer
- Added
glfwLoadMemoryTexture2D
function for decoding an image file in a memory buffer into a texture
- Added
glfwLoadTextureImage2D
function for loading a GLFWImage
object into a texture
- Added cross-compilation support for MinGW under a Unix-like host
- D bindings updated and all examples ported to modern D
- Delphi bindings updated to reflect API additions
- Bugfix: The interaction between key repeat and window focus code caused duplicate presses
- Bugfix: The mouse position was not properly updated when re-enabling the mouse cursor
- [Win32] Added pkg-config file generation for Cygwin
- [Win32] Added version number to window class name
- [Win32] Added optional loading of user provided window icon resource
- [Win32] Bugfix: Very small sleep periods were forced to higher value
- [Win32] Bugfix: The nmake makefile did not handle paths with spaces correctly
- [Win32] Bugfix: Removed assembly RDTSC timing code
- [Win32] Bugfix: Hidden cursor was not clipped to windowed windows
- [X11] Added XRandR code path for fullscreen windows
- [X11] Added building of shared library
- [X11] Added ICCCM WM fullscreen hints
- [X11] Added support for the
_NET_WM_PING
protocol
- [X11] Added pkg-config file generation
- [X11] Added setting of WM size hints
- [X11] Bugfix: Removed assembly RDTSC timing code
- [X11] Bugfix: Window re-opening now works properly (including fullscreen windows)
- [X11] Bugfix: Potential crash bug in video mode matching code
- [X11] Bugfix: Static buffers imposed an invisible limit on reported video mode count
- [X11] Bugfix: Interaction with certain window managers when setting input focus would cause termination with a BadMatch error
- [X11] Bugfix: Keypad keys did not trigger the character callback
- [MacOSX] Added pkg-config file generation
- [MacOSX] Added building of shared library
- [MacOSX] Added building of Universal Binary libraries
- [MacOSX] Replaced fullscreen code path with CGL version
- [MacOSX] Bugfix: Binaries without bundles or resource forks now interact properly with the WM
- [MacOSX] Bugfix: Replaced Carbon event time source with
gettimeofday
- [MacOSX] Bugfix: Added code to minimize the dreaded OpenGL application startup jump
- [MacOSX] Bugfix: Fixed broken implementation of
glfwSetMousePos
for windowed mode
- [MacOSX] Bugfix: Fixed broken implementation of hidden cursor
- [MacOSX] Bugfix: Capturing all displays and not just the main one
- [AmigaOS] Obsoleted platform due to lack of maintainer and community interest
- [DOS] Obsoleted platform due to lack of maintainer and community interest
v2.5
- Added the function glfwWaitEvents
- Added window close callback, which enables a program to prevent a user
from closing a window with the window manager
- Added window refresh callback, which is called when the window needs
to be refreshed
- Added support for loading alpha textures (GLFW_ALPHA_MAP_BIT)
- Added support for the Lua programming language
- Added support for the D programming language
- Added support for the Pelles C compiler for Windows
- Added API level support for up to eight mouse buttons
- [Win32] Added support for up to five mouse buttons
- [Win32] Mouse down events capture mouse input
- [Win32] Bugfix: The DLL now exports glfwSetTime
- [Win32] Fix: The GLFW window is now placed in the upper left corner
of the desktop working area
- [Win32/X11] Bugfix: More robust check for SwapInterval
- [X11] Added support for USB joysticks under Linux (/dev/input/js*)
- [X11] Bugfix: Added support for GLX extensions in glfwExtensionSupported
- [X11] Bugfix: More robust fullscreen mode (?)
- [X11] Bugfix: Runtime check of XF86VidMode support for the active
display
- [X11] Bugfix: Some mouse button events were reported incorrectly
- [MacOSX] Added support for the input char callback.
- [MacOSX] Added video mode validation and duplicate elimination.
- [MacOSX] Switched to a new MakeBundle.sh script.
- [MacOSX] Added emulation of the window refresh callback.
- [MacOSX] Bugfix: The window and its associated resources are now
properly released.
- [MacOSX] Bugfix: Removed support for more than eight mouse buttons.
- [x86 CPUs] Improved Intel mobile CPU detection (e.g. disables RDTSC
timing on Centrino systems)
v2.4.2
- Preliminary native Mac OS X support (via the Carbon interface)
- Preliminary DOS support (DJGPP + Mesa)
- Changed license to the zlib license (almost identical to the previous
GLFW license), so now GLFW is OSI Certified
- Rewrote the GLFW documentation in LaTeX, meaning several improvements
(both visual and practical)
- Added the
support
folder to the distribution, which includes
support for various languages
- [Win32] Added OpenWatcom compiler support (thanks Sebastian
Schuberth!)
- [Win32] Changed fallback timer from GetTickCount to timeGetTime,
which usually provides better resolution
- [Win32] Bugfix: Accumulator buffer selection should be more
robust
- [Win32] Bugfix: If stereo rendering is requested, and no stereo pixel
format could be created, glfwOpenWindow now fails
- [Win32] Bugfix: glfwSetWindowSize now sets the size of the client
area, NOT the entire window, meaning that there is a 1:1 relationship
between glfwSetWindowSize and glfwGetWindowSize
- [X11] Added FreeBSD and QNX support
- [X11] Added support for non-pthread capable systems
- [X11] Hopefully more robust configuration script (compile.sh)
- [X11] Bugfix: When mouse cursor is hidden, mouse sensitivity is no
longer degraded
- [X11] Bugfix: Source files EOL was PC style (CR/LF) in v2.4.1 (blame
my WinCVS configuration)
- [X11] Bugfix: When a GLFW window is closed, input focus is properly
released
- [X11] Bugfix: Iconification of fullscreen windows should now work
properly
- [x86 CPUs] Improved RDTSC timing (e.g. RDTSC support on single-CPU
Intel Hyper-Threading enabled systems)
- [AmigaOS] Added joystick support
- [AmigaOS] Mouse cursor positioning is now implemented
- [AmigaOS] Added support for Geek Gadgets GCC
- [AmigaOS] Bugfix: glfwGetWindowParam now returns proper values for
all parameters (except for GLFW_ACCELERATED)
v2.4.1
- Added AmigaOS support (preliminary)
- GLFW for the X Window System now works under Mac OS X
- [Win32] Bugfix: glfwWaitCond treated the timeout as milliseconds
instead of seconds
- [X11] Bugfix: GLFW should now compile under IRIX v5.3
- [X11] Bugfix: GLFW should now compile with Kylix
v2.4
- Major source code rearrangement - much code is now shared between
different platforms, and it should be easier to port GLFW to new
platforms
- Added a Unicode keyboard text input interface (CharCallback)
- Keyboard key input is now slightly more internationalized: GLFW now
uses 8-bit ISO-8859-1 encoding for keys representing printable
characters (e.g. "Ö", "§", etc), as
opposed to the previous 7-bit US-ASCII encoding
- Added more key constants (F13-F25, keypad '=')
- Added an enable/disable swicth for automatic event polling from
glfwSwapBuffers
- [X11] Added support for sysctl for querying the number of processors
in the system (if POSIX sysconf is not supported)
- [X11] Bugfix: compile.sh now works with Sun sh (and hopefully others
too)
- [X11] Bugfix: compile.sh now detects the need for -ldl when dlopen is
used
- [Win32] Bugfix: When closing a fullscreen window under Win 9x/NT4,
the task bar icon now disappears properly
- [Win32] Bugfix: GLFW should now compile on a wider range of MSVC
compilers (e.g. .NET) - Thanks Tim Little!
v2.3.2
- Removed the silly limitation of 100 threads (the thread information
is now kept in a linked list)
- General source cleanup (window state is now kept in a single
struct, plus some other minor changes)
- [X11] Added Solaris gethrtime() support (not tested yet), which
should give an improved timer for Sun/Solaris stations
- [X11] Some fixes to the 'compile.sh' script (-O for non-gcc compilers
and 'make x11-gcc' should now really force GCC)
v2.3.1
- [X11] A minimalist configuration script was added that solves the
issue with glXGetProcAddressARB, and unifies all Unix/X11 Makefiles
into one template Makefile (well, one for GLFW, and one for the
examples)
v2.3
- Added OpenGL stereo rendering support
- Added a function for parsing the OpenGL version string
(glfwGetGLVersion)
- [x86] Bugfix: Hopefully the CPU core clock dependent timer RDTSC will
never be used on CPUs with variable core frequencies anymore
- [X11] Bugfix: GLFW could create stereo rendering capable windows,
even if it was not requested (GLFW v2.2.x did not support selection
of stereo rendering)
- [X11] Bugfix: glfwGetProcAddress returned NULL on most systems (even
on those that supported glXGetProcAddressARB). Now GLFW assumes that
glXGetProcAddressARB is supported on all systems, which solves the
bug, but may result in compiler errors on some systems (please let me
know if you have any related problems).
v2.2.3
- Bugfix: Checking for GL_SGIS_generate_mipmap is more robust
- Bugfix: glfwLoadTexture2D will now fail if no window is opened
- [Win32] Bugfix: Right shift was not detected under Win 9x/ME (it is
still not as good as under NT/2K/XP, but at least you get right
shifts)
- [X11] Bugfix: Visuals are now selected more accurately. For instance,
glfwOpenWindow will no longer fail if you request a 24-bit color
buffer if only 16-bit color visuals are available (which means that
pong3d should work on 16-bit displays).
v2.2.2
- [Win32] Bugfix: Windows did not always get focus (this was a tough
one!)
- [Win32] Bugfix: glfwGetWindowParam did not work with
GLFW_ACCUM_*_BITS or GLFW_AUX_BUFFERS
- [X11] Bugfix: Linux joystick Y axis positions were reversed
v2.2.1
- [X11] Added joystick support for Linux
v2.2
- Added joystick support (only supported under Windows so far)
- Added joystick controls to pong3d.c (only 3 more lines of code)
- Added glfwOpenWindowHint() function
- It is now possible to specify a desired vertical monitor refresh
rate (for fullscreen windows)
- It is now possible to request an accumulator buffer and auxiliary
buffers
- Added glfwSetTime() function
- Added a GLFW conversion of the MESA/GLUT gears.c demo to the example
programs
- [Win32] gdi32.dll and winmm.dll are now loaded dynamically when
glfwInit() is called. This means that there is no need to link with
gdi32.lib or winmm.lib when using the static version of GLFW, which
should make GLFW usage more convenient.
- [Win32] Bugfix: Greatly improved keyboard input (detect left/right
CTRL etc)
- [Win32] Bugfix: glfwExtensionSupported now detects all WGL extensions
(e.g. WGL_ARB_pbuffer)
- [Win32] Bugfix: Mouse cursor was not re-hidden when a GLFW window was
deselected and then selected again (with ALT+TAB)
- [X11] Bugfix: Minor bug in the SGI timer - and ugly (unintended) SGI
timer debug info removed
- [X11] Bugfix: glfwGetDesktopMode and glfwGetVideoModes no longer give
segmentation faults if no X server is available
v2.1
- Added image and texture loading capabilities (support for the TGA
file format at the moment)
- Added a new example program (mipmaps.c) for showing off the automatic
mipmap generation and texture loading capabilities of GLFW 2.1
- Removed the separate TGA loader (tga.c in the examples directory)
since texture loading is supported natively by GLFW. Also updated the
Pong3D demo to use GLFW texture loading instead of tga.c.
- Improved keyboard handling (e.g. numeric keypad keys can be
detected)
- Added a new example program, keytest.c
- Changed the GLFWvidmode structure and the corresponding API functions
to report pure color bits instead of the confusing (and unportable)
"BPP" field
- Changed glfwSetWindowSize so that it operates in fullscreen mode
too
- Added mouse wheel support under Windows (not Win95) and X11
- Added window iconification functions (glfwInconifyWindow and
glfwRestoreWindow)
- Improved iconification and deactivation handling under both Windows
and X11
- Made it possible to turn on/off key repeat (the default is now no key
repeat)
- Added SGI hardware timer support (CLOCK_SGI_CYCLE) for improved
timer resolution for SGI computers
- Added support for the free Borland C++ Builder 5.x compiler for
Windows
- Made it possible to compiler GLFW as a Windows DLL using any of the
supported compilers
- Some constants have changed names (e.g. GLFW_REDBITS is now called
GLFW_RED_BITS)
- Updated GLFW documentation (GLFW Users Guide and GLFW Reference
Manual) to reflect the changes in the API
- [Win32] Bugfix: Corrected Cygwin toplevel makefile entry
- [Win32] Bugfix: Fixed event lag bug
- [Win32] Bugfix: Fixed Radeon 8500 crash
- [X11] Bugfix: Fixed the window close bug
- [X11] Bugfix: Iconification/deactivation is now detected
- [X11] Bugfix: Non-OpenGL visuals are not listed anymore
- [X11] Bugfix: Undesired video mode changes on XFree86 are now prevented
v2.0.3
- Added precise CPU cycle based timing support (RDTSC) for x86
CPUs (under both Windows and Unix)
- Added a makefile option for building for Windows with Cygwin
- Corrected the CC for Unix/X11 makefiles (-Wall is usually not a
supported flag for CC, so it was removed from the CFLAGS list)
v2.0.2
- Added a makefile option for building for X11 with 'cc' rather than
'gcc' (useful for IRIX users for instance).
- [Win32] Bugfix: Mouse coordinates are now relative to the window
upper left corner, which also means that disabling the mouse cursor
in windowed mode should work much better.
- [X11] Bugfix: Added a bunch of more keys that are recognized by
GLFW.
- [X11] Bugfix: glfwGetNumberOfProcessors now works for IRIX (earlier
versions of GLFW would not compile under IRIX).
v2.0.1
- glfwTerminate() will now be called automatically upon normal program
termination (using atexit())
- [Win32] Bugfix: Buffer-swapping did not work if a window lost
focus.
- [Win32] Bugfix: Top level Makefile did not work under Windows
9x.
- [Win32] Bugfix: NULL declaratoin in glfw.h was not MSVC 7.x
compatible.
- [X11] Bugfix: GLFW would not build with C++ (e.g. g++).
v2.0
- GLFW is no longer a single source file, but an entire link library.
- Added multi threading support.
- Added more window control.
- New distribution layout (both Win32 and X11 version in same archive).
- Added GLFW Users Manual and GLFW Reference Manual as PDF files.
- Some bugfixes.
v1.0.2
- Improved fullscreen functionality.
- Added fullscreen support for X11.
v1.0.1
- Added support for the X Window System.
- Fixed bugs.
v1.0.0
- First release.
- Only supported Windows.
6. Directory structure of the GLFW distribution
Here is an overview of the directory structure of the GLFW distribution:
docs | | GLFW manuals in PDF format |
examples | | Several example programs in C |
include | | |
GL | | Here is the GLFW C/C++ include file |
lib | | The source code for GLFW |
cocoa | | Mac OS X/Cocoa specific implementation |
win32 | | Windows specific implementation |
x11 | | Unix/X11 specific implementation |
support | | |
d | | D support |
msvc90 | | Project files for Visual C++ 9.0 |
pascal | | Pascal support |
tests | | Several test programs in C |
7. Contacting the project
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
.
8. Acknowledgements
GLFW exists because people around the world donated their time and lent
their skills. Special thanks go out to:
- artblanc, for a patch replacing a deprecated Core Graphics call
- Bobyshev Alexander and Martins Mozeiko, for the original proposal of
an FSAA hint and their work on the Win32 implementation of FSAA
- Keith Bauer, for his invaluable help with porting and maintaining GLFW on
Mac OS X, and for his many ideas
- John Bartholomew, for adding proper version number and soname to the
shared library build
- Lambert Clara, for a bug fix for the modes test
- Jarrod Davis, for the Delphi port of GLFW
- Olivier Delannoy, for the initial implementation of FSAA support on
X11, cross-compiling support for MinGW and general extreme usefulness
- Paul R. Deppe, who helped with Cygwin support, and made an
adaption of PLIB
so that it can use GLFW (instead of GLUT)
- Jonathan Dummer, for submitting a patch fixing an input bug on Win32 and
adding logic for the
GLFW_ICON
resource
- Ralph Eastwood, for the initial design and implementation of the gamma
correction and clipboard APIs
- GeO4d, for the implementation of cursor enter/leave notifications on
Win32.
- Gerald Franz, who made GLFW compile under IRIX, and supplied patches
for the X11 keyboard translation routine
- Marcus Geelnard, the original author and long-time maintainer of GLFW,
without whose brilliant work none of this would have happened
- Stefan Gustavson, for quick and thorough testing of GLFW on many and
varied operating systems and hardware configurations
- Sylvain Hellegouarch, for support, bug reports and testing
- Alex Holkner, for writing the code from which the Compiz/Intel fix was
stolen
- Toni Jovanoski, for helping with the MASM32 port of GLFW, and
supplying the example program and fixed OpenGL and GLU bindings for
MASM32
- Cameron King, for reporting a hidden cursor mouse bug on X11
- Peter Knut, for his many and detailed reports of difficult to find input
bugs
- Robin Leffmann, for his work on Mac OS X and other platforms, and his
invaluable support
- Glenn Lewis, for helping out with support for the D programming
language
- Shane Liesegang, for providing a bug fix relating to Cocoa window
restoration and reporting a bug on 32-bit Cocoa builds
- Tristam MacDonald, for his bug reports and feedback on the Cocoa port
- Hans 'Hanmac' Mackowiak, for the initial implementation of cursor
enter/leave callbacks on X11, adding UTF-8 window title support on X11 and
a fix for the Xkb support
- David Medlock, for doing the initial Lua port
- Marcel Metz, for the initial implementation of multi-monitor support on
X11 and Win32
- Kenneth Miller, for his many and detailed bug reports on Win32
- Jeff Molofee, the author of the excellent OpenGL tutorials at NeHe Productions.
Much of the Windows code of GLFW was originally based on Jeff's
code
- Julian Møller, for reporting a bug in the Cocoa joystick code
- Arturo J. Pérez, for a bug fix for cursor tracking on Mac OS X 10.6 Snow
Leopard
- Riku Salminen, for the initial implementation of
glfwShowWindow
and glfwHideWindow
, for the idea of
glfwDefaultWindowHints
and for making the X11 event processing
able to support multi-threaded rendering
- Douglas C. Schmidt and Irfan Pyarali, for their excellent article
Strategies for Implementing POSIX Condition Variables on Win32
- Sebastian Schuberth, for the OpenWatcom makefiles
- Matt Sealey, for helping with the MorphOS port
- Steve Sexton, for reporting an input bug in the Carbon port
- Dmitri Shuralyov, for support, bug reports, bug fixes and testing
- Daniel Skorupski, for reporting a bug in the Win32 DEF file
- Bradley Smith, for his updates of the D support and his ports of the
remaining examples to the D language
- Julian Squires, for submitting a patch for a bug in the key repeat logic on X11
- Johannes Stein, for maintaining the Pascal bindings
- Sergey Tikhomirov, for the initial implementation of joystick support on
Mac OS X
- Samuli Tuomola, for support, bug reports and testing
- Torsten Walluhn, for fixing various compilation issues on OS X
- Frank Wille, for helping with the AmigaOS port and making GLFW
compile under IRIX 5.3
- Santi Zupancic, for support, bug reports and testing
- Lasse Öörni, for submitting patches for the input code of the Win32 and X11 ports
- Дмитри Малышев, for the idea of a
GLFW_NO_GLU
macro
- blanco, for submitting a patch for a deprecation bug in the Cocoa port
- heromyth, for reporting a bug in the D bindings
- Ozzy @ Orkysquad,
for his dedication to GLFW, for debugging my source, and for his
valuable experience with game development
- Peoro, for reporting a bug in the
_NET_WM_PING
response
- TTK-Bandit, for submitting a number of input patches adding many missing
keys to the Win32 and X11 ports
- yuriks, for reporting a bug in Win32 context creation
- All the unmentioned and anonymous contributors in the GLFW community, for
bug reports, patches, feedback and encouragement
- OpenGL.org, and all the people on
the discussion forums there that have provided help during the development of
GLFW