• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..23-Mar-2014-

CMake/H23-Mar-2014-12193

deps/H23-Mar-2014-14,60513,170

docs/H03-May-2022-3,9142,767

examples/H03-May-2022-2,7531,714

include/GLFW/H23-Mar-2014-2,463468

src/H03-May-2022-15,14510,350

tests/H03-May-2022-3,2252,115

.gitignoreH A D23-Mar-2014949 7166

README.mdH A D23-Mar-201410.1 KiB319232

cmake_uninstall.cmake.inH A D23-Mar-20141.1 KiB3025

README.md

1# GLFW
2
3## Introduction
4
5GLFW is a free, Open Source, portable library for OpenGL and OpenGL ES
6application development.  It provides a simple, platform-independent API for
7creating windows and contexts, reading input, handling events, etc.
8
9Version 3.0.3 adds fixes for a number of bugs that together affect all supported
10platforms, most notably MinGW compilation issues and cursor mode issues on OS X.
11As this is a patch release, there are no API changes.
12
13If you are new to GLFW, you may find the
14[introductory tutorial](http://www.glfw.org/docs/latest/quick.html) for GLFW
153 useful.  If you have used GLFW 2 in the past, there is a
16[transition guide](http://www.glfw.org/docs/latest/moving.html) for moving to
17the GLFW 3 API.
18
19
20## Compiling GLFW
21
22### Dependencies
23
24To compile GLFW and the accompanying example programs, you will need **CMake**,
25which will generate the project files or makefiles for your particular
26development environment.  If you are on a Unix-like system such as Linux or
27FreeBSD or have a package system like Fink, MacPorts, Cygwin or Homebrew, you
28can simply install its CMake package.  If not, you can get installers for
29Windows and OS X from the [CMake website](http://www.cmake.org/).
30
31Additional dependencies are listed below.
32
33
34#### Visual C++ on Windows
35
36The Microsoft Platform SDK that is installed along with Visual C++ contains all
37the necessary headers, link libraries and tools except for CMake.
38
39
40#### MinGW or MinGW-w64 on Windows
41
42These packages contain all the necessary headers, link libraries and tools
43except for CMake.
44
45
46#### MinGW or MinGW-w64 cross-compilation
47
48Both Cygwin and many Linux distributions have MinGW or MinGW-w64 packages.  For
49example, Cygwin has the `mingw64-i686-gcc` and `mingw64-x86_64-gcc` packages
50for 32- and 64-bit version of MinGW-w64, while Debian GNU/Linux and derivatives
51like Ubuntu have the `mingw-w64` package for both.
52
53GLFW has CMake toolchain files in the `CMake/` directory that allow for easy
54cross-compilation of Windows binaries.  To use these files you need to add a
55special parameter when generating the project files or makefiles:
56
57    cmake -DCMAKE_TOOLCHAIN_FILE=<toolchain-file> .
58
59The exact toolchain file to use depends on the prefix used by the MinGW or
60MinGW-w64 binaries on your system.  You can usually see this in the /usr
61directory.  For example, both the Debian/Ubuntu and Cygwin MinGW-w64 packages
62have `/usr/x86_64-w64-mingw32` for the 64-bit compilers, so the correct
63invocation would be:
64
65    cmake -DCMAKE_TOOLCHAIN_FILE=CMake/x86_64-w64-mingw32.cmake .
66
67For more details see the article
68[CMake Cross Compiling](http://www.paraview.org/Wiki/CMake_Cross_Compiling) on
69the CMake wiki.
70
71
72#### Xcode on OS X
73
74Xcode contains all necessary tools except for CMake.  The necessary headers and
75libraries are included in the core OS frameworks.  Xcode can be downloaded from
76the Mac App Store.
77
78
79#### Unix-like systems with X11
80
81To compile GLFW for X11, you need to have the X11 and OpenGL header packages
82installed, as well as the basic development tools like GCC and make.  For
83example, on Ubuntu and other distributions based on Debian GNU/Linux, you need
84to install the `xorg-dev` and `libglu1-mesa-dev` packages.  The former pulls in
85all X.org header packages and the latter pulls in the Mesa OpenGL and GLU
86packages.  Note that using header files and libraries from Mesa during
87compilation *will not* tie your binaries to the Mesa implementation of OpenGL.
88
89
90### Generating with CMake
91
92Once you have all necessary dependencies, it is time to generate the project
93files or makefiles for your development environment.  CMake needs to know two
94paths for this: the path to the source directory and the target path for the
95generated files and compiled binaries.  If these are the same, it is called an
96in-tree build, otherwise it is called an out-of-tree build.
97
98One of several advantages of out-of-tree builds is that you can generate files
99and compile for different development environments using a single source tree.
100
101
102#### Using CMake from the command-line
103
104To make an in-tree build, enter the root directory of the GLFW source tree and
105run CMake.  The current directory is used as target path, while the path
106provided as an argument is used to find the source tree.
107
108    cd <glfw-root-dir>
109    cmake .
110
111To make an out-of-tree build, make another directory, enter it and run CMake
112with the (relative or absolute) path to the root of the source tree as an
113argument.
114
115    cd <glfw-root-dir>
116    mkdir build
117    cd build
118    cmake ..
119
120
121#### Using the CMake GUI
122
123If you are using the GUI version, choose the root of the GLFW source tree as
124source location and the same directory or another, empty directory as the
125destination for binaries.  Choose *Configure*, change any options you wish to,
126*Configure* again to let the changes take effect and then *Generate*.
127
128
129### CMake options
130
131The CMake files for GLFW provide a number of options, although not all are
132available on all supported platforms.  Some of these are de facto standards
133among CMake users and so have no `GLFW_` prefix.
134
135If you are using the GUI version of CMake, these are listed and can be changed
136from there.  If you are using the command-line version, use the `ccmake` tool.
137Some package systems like Ubuntu and other distributions based on Debian
138GNU/Linux have this tool in a separate `cmake-curses-gui` package.
139
140
141#### Shared options
142
143`BUILD_SHARED_LIBS` determines whether GLFW is built as a static
144library or as a DLL / shared library / dynamic library.
145
146`LIB_SUFFIX` affects where the GLFW shared /dynamic library is
147installed.  If it is empty, it is installed to `$PREFIX/lib`.  If it is set to
148`64`, it is installed to `$PREFIX/lib64`.
149
150`GLFW_BUILD_EXAMPLES` determines whether the GLFW examples are built
151along with the library.
152
153`GLFW_BUILD_TESTS` determines whether the GLFW test programs are
154built along with the library.
155
156
157#### OS X specific options
158
159`GLFW_USE_CHDIR` determines whether `glfwInit` changes the current
160directory of bundled applications to the `Contents/Resources` directory.
161
162`GLFW_USE_MENUBAR` determines whether the first call to
163`glfwCreateWindow` sets up a minimal menu bar.
164
165`GLFW_BUILD_UNIVERSAL` determines whether to build Universal Binaries.
166
167
168#### Windows specific options
169
170`USE_MSVC_RUNTIME_LIBRARY_DLL` determines whether to use the DLL version or the
171static library version of the Visual C++ runtime library.
172
173`GLFW_USE_DWM_SWAP_INTERVAL` determines whether the swap interval is set even
174when DWM compositing is enabled.  This can lead to severe jitter and is not
175usually recommended.
176
177`GLFW_USE_OPTIMUS_HPG` determines whether to export the `NvOptimusEnablement`
178symbol, which forces the use of the high-performance GPU on nVidia Optimus
179systems.
180
181
182#### EGL specific options
183
184`GLFW_USE_EGL` determines whether to use EGL instead of the platform-specific
185context creation API.  Note that EGL is not yet provided on all supported
186platforms.
187
188`GLFW_CLIENT_LIBRARY` determines which client API library to use.  If set to
189`opengl` the OpenGL library is used, if set to `glesv1` for the OpenGL ES 1.x
190library is used, or if set to `glesv2` the OpenGL ES 2.0 library is used.  The
191selected library and its header files must be present on the system for this to
192work.
193
194
195## Installing GLFW
196
197A rudimentary installation target is provided for all supported platforms via
198CMake.
199
200
201## Using GLFW
202
203See the [GLFW documentation](http://www.glfw.org/docs/latest/).
204
205
206## Changelog
207
208 - [Win32] Bugfix: `_WIN32_WINNT` was not set to Windows XP or later
209 - [Win32] Bugfix: Legacy MinGW needs `WINVER` and `UNICODE` before `stddef.h`
210 - [Cocoa] Bugfix: Cursor was not visible in normal mode in full screen
211 - [Cocoa] Bugfix: Cursor was not actually hidden in hidden mode
212 - [Cocoa] Bugfix: Cursor modes were not applied to inactive windows
213 - [X11] Bugfix: Events for mouse buttons 4 and above were not reported
214 - [X11] Bugfix: CMake 2.8.7 does not set `X11_Xinput_LIB` even when found
215
216
217## Contact
218
219The official website for GLFW is [glfw.org](http://www.glfw.org/).  There you
220can find the latest version of GLFW, as well as news, documentation and other
221information about the project.
222
223If you have questions related to the use of GLFW, we have a
224[support forum](https://sourceforge.net/p/glfw/discussion/247562/), and the IRC
225channel `#glfw` on [Freenode](http://freenode.net/).
226
227If you have a bug to report, a patch to submit or a feature you'd like to
228request, please file it in the
229[issue tracker](https://github.com/glfw/glfw/issues) on GitHub.
230
231Finally, if you're interested in helping out with the development of GLFW or
232porting it to your favorite platform, we have an occasionally active
233[developer's mailing list](https://lists.stacken.kth.se/mailman/listinfo/glfw-dev),
234or you could join us on `#glfw`.
235
236
237## Acknowledgements
238
239GLFW exists because people around the world donated their time and lent their
240skills.
241
242 - Bobyshev Alexander
243 - artblanc
244 - arturo
245 - Matt Arsenault
246 - Keith Bauer
247 - John Bartholomew
248 - Niklas Behrens
249 - Niklas Bergström
250 - Doug Binks
251 - blanco
252 - Lambert Clara
253 - Noel Cower
254 - Jarrod Davis
255 - Olivier Delannoy
256 - Paul R. Deppe
257 - Jonathan Dummer
258 - Ralph Eastwood
259 - Gerald Franz
260 - GeO4d
261 - Marcus Geelnard
262 - Stefan Gustavson
263 - Sylvain Hellegouarch
264 - heromyth
265 - Paul Holden
266 - Toni Jovanoski
267 - Osman Keskin
268 - Cameron King
269 - Peter Knut
270 - Robin Leffmann
271 - Glenn Lewis
272 - Shane Liesegang
273 - Дмитри Малышев
274 - Martins Mozeiko
275 - Tristam MacDonald
276 - Hans Mackowiak
277 - Kyle McDonald
278 - David Medlock
279 - Jonathan Mercier
280 - Marcel Metz
281 - Kenneth Miller
282 - Bruce Mitchener
283 - Jeff Molofee
284 - Jon Morton
285 - Pierre Moulon
286 - Julian Møller
287 - Ozzy
288 - Peoro
289 - Braden Pellett
290 - Arturo J. Pérez
291 - Jorge Rodriguez
292 - Ed Ropple
293 - Riku Salminen
294 - Sebastian Schuberth
295 - Matt Sealey
296 - SephiRok
297 - Steve Sexton
298 - Dmitri Shuralyov
299 - Daniel Skorupski
300 - Bradley Smith
301 - Julian Squires
302 - Johannes Stein
303 - Justin Stoecker
304 - Nathan Sweet
305 - TTK-Bandit
306 - Sergey Tikhomirov
307 - Samuli Tuomola
308 - Jari Vetoniemi
309 - Simon Voordouw
310 - Torsten Walluhn
311 - Jay Weisskopf
312 - Frank Wille
313 - yuriks
314 - Santi Zupancic
315 - Lasse Öörni
316 - All the unmentioned and anonymous contributors in the GLFW community, for bug
317   reports, patches, feedback, testing and encouragement
318
319