Files
2026-03-03 13:56:44 +08:00
..
2026-03-03 13:56:44 +08:00
2026-03-03 13:56:44 +08:00
2026-03-03 13:56:44 +08:00
2026-03-03 13:56:44 +08:00

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>GLFW Readme File</title>
</head>

<body>

<h1>GLFW 2.7.9 Win32 binary distribution</h1>

<ol>
 <li><a href="#intro">Introduction</a></li>
 <li><a href="#using">Using GLFW</a></li>
 <li><a href="#changelog">Version history</a></li>
 <li><a href="#structure">Directory structure of the GLFW distribution</a></li>
 <li><a href="#contact">Contacting the project</a></li>
 <li><a href="#credits">Acknowledgements</a></li>
</ol>

<a name="intro"></a>
<h2>1. Introduction</h2>

<p>Welcome to version 2.7.9 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.</p>

<p>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.</p>

<p>This release adds fixes for multiple cursor motion bugs on Windows and fixes
support for the <code>LFLAGS</code> environment variable on OS X.</p>

<p>For a full list of changes, see the
<a href="#changelog">version history</a>.</p>

<p>Please note that this is the <em>Windows 32-bit binary only</em> 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:</p>

<ul>
  <li>MinGW</li>
  <li>Visual C++ 2008 (release runtime)</li>
  <li>Visual C++ 2010 (release runtime)</li>
  <li>Visual C++ 2012 (release runtime)</li>
</ul>
  
<p>For the full source distribition, go to the
<a href="http://www.glfw.org/">GLFW website</a> or to the
<a href="http://sourceforge.net/projects/glfw/">project page</a> on SF.net.</p>


<a name="using"></a>
<h2>2. Using GLFW</h2>

<p>There are two aspects to using GLFW:</p>

<ol>
  <li>How does the GLFW API work</li>
  <li>How to compile programs that use GLFW</li>
</ol>

<p>The first point is covered in the
<a href="docs/UsersGuide.pdf">GLFW Users Guide</a> and the
<a href="docs/Reference.pdf">GLFW Reference Manual</a>, and we suggest that you
read at least the Users Guide, since it's a good introduction to the GLFW
API.</p>

<p>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.</p>

<h3>2.1 Include the GLFW header file</h3>

<p>In the files of your program where you use OpenGL or GLFW, you should
include the <code>GL/glfw.h</code> header file, i.e.:</p>

<blockquote><code>#include &lt;GL/glfw.h&gt;</code></blockquote>

<p>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.</p>

<p>For example, under Microsoft Windows you are normally required to include
<code>windows.h</code> before you include <code>GL/gl.h</code>.  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.</p>

<p>The GLFW header file takes care of this for you, not by including
<code>windows.h</code>, but rather by itself duplicating the necessary parts of
it.  This way, the namespace won't be cluttered by the entire Windows API.</p>

<p>By default, the regular <code>gl.h</code> OpenGL header is included. If you
wish to include the draft <code>gl3.h</code> header instead, define
<code>GLFW_INCLUDE_GL3</code> before the inclusion of the GLFW header.</p>

<p>By default, the <code>glu.h</code> GLU header is included.  If you wish to
avoid this, define <code>GLFW_NO_GLU</code> before the inclusion of the GLFW
header.</p>

<p>In other words:
<ul>
  <li>Do <em>not</em> include <code>gl.h</code> or <code>glu.h</code>
      yourself, as GLFW does this for you</li>
  <li>Do <em>not</em> include <code>windows.h</code> unless you need
      direct access to the Windows API</li>
  <li>If you <em>do</em> include <code>windows.h</code>, do it
      <em>before</em> including <code>GL/glfw.h</code>.  The GLFW header will
      detect this and act appropriately.</li>
</ul>

<p>Also note that if you are using an OpenGL extension loading library such as
<a href="http://glew.sourceforge.net/">GLEW</a>, you should include the GLEW
header <em>before</em> the GLFW one.  The GLEW header defines macros that
disable any <code>gl.h</code> that the GLFW header includes and GLEW will work
as expected.</p>



<h3>2.2 Link with the right libraries</h3>

<h4>2.2.1 Windows static library</h4>

