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

..03-May-2022-

CMake/H01-Jul-2018-306254

deps/H01-Jul-2018-40,65432,510

include/GLFW/H01-Jul-2018-6,096659

src/H03-May-2022-29,62522,490

.gitignoreH A D01-Jul-20181,021 7671

LICENSE.mdH A D01-Jul-2018925 2316

README.mdH A D01-Jul-201818.1 KiB464412

cmake_uninstall.cmake.inH A D01-Jul-20181.1 KiB3025

README.md

1# GLFW
2
3[![Build status](https://travis-ci.org/glfw/glfw.svg?branch=master)](https://travis-ci.org/glfw/glfw)
4[![Build status](https://ci.appveyor.com/api/projects/status/0kf0ct9831i5l6sp/branch/master?svg=true)](https://ci.appveyor.com/project/elmindreda/glfw)
5[![Coverity Scan](https://scan.coverity.com/projects/4884/badge.svg)](https://scan.coverity.com/projects/glfw-glfw)
6
7## Introduction
8
9GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan
10application development.  It provides a simple, platform-independent API for
11creating windows, contexts and surfaces, reading input, handling events, etc.
12
13GLFW natively supports Windows, macOS and Linux and other Unix-like systems.
14Experimental implementations for the Wayland protocol and the Mir display server
15are available but not yet officially supported.
16
17GLFW is licensed under the [zlib/libpng
18license](http://www.glfw.org/license.html).
19
20The latest stable release is version 3.2.1.
21
22See the [downloads](http://www.glfw.org/download.html) page for details and
23files, or fetch the `latest` branch, which always points to the latest stable
24release.  Each release starting with 3.0 also has a corresponding [annotated
25tag](https://github.com/glfw/glfw/releases) with source and binary archives.
26The [version history](http://www.glfw.org/changelog.html) lists all user-visible
27changes for every release.
28
29This is a development branch for version 3.3, which is _not yet described_.
30Pre-release documentation is available [here](http://www.glfw.org/docs/3.3/).
31
32The `master` branch is the stable integration branch and _should_ always compile
33and run on all supported platforms, although details of newly added features may
34change until they have been included in a release.  New features and many bug
35fixes live in [other branches](https://github.com/glfw/glfw/branches/all) until
36they are stable enough to merge.
37
38If you are new to GLFW, you may find the
39[tutorial](http://www.glfw.org/docs/latest/quick.html) for GLFW 3 useful.  If
40you have used GLFW 2 in the past, there is a [transition
41guide](http://www.glfw.org/docs/latest/moving.html) for moving to the GLFW
423 API.
43
44
45## Compiling GLFW
46
47GLFW itself requires only the headers and libraries for your window system.  It
48does not need the headers for any context creation API (WGL, GLX, EGL, NSGL,
49OSMesa) or rendering API (OpenGL, OpenGL ES, Vulkan) to enable support for them.
50
51GLFW supports compilation on Windows with Visual C++ 2010 and later, MinGW and
52MinGW-w64, on macOS with Clang and on Linux and other Unix-like systems with GCC
53and Clang.  It will likely compile in other environments as well, but this is
54not regularly tested.
55
56There are [pre-compiled Windows binaries](http://www.glfw.org/download.html)
57available for all supported compilers.
58
59See the [compilation guide](http://www.glfw.org/docs/latest/compile.html) for
60more information about how to compile GLFW yourself.
61
62
63## Using GLFW
64
65See the [documentation](http://www.glfw.org/docs/latest/) for tutorials, guides
66and the API reference.
67
68
69## Contributing to GLFW
70
71See the [contribution
72guide](https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md) for
73more information.
74
75
76## System requirements
77
78GLFW supports Windows XP and later and macOS 10.7 and later.  Linux and other
79Unix-like systems running the X Window System are supported even without
80a desktop environment or modern extensions, although some features require
81a running window or clipboard manager.  The OSMesa backend requires Mesa 6.3.
82
83See the [compatibility guide](http://www.glfw.org/docs/latest/compat.html)
84in the documentation for more information.
85
86
87## Dependencies
88
89GLFW itself depends only on the headers and libraries for your window system.
90
91The (experimental) Wayland backend also depends on the `extra-cmake-modules`
92package, which is used to generated Wayland protocol headers.
93
94The examples and test programs depend on a number of tiny libraries.  These are
95located in the `deps/` directory.
96
97 - [getopt\_port](https://github.com/kimgr/getopt_port/) for examples
98   with command-line options
99 - [TinyCThread](https://github.com/tinycthread/tinycthread) for threaded
100   examples
101 - An OpenGL 3.2 core loader generated by
102   [glad](https://github.com/Dav1dde/glad) for examples using modern OpenGL
103 - [linmath.h](https://github.com/datenwolf/linmath.h) for linear algebra in
104   examples
105 - [Nuklear](https://github.com/vurtun/nuklear) for test and example UI
106 - [stb\_image\_write](https://github.com/nothings/stb) for writing images to disk
107 - [Vulkan headers](https://www.khronos.org/registry/vulkan/) for Vulkan tests
108
109The Vulkan example additionally requires the LunarG Vulkan SDK to be installed,
110or it will not be included in the build.  On macOS you need to provide the path
111to the SDK manually as it has no standard installation location.
112
113The documentation is generated with [Doxygen](http://doxygen.org/) if CMake can
114find that tool.
115
116
117## Reporting bugs
118
119Bugs are reported to our [issue tracker](https://github.com/glfw/glfw/issues).
120Please check the [contribution
121guide](https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md) for
122information on what to include when reporting a bug.
123
124
125## Changelog
126
127- Added `glfwGetError` function for querying the last error code and its
128  description (#970)
129- Added `glfwUpdateGamepadMappings` function for importing gamepad mappings in
130  SDL\_GameControllerDB format (#900)
131- Added `glfwJoystickIsGamepad` function for querying whether a joystick has
132  a gamepad mapping (#900)
133- Added `glfwGetJoystickGUID` function for querying the SDL compatible GUID of
134  a joystick (#900)
135- Added `glfwGetGamepadName` function for querying the name provided by the
136  gamepad mapping (#900)
137- Added `glfwGetGamepadState` function, `GLFW_GAMEPAD_*` and `GLFWgamepadstate`
138  for retrieving gamepad input state (#900)
139- Added `glfwGetWindowContentScale`, `glfwGetMonitorContentScale` and
140  `glfwSetWindowContentScaleCallback` for DPI-aware rendering
141  (#235,#439,#677,#845,#898)
142- Added `glfwRequestWindowAttention` function for requesting attention from the
143  user (#732,#988)
144- Added `glfwGetKeyScancode` function that allows retrieving platform dependent
145  scancodes for keys (#830)
146- Added `glfwSetWindowMaximizeCallback` and `GLFWwindowmaximizefun` for
147  receiving window maximization events (#778)
148- Added `glfwSetWindowAttrib` function for changing window attributes (#537)
149- Added `glfwGetJoystickHats` function for querying joystick hats
150  (#889,#906,#934)
151- Added `glfwInitHint` for setting initialization hints
152- Added `glfwWindowHintString` for setting string type window hints (#893,#1139)
153- Added `glfwGetWindowOpacity` and `glfwSetWindowOpacity` for controlling whole
154  window transparency (#1089)
155- Added `glfwSetMonitorUserPointer` and `glfwGetMonitorUserPointer` for
156  per-monitor user pointers
157- Added `glfwSetJoystickUserPointer` and `glfwGetJoystickUserPointer` for
158  per-joystick user pointers
159- Added `glfwGetX11SelectionString` and `glfwSetX11SelectionString`
160  functions for accessing X11 primary selection (#894,#1056)
161- Added headless [OSMesa](http://mesa3d.org/osmesa.html) backend (#850)
162- Added definition of `GLAPIENTRY` to public header
163- Added `GLFW_TRANSPARENT_FRAMEBUFFER` window hint and attribute for controlling
164  per-pixel framebuffer transparency (#197,#663,#715,#723,#1078)
165- Added `GLFW_HOVERED` window attribute for polling cursor hover state (#1166)
166- Added `GLFW_CENTER_CURSOR` window hint for controlling cursor centering
167  (#749,#842)
168- Added `GLFW_JOYSTICK_HAT_BUTTONS` init hint (#889)
169- Added `GLFW_LOCK_KEY_MODS` input mode and `GLFW_MOD_*_LOCK` mod bits (#946)
170- Added macOS specific `GLFW_COCOA_RETINA_FRAMEBUFFER` window hint
171- Added macOS specific `GLFW_COCOA_FRAME_NAME` window hint (#195)
172- Added macOS specific `GLFW_COCOA_GRAPHICS_SWITCHING` window hint (#377,#935)
173- Added macOS specific `GLFW_COCOA_CHDIR_RESOURCES` init hint
174- Added macOS specific `GLFW_COCOA_MENUBAR` init hint
175- Added X11 specific `GLFW_X11_CLASS_NAME` and `GLFW_X11_INSTANCE_NAME` window
176  hints (#893,#1139)
177- Added `GLFW_INCLUDE_ES32` for including the OpenGL ES 3.2 header
178- Added `GLFW_OSMESA_CONTEXT_API` for creating OpenGL contexts with
179  [OSMesa](https://www.mesa3d.org/osmesa.html) (#281)
180- Added `GenerateMappings.cmake` script for updating gamepad mappings
181- Made `glfwCreateWindowSurface` emit an error when the window has a context
182  (#1194,#1205)
183- Deprecated window parameter of clipboard string functions
184- Deprecated charmods callback
185- Removed `GLFW_USE_RETINA` compile-time option
186- Removed `GLFW_USE_CHDIR` compile-time option
187- Removed `GLFW_USE_MENUBAR` compile-time option
188- Bugfix: Calling `glfwMaximizeWindow` on a full screen window was not ignored
189- Bugfix: `GLFW_INCLUDE_VULKAN` could not be combined with the corresponding
190          OpenGL and OpenGL ES header macros
191- Bugfix: `glfwGetInstanceProcAddress` returned `NULL` for
192          `vkGetInstanceProcAddr` when `_GLFW_VULKAN_STATIC` was enabled
193- Bugfix: Invalid library paths were used in test and example CMake files (#930)
194- Bugfix: The scancode for synthetic key release events was always zero
195- Bugfix: The generated Doxyfile did not handle paths with spaces (#1081)
196- [Win32] Added system error strings to relevant GLFW error descriptions (#733)
197- [Win32] Moved to `WM_INPUT` for disabled cursor mode motion input (#125)
198- [Win32] Removed XInput circular deadzone from joystick axis data (#1045)
199- [Win32] Bugfix: Undecorated windows could not be iconified by the user (#861)
200- [Win32] Bugfix: Deadzone logic could underflow with some controllers (#910)
201- [Win32] Bugfix: Bitness test in `FindVulkan.cmake` was VS specific (#928)
202- [Win32] Bugfix: `glfwVulkanSupported` emitted an error on systems with
203                  a loader but no ICD (#916)
204- [Win32] Bugfix: Non-iconified full sreeen windows did not prevent screen
205                  blanking or password enabled screensavers (#851)
206- [Win32] Bugfix: Mouse capture logic lost secondary release messages (#954)
207- [Win32] Bugfix: The 32-bit Vulkan loader library static was not searched for
208- [Win32] Bugfix: Vulkan libraries have a new path as of SDK 1.0.42.0 (#956)
209- [Win32] Bugfix: Monitors with no display devices were not enumerated (#960)
210- [Win32] Bugfix: Monitor events were not emitted (#784)
211- [Win32] Bugfix: The Cygwin DLL was installed to the wrong directory (#1035)
212- [Win32] Bugfix: Normalization of axis data via XInput was incorrect (#1045)
213- [Win32] Bugfix: `glfw3native.h` would undefine a foreign `APIENTRY` (#1062)
214- [Win32] Bugfix: Disabled cursor mode prevented use of caption buttons
215                  (#650,#1071)
216- [Win32] Bugfix: Returned key names did not match other platforms (#943)
217- [Win32] Bugfix: Undecorated windows did not maximize to workarea (#899)
218- [Win32] Bugfix: Window was resized twice when entering full screen (#1085)
219- [Win32] Bugfix: The HID device notification was not unregistered (#1170)
220- [Win32] Bugfix: `glfwCreateWindow` activated window even with `GLFW_FOCUSED`
221                  hint set to false (#1179,#1180)
222- [X11] Moved to XI2 `XI_RawMotion` for disable cursor mode motion input (#125)
223- [X11] Replaced `_GLFW_HAS_XF86VM` compile-time option with dynamic loading
224- [X11] Bugfix: `glfwGetVideoMode` would segfault on Cygwin/X
225- [X11] Bugfix: Dynamic X11 library loading did not use full sonames (#941)
226- [X11] Bugfix: Window creation on 64-bit would read past top of stack (#951)
227- [X11] Bugfix: XDND support had multiple non-conformance issues (#968)
228- [X11] Bugfix: The RandR monitor path was disabled despite working RandR (#972)
229- [X11] Bugfix: IM-duplicated key events would leak at low polling rates (#747)
230- [X11] Bugfix: Gamma ramp setting via RandR did not validate ramp size
231- [X11] Bugfix: Key name string encoding depended on current locale (#981,#983)
232- [X11] Bugfix: Incremental reading of selections was not supported (#275)
233- [X11] Bugfix: Selection I/O reported but did not support `COMPOUND_TEXT`
234- [X11] Bugfix: Latin-1 text read from selections was not converted to UTF-8
235- [X11] Bugfix: NVidia EGL would segfault if unloaded before closing the display
236- [Linux] Added workaround for missing `SYN_DROPPED` in pre-2.6.39 kernel
237          headers (#1196)
238- [Linux] Moved to evdev for joystick input (#906,#1005)
239- [Linux] Bugfix: Event processing did not detect joystick disconnection (#932)
240- [Linux] Bugfix: The joystick device path could be truncated (#1025)
241- [Linux] Bugfix: `glfwInit` would fail if inotify creation failed (#833)
242- [Linux] Bugfix: `strdup` was used without any required feature macro (#1055)
243- [Cocoa] Added support for Vulkan window surface creation via
244          [MoltenVK](https://moltengl.com/moltenvk/) (#870)
245- [Cocoa] Added support for loading a `MainMenu.nib` when available
246- [Cocoa] Bugfix: Disabling window aspect ratio would assert (#852)
247- [Cocoa] Bugfix: Window creation failed to set first responder (#876,#883)
248- [Cocoa] Bugfix: Removed use of deprecated `CGDisplayIOServicePort` function
249                  (#165,#192,#508,#511)
250- [Cocoa] Bugfix: Disabled use of deprecated `CGDisplayModeCopyPixelEncoding`
251                  function on macOS 10.12+
252- [Cocoa] Bugfix: Running in AppSandbox would emit warnings (#816,#882)
253- [Cocoa] Bugfix: Windows created after the first were not cascaded (#195)
254- [Cocoa] Bugfix: Leaving video mode with `glfwSetWindowMonitor` would set
255                  incorrect position and size (#748)
256- [Cocoa] Bugfix: Iconified full screen windows could not be restored (#848)
257- [Cocoa] Bugfix: Value range was ignored for joystick hats and buttons (#888)
258- [Cocoa] Bugfix: Full screen framebuffer was incorrectly sized for some video
259                  modes (#682)
260- [Cocoa] Bugfix: A string object for IME was updated non-idiomatically (#1050)
261- [Cocoa] Bugfix: A hidden or disabled cursor would become visible when a user
262                  notification was shown (#971,#1028)
263- [Cocoa] Bugfix: Some characters did not repeat due to Press and Hold (#1010)
264- [Cocoa] Bugfix: Window title was lost when full screen or undecorated (#1082)
265- [Cocoa] Bugfix: Window was resized twice when entering full screen (#1085)
266- [Cocoa] Bugfix: Duplicate size events were not filtered (#1085)
267- [Cocoa] Bugfix: Event polling did not initialize AppKit if necessary (#1218)
268- [WGL] Added support for `WGL_EXT_colorspace` for OpenGL ES contexts
269- [WGL] Added support for `WGL_ARB_create_context_no_error`
270- [GLX] Added support for `GLX_ARB_create_context_no_error`
271- [GLX] Bugfix: Context creation could segfault if no GLXFBConfigs were
272                available (#1040)
273- [EGL] Added support for `EGL_KHR_get_all_proc_addresses` (#871)
274- [EGL] Added support for `EGL_KHR_context_flush_control`
275- [EGL] Bugfix: The test for `EGL_RGB_BUFFER` was invalid
276
277
278## Contact
279
280On [glfw.org](http://www.glfw.org/) you can find the latest version of GLFW, as
281well as news, documentation and other information about the project.
282
283If you have questions related to the use of GLFW, we have a
284[forum](http://discourse.glfw.org/), and the `#glfw` IRC channel on
285[Freenode](http://freenode.net/).
286
287If you have a bug to report, a patch to submit or a feature you'd like to
288request, please file it in the
289[issue tracker](https://github.com/glfw/glfw/issues) on GitHub.
290
291Finally, if you're interested in helping out with the development of GLFW or
292porting it to your favorite platform, join us on the forum, GitHub or IRC.
293
294
295## Acknowledgements
296
297GLFW exists because people around the world donated their time and lent their
298skills.
299
300 - Bobyshev Alexander
301 - Matt Arsenault
302 - David Avedissian
303 - Keith Bauer
304 - John Bartholomew
305 - Niklas Behrens
306 - Niklas Bergström
307 - Denis Bernard
308 - Doug Binks
309 - blanco
310 - Kyle Brenneman
311 - Rok Breulj
312 - Martin Capitanio
313 - David Carlier
314 - Arturo Castro
315 - Chi-kwan Chan
316 - Ian Clarkson
317 - Michał Cichoń
318 - Lambert Clara
319 - Yaron Cohen-Tal
320 - Omar Cornut
321 - Andrew Corrigan
322 - Bailey Cosier
323 - Noel Cower
324 - Jason Daly
325 - Jarrod Davis
326 - Olivier Delannoy
327 - Paul R. Deppe
328 - Michael Dickens
329 - Роман Донченко
330 - Mario Dorn
331 - Wolfgang Draxinger
332 - Jonathan Dummer
333 - Ralph Eastwood
334 - Fredrik Ehnbom
335 - Robin Eklind
336 - Siavash Eliasi
337 - Felipe Ferreira
338 - Michael Fogleman
339 - Gerald Franz
340 - Mário Freitas
341 - GeO4d
342 - Marcus Geelnard
343 - Stephen Gowen
344 - Kovid Goyal
345 - Eloi Marín Gratacós
346 - Stefan Gustavson
347 - Jonathan Hale
348 - Sylvain Hellegouarch
349 - Matthew Henry
350 - heromyth
351 - Lucas Hinderberger
352 - Paul Holden
353 - Warren Hu
354 - IntellectualKitty
355 - Aaron Jacobs
356 - Erik S. V. Jansson
357 - Toni Jovanoski
358 - Arseny Kapoulkine
359 - Cem Karan
360 - Osman Keskin
361 - Josh Kilmer
362 - Cameron King
363 - Peter Knut
364 - Christoph Kubisch
365 - Yuri Kunde Schlesner
366 - Konstantin Käfer
367 - Eric Larson
368 - Robin Leffmann
369 - Glenn Lewis
370 - Shane Liesegang
371 - Eyal Lotem
372 - Tristam MacDonald
373 - Hans Mackowiak
374 - Дмитри Малышев
375 - Zbigniew Mandziejewicz
376 - Célestin Marot
377 - Kyle McDonald
378 - David Medlock
379 - Bryce Mehring
380 - Jonathan Mercier
381 - Marcel Metz
382 - Liam Middlebrook
383 - Jonathan Miller
384 - Kenneth Miller
385 - Bruce Mitchener
386 - Jack Moffitt
387 - Jeff Molofee
388 - Pierre Morel
389 - Jon Morton
390 - Pierre Moulon
391 - Martins Mozeiko
392 - Julian Møller
393 - ndogxj
394 - Kristian Nielsen
395 - Kamil Nowakowski
396 - Denis Ovod
397 - Ozzy
398 - Andri Pálsson
399 - Peoro
400 - Braden Pellett
401 - Christopher Pelloux
402 - Arturo J. Pérez
403 - Anthony Pesch
404 - Orson Peters
405 - Emmanuel Gil Peyrot
406 - Cyril Pichard
407 - Keith Pitt
408 - Stanislav Podgorskiy
409 - Alexandre Pretyman
410 - przemekmirek
411 - Philip Rideout
412 - Eddie Ringle
413 - Jorge Rodriguez
414 - Ed Ropple
415 - Aleksey Rybalkin
416 - Riku Salminen
417 - Brandon Schaefer
418 - Sebastian Schuberth
419 - Christian Sdunek
420 - Matt Sealey
421 - Steve Sexton
422 - Arkady Shapkin
423 - Yoshiki Shibukawa
424 - Dmitri Shuralyov
425 - Daniel Skorupski
426 - Bradley Smith
427 - Patrick Snape
428 - Erlend Sogge Heggen
429 - Julian Squires
430 - Johannes Stein
431 - Pontus Stenetorp
432 - Michael Stocker
433 - Justin Stoecker
434 - Elviss Strazdins
435 - Paul Sultana
436 - Nathan Sweet
437 - TTK-Bandit
438 - Sergey Tikhomirov
439 - Arthur Tombs
440 - Ioannis Tsakpinis
441 - Samuli Tuomola
442 - Matthew Turner
443 - urraka
444 - Elias Vanderstuyft
445 - Stef Velzel
446 - Jari Vetoniemi
447 - Ricardo Vieira
448 - Nicholas Vitovitch
449 - Simon Voordouw
450 - Corentin Wallez
451 - Torsten Walluhn
452 - Patrick Walton
453 - Xo Wang
454 - Jay Weisskopf
455 - Frank Wille
456 - Ryogo Yoshimura
457 - Andrey Zholos
458 - Santi Zupancic
459 - Jonas Ådahl
460 - Lasse Öörni
461 - All the unmentioned and anonymous contributors in the GLFW community, for bug
462   reports, patches, feedback, testing and encouragement
463
464