<p>If you link with the static version of GLFW, it is also necessary to
link with some system libraries that GLFW uses.</p>

<p>When linking a program under Windows that uses the static version of GLFW,
you must also link with the following libraries: <code>opengl32</code>,
<code>user32</code> and <code>kernel32</code>. 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 <code>glu32</code>):</p>

<table border=1>
  <tr>
    <td><b>Compiler</b></td>
    <td><b>Link options</b></td>
  </tr>
  <tr>
    <td>Borland C++ Builder</td>
    <td><code>glfw.lib opengl32.lib</code></td>
  </tr>
  <tr>
    <td>Cygwin</td>
    <td><i>See Unix static library below</i></td>
  </tr>
  <tr>
    <td>LCC-Win32</td>
    <td><code>glfw.lib opengl32.lib</code></td>
  </tr>
  <tr>
    <td>Microsoft Visual C++</td>
    <td><code>glfw.lib opengl32.lib</code></td>
  </tr>
  <tr>
    <td>MinGW and MinGW-w64</td>
    <td><code>-lglfw -lopengl32</code></td>
  </tr>
  <tr>
    <td>OpenWatcom</td>
    <td><code>glfw.lib opengl32.lib user32.lib</code></td>
  </tr>
</table>


<h4>2.2.2 Windows DLL</h4>

<p>To compile a program that uses the DLL version of GLFW, you need to
define the <code>GLFW_DLL</code> constant. This can either be done with a
compiler switch, typically by adding <code>-DGLFW_DLL</code> to the list of
compiler options. You can also do it by adding the following line to all your
source files <b>before</b> including the GLFW header file:</p>

<blockquote><code>#define GLFW_DLL</code></blockquote>

<p>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 <code>glfwdll</code>.
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 <code>opengl32</code> and <code>glu32</code>):</p>

<table border=1>
  <tr>
    <td><b>Compiler</b></td>
    <td><b>Link options</b></td>
  </tr>
  <tr>
    <td>Borland C++ Builder</td>
    <td><code>glfwdll.lib</code></td>
  </tr>
  <tr>
    <td>Cygwin</td>
    <td><code>-lglfwdll</code></td>
  </tr>
  <tr>
    <td>LCC-Win32</td>
    <td><code>glfwdll.lib</code></td>
  </tr>
  <tr>
    <td>Microsoft Visual C++</td>
    <td><code>glfwdll.lib</code></td>
  </tr>
  <tr>
    <td>MinGW and MinGW-w64</td>
    <td><code>-lglfwdll</code></td>
  </tr>
  <tr>
    <td>OpenWatcom</td>
    <td><code>glfwdll.lib</code></td>
  </tr>
</table>



<h4>2.2.3 Unix static library</h4>

<p>GLFW supports
<a href="http://pkgconfig.freedesktop.org/wiki/">pkg-config</a>,
and a <code>libglfw.pc</code> 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.</p>

<p>A typical compile and link command-line when using the GLFW static library
may look like this:</p>

<blockquote><code>cc `pkg-config --cflags libglfw` -o myprog myprog.c `pkg-config --static --libs libglfw`</code></blockquote>

<p>When using the GLFW sharedd library it may look like this:</p>

<blockquote><code>cc `pkg-config --cflags libglfw` -o myprog myprog.c `pkg-config --libs libglfw`</code></blockquote>

<p>If you use GLU functions in your program you should also add
<code>-lGLU</code> to your link flags.</p>



<h4>2.2.5 Mac OS X static library</h4>

<p>When compiling and linking a program under Mac OS X that uses GLFW, you
must also link with Cocoa and OpenGL frameworks.

<p>If you are using Xcode, you simply add the GLFW library <code>libglfw.a</code> 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.</p>

<p>GLFW supports
<a href="http://pkgconfig.freedesktop.org/wiki/">pkg-config</a>, 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
<a href="http://www.finkproject.org/">Fink</a> and
<a href="http://www.macports.org/">MacPorts</a>, 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:</p>

<blockquote><code>cc `pkg-config --cflags libglfw` -o myprog myprog.c `pkg-config --libs libglfw`</code></blockquote>

<p>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 <code>-l</code> and
<code>-framework</code> switches, i.e.:</p>

<blockquote><code>cc -o myprog myprog.c -lglfw -framework Cocoa -framework OpenGL -framework IOKit</code></blockquote>

<p>Note that you do not add the .framework extension to a framework when adding
it from the command-line.</p>

<p>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 <em>not</em> work with the Mac OS X native
version of GLFW.</p>

<a name="changelog"></a>
<h2>3. Version history</h2>

<h3>v2.7.9</h3>
<ul>
  <li>[Cocoa] Bugfix: The dynamic library makefile rule did not use <code>LFLAGS</code></li>
  <li>[Win32] Bugfix: Enabling or disabling the cursor for an inactive window did nothing (backported from 3.0)</li>
  <li>[Win32] Bugfix: The locked cursor was re-centered when the window was inactive (backported from 3.0)</li>
  <li>[Win32] Bugfix: The cursor clip rectangle included the title bar (backported from 3.0)</li>
</ul>


<a name="structure"></a>
<h2>4. Directory structure of the GLFW distribution</h2>

<p>Here is an overview of the directory structure of the GLFW distribution:</p>

<table border=0 cellspacing=0>
<tr valign="top"><td width=100><code>docs</code></td><td>GLFW manuals in PDF format</td></tr>
<tr valign="top"><td><code>include</code></td><td>&nbsp;</td></tr>
<tr valign="top"><td><code>&nbsp;&nbsp;&nbsp;GL</code></td><td>The GLFW C/C++ include file</td></tr>
<tr valign="top"><td><code>lib-mingw</code></td><td>Binaries for MinGW</td></tr>
<tr valign="top"><td><code>lib-msvc90</code></td><td>Binaries for Visual C++ 2008 release configuration</td></tr>
<tr valign="top"><td><code>lib-msvc100</code></td><td>Binaries for Visual C++ 2010 release configuration</td></tr>
<tr valign="top"><td><code>lib-msvc110</code></td><td>Binaries for Visual C++ 2012 release configuration</td></tr>
</table>


<a name="contact"></a>
<h2>5. Contacting the project</h2>

<p>The official website for GLFW is <a href="http://www.glfw.org/">glfw.org</a>.
It contains the latest version of GLFW, news and other information that is
useful for OpenGL development.</p>

<p>If you have questions related to the use of GLFW, we have a
<a href="https://sourceforge.net/forum/forum.php?forum_id=247562">user's web forum</a>,
and the registered IRC channel <code>#glfw</code> on
<a href="http://freenode.net/">Freenode</a>.</p>

<p>If you have a bug to report, a patch to submit or a feature you'd like to
request, please file an issue in the
<a href="https://github.com/glfw/glfw-legacy/issues">issue trackers</a>.</p>

Finally, if you're interested in helping out with the development of
GLFW or porting it to your favorite platform, we have a
<a href="https://lists.stacken.kth.se/mailman/listinfo/glfw-dev">developer's mailing list</a>,
or you could join us on <code>#glfw</code>.


<a name="credits"></a>
<h2>6. Acknowledgements</h2>

<p>GLFW exists because people around the world donated their time and lent
their skills.  Special thanks go out to:</p>

<ul>

  <li>artblanc, for a patch replacing a deprecated Core Graphics call</li>

  <li>Bobyshev Alexander and Martins Mozeiko, for the original proposal of
  an FSAA hint and their work on the Win32 implementation of FSAA</li>

  <li>Keith Bauer, for his invaluable help with porting and maintaining GLFW on
  Mac OS X, and for his many ideas</li>

  <li>Jarrod Davis, for the Delphi port of GLFW</li>

  <li>Olivier Delannoy, for the initial implementation of FSAA support on
  X11, cross-compiling support for MinGW and general extreme usefulness</li>

  <li>Paul R. Deppe, who helped with Cygwin support, and made an
  adaption of <a href="http://plib.sourceforge.net/">PLIB</a>
  so that it can use GLFW (instead of GLUT)</li>

  <li>Jonathan Dummer, for submitting a patch fixing an input bug on Win32 and
  adding logic for the GLFW_ICON resource</li>

  <li>Gerald Franz, who made GLFW compile under IRIX, and supplied patches
  for the X11 keyboard translation routine</li>

  <li>Marcus Geelnard, the original author and long-time maintainer of GLFW,
  without whose brilliant work none of this would have happened</li>

  <li>Stefan Gustavson, for quick and thorough testing of GLFW on many and
  varied operating systems and hardware configurations</li>

  <li>Sylvain Hellegouarch, for support, bug reports and testing</li>

  <li>Alex Holkner, for writing the code from which the Compiz/Intel fix was
  stolen</li>

  <li>Toni Jovanoski, for helping with the MASM32 port of GLFW, and
  supplying the example program and fixed OpenGL and GLU bindings for
  MASM32</li>

  <li>Cameron King, for reporting a hidden cursor mouse bug on X11</li>

  <li>Peter Knut, for his many and detailed reports of difficult to find input
  bugs</li>

  <li>Robin Leffmann, for his work on Mac OS X and other platforms, and his
  invaluable support</li>

  <li>Glenn Lewis, for helping out with support for the D programming
  language</li>

  <li>Shane Liesegang, for providing a bug fix relating to Cocoa window
  restoration and reporting several Cocoa bugs</li>

  <li>Tristam MacDonald, for his bug reports and feedback on the Cocoa port</li>

  <li>David Medlock, for doing the initial Lua port</li>

  <li>Kenneth Miller, for his many and detailed bug reports on Win32</li>

  <li>Jeff Molofee, the author of the excellent OpenGL tutorials at <a
  href="http://nehe.gamedev.net/">NeHe Productions</a>.
  Much of the Windows code of GLFW was originally based on Jeff's
  code</li>

  <li>Douglas C. Schmidt and Irfan Pyarali, for their excellent article
  <a href="http://www.cs.wustl.edu/~schmidt/win32-cv-1.html">Strategies for Implementing POSIX Condition Variables on Win32</a></li>

  <li>Sebastian Schuberth, for the OpenWatcom makefiles</li>

  <li>Matt Sealey, for helping with the MorphOS port</li>

  <li>Steve Sexton, for reporting an input bug in the Carbon port</li>

  <li>Dmitri Shuralyov, for support, bug reports, bug fixes and testing</li>

  <li>Daniel Skorupski, for reporting a bug in the Win32 DEF file</li>

  <li>Bradley Smith, for his updates of the D support and his ports of the
  remaining examples to the D language</li>

  <li>Julian Squires, for submitting a patch for a bug in the key repeat logic on X11</li>

  <li>Liam Staskawicz, for finding a bug in the termination logic of the OS X port</li>

  <li>Johannes Stein, for maintaining the Pascal bindings</li>

  <li>Cort Stratton, for reporting two bugs related to the creation of debug
  contexts</li>

  <li>Sergey Tikhomirov, for the initial implementation of joystick support on
  Mac OS X</li>

  <li>Samuli Tuomola, for support, bug reports and testing</li>

  <li>Frank Wille, for helping with the AmigaOS port and making GLFW
  compile under IRIX 5.3</li>

  <li>Yaniel, for fixing a bug with fullscreen windows using OpenGL 3.0 contexts on Cocoa</li>

  <li>Santi Zupancic, for support, bug reports and testing</li>

  <li>Lasse Öörni, for submitting patches for the input code of the Win32 and X11 ports</li>

  <li>Дмитри Малышев, for the idea of a GLFW_NO_GLU macro</li>

  <li>blanco, for submitting a patch for a deprecation bug in the Cocoa port</li>

  <li>heromyth, for reporting a bug in the D bindings</li>

  <li>Ozzy @ <a href="http://www.orkysquad.org">Orkysquad</a>,
  for his dedication to GLFW, for debugging my source, and for his
  valuable experience with game development</li>

  <li>Peoro, for reporting a bug in the <code>_NET_WM_PING</code> response</li>

  <li>TTK-Bandit, for submitting a number of input patches adding many missing
  keys to the Win32 and X11 ports</li>

  <li>yuriks, for reporting a bug in Win32 context creation</li>

  <li>All the unmentioned and anonymous contributors in the GLFW community, for
  bug reports, patches, feedback and encouragement</li>

  <li><a href="http://www.opengl.org/">OpenGL.org</a>, and all the people on
  the discussion forums there that have provided help during the development of
  GLFW</li>

</ul>

</body>
</html>