-Starting from release 1.1.0, the source code and parts of the
-documentation are automatically generated from the extension
-specifications in a two-step process. In the first step,
-specification files from the OpenGL registry are downloaded and
-parsed. Skeleton descriptors are created for each extension. These
-descriptors contain all necessary information for creating the source
-code and documentation in a simple and compact format, including the
-name of the extension, url link to the specification, tokens, function
-declarations, typedefs and struct definitions. In the second step,
-the header files as well as the library and glewinfo source are
-generated from the descriptor files. The code generation scripts are
-located in the auto subdirectory.
-
-
-
-The code generation scripts require GNU make, wget, and perl. On
-Windows, the simplest way to get access to these tools is to install
-Cygwin, but make sure that the
-root directory is mounted in binary mode. The makefile in the
-auto directory provides the following build targets:
-
-
-
-
-
make
-
-
Create the source files from the descriptors. If the
-descriptors do not exist, create them from the spec files. If the spec
-files do not exist, download them from the OpenGL repository.
-
make clean
-
-
Delete the source files.
-
make clobber
-
-
Delete the source files and the descriptors.
-
make destroy
-
-
Delete the source files, the descriptors, and the spec files.
-
make custom
-
-
Create the source files for the extensions
-listed in auto/custom.txt. See "Custom Code
-Generation" below for more details.
-
-
-
-
Adding a New Extension
-
-
-To add a new extension, create a descriptor file for the extension in
-auto/core and rerun the code generation scripts by typing
-make clean; make in the auto directory.
-
-
-
-The format of the descriptor file is given below. Items in
-brackets are optional.
-
-Take a look at one of the files in auto/core for an
-example. Note that typedefs and function signatures should not be
-terminated with a semicolon.
-
-
-
Custom Code Generation
-
-Starting from GLEW 1.3.0, it is possible to control which extensions
-to include in the libarary by specifying a list in
-auto/custom.txt. This is useful when you do not need all the
-extensions and would like to reduce the size of the source files.
-Type make clean; make custom in the auto directory
-to rerun the scripts with the custom list of extensions.
-
-
-
-For example, the following is the list of extensions needed to get GLEW and the
-utilities to compile.
-
Starting with release 1.2.0, thread-safe support for multiple
-rendering contexts, possibly with different capabilities, is
-available. Since this is not required by most users, it is not added
-to the binary releases to maintain compatibility between different
-versions. To include multi-context support, you have to do the
-following:
-
-
Compile and use GLEW with the GLEW_MX preprocessor token
-defined.
-
For each rendering context, create a GLEWContext object
-that will be available as long as the rendering context exists.
-
Define a macro or function called glewGetContext() that
-returns a pointer to the GLEWContext object associated with
-the rendering context from which OpenGL/WGL/GLX calls are issued. This
-dispatch mechanism is primitive, but generic.
-
Make sure that you call glewInit() after creating the
-GLEWContext object in each rendering context. Note, that the
-GLEWContext pointer returned by glewGetContext() has
-to reside in global or thread-local memory.
-
-
-
Note that according to the MSDN
-WGL documentation, you have to initialize the entry points for
-every rendering context that use pixel formats with different
-capabilities For example, the pixel formats provided by the generic
-software OpenGL implementation by Microsoft vs. the hardware
-accelerated pixel formats have different capabilities. GLEW by
-default ignores this requirement, and does not define per-context
-entry points (you can however do this using the steps described
-above). Assuming a global namespace for the entry points works in
-most situations, because typically all hardware accelerated pixel
-formats provide the same entry points and capabilities. This means
-that unless you use the multi-context version of GLEW, you need to
-call glewInit() only once in your program, or more precisely,
-once per process.
-
-
Separate Namespace
-
-
-To avoid name clashes when linking with libraries that include the
-same symbols, extension entry points are declared in a separate
-namespace (release 1.1.0 and up). This is achieved by aliasing OpenGL
-function names to their GLEW equivalents. For instance,
-glFancyFunction is simply an alias to
-glewFancyFunction. The separate namespace does not effect
-token and function pointer definitions.
-
-
-
Known Issues
-
-
-GLEW requires GLX 1.2 for compatibility with GLUT.
-
-First you need to create a valid OpenGL rendering context and call
-glewInit() to initialize the extension entry points. If
-glewInit() returns GLEW_OK, the initialization
-succeeded and you can use the available extensions as well as core
-OpenGL functionality. For example:
-
-Starting from GLEW 1.1.0, you can find out if a particular extension
-is available on your platform by querying globally defined variables
-of the form GLEW_{extension_name}:
-
-
-
-if (GLEW_ARB_vertex_program)
-{
- /* It is safe to use the ARB_vertex_program extension here. */
- glGenProgramsARB(...);
-}
-
-
-
-In GLEW 1.0.x, a global structure was used for this task. To ensure
-binary compatibility between releases, the struct was replaced with a
-set of variables.
-
-
-
-You can also check for core OpenGL functionality. For example, to
-see if OpenGL 1.3 is supported, do the following:
-
-In general, you can check if GLEW_{extension_name} or
-GLEW_VERSION_{version} is true or false.
-
-
-
-It is also possible to perform extension checks from string
-input. Starting from the 1.3.0 release, use glewIsSupported
-to check if the required core or extension functionality is
-available:
-
-
-
-if (glewIsSupported("GL_VERSION_1_4 GL_ARB_point_sprite"))
-{
- /* Great, we have OpenGL 1.4 + point sprites. */
-}
-
-
-
-For extensions only, glewGetExtension provides a slower alternative
-(GLEW 1.0.x-1.2.x). Note that in the 1.3.0 release
-glewGetExtensionwas replaced with
-glewIsSupported.
-
-
-
-if (glewGetExtension("GL_ARB_fragment_program"))
-{
- /* Looks like ARB_fragment_program is supported. */
-}
-
-
-
Experimental Drivers
-
-
-GLEW obtains information on the supported extensions from the graphics
-driver. Experimental or pre-release drivers, however, might not
-report every available extension through the standard mechanism, in
-which case GLEW will report it unsupported. To circumvent this
-situation, the glewExperimental global switch can be turned
-on by setting it to GL_TRUE before calling
-glewInit(), which ensures that all extensions with valid
-entry points will be exposed.
-
-
-
Platform Specific Extensions
-
-
-Platform specific extensions are separated into two header files:
-wglew.h and glxew.h, which define the available
-WGL and GLX extensions. To determine if a certain
-extension is supported, query WGLEW_{extension name} or
-GLXEW_{extension_name}. For example:
-
-
-
-#include <GL/wglew.h>
-
-if (WGLEW_ARB_pbuffer)
-{
- /* OK, we can use pbuffers. */
-}
-else
-{
- /* Sorry, pbuffers will not work on this platform. */
-}
-
-
-
-Alternatively, use wglewIsSupported or
-glxewIsSupported to check for extensions from a string:
-
-
-
-if (wglewIsSupported("WGL_ARB_pbuffer"))
-{
- /* OK, we can use pbuffers. */
-}
-
-
-
Utilities
-
-
-GLEW provides two command-line utilities: one for creating a list of
-available extensions and visuals; and another for verifying extension
-entry points.
-
-
-
visualinfo: extensions and visuals
-
-
-visualinfo is an extended version of glxinfo. The
-Windows version creates a file called visualinfo.txt, which
-contains a list of available OpenGL, WGL, and GLU extensions as well
-as a table of visuals aka. pixel formats. Pbuffer and MRT capable
-visuals are also included. For additional usage information, type
-visualinfo -h.
-
-
-
glewinfo: extension verification utility
-
-
-glewinfo allows you to verify the entry points for the
-extensions supported on your platform. The Windows version
-reports the results to a text file called glewinfo.txt. The
-Unix version prints the results to stdout.
-
-
-
Windows usage:
-
glewinfo [-pf <id>]
-
-
where <id> is the pixel format id for which the
-capabilities are displayed.
-
-
Unix usage:
-
glewinfo [-display <dpy>] [-visual <id>]
-
-
where <dpy> is the X11 display and <id> is
-the visual id for which the capabilities are displayed.
-GLEW was developed by Milan
-Ikits and Marcelo
-Magallon. They also perform occasional maintainance to make sure
-that GLEW stays in mint condition. Aaron Lefohn, Joe Kniss, and Chris
-Wyman were the first users and also assisted with the design and
-debugging process. The acronym GLEW originates from Aaron Lefohn.
-Pasi Kärkkäinen identified and fixed several problems with
-GLX and SDL. Nate Robins created the wglinfo utility, to
-which modifications were made by Michael Wimmer.
-
-
-
Copyright
-
-
-GLEW is originally derived from the EXTGL project by Lev Povalahev.
-The source code is licensed under the Modified BSD
-License, the Mesa 3-D License (MIT
-License), and the Khronos License (MIT
-License). The automatic code generation scripts are released under
-the GNU GPL.
-
-
-
diff --git a/extern/glew-1.5.8/doc/glew.png b/extern/glew-1.5.8/doc/glew.png
deleted file mode 100644
index d46550f194..0000000000
Binary files a/extern/glew-1.5.8/doc/glew.png and /dev/null differ
diff --git a/extern/glew-1.5.8/doc/glew.txt b/extern/glew-1.5.8/doc/glew.txt
deleted file mode 100644
index 31a31d3dbe..0000000000
--- a/extern/glew-1.5.8/doc/glew.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-The OpenGL Extension Wrangler Library
-Copyright (C) 2002-2008, Milan Ikits
-Copyright (C) 2002-2008, Marcelo E. Magallon
-Copyright (C) 2002, Lev Povalahev
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* The name of the author may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/extern/glew-1.5.8/doc/glxew.html b/extern/glew-1.5.8/doc/glxew.html
deleted file mode 100644
index 30f8ff9bed..0000000000
--- a/extern/glew-1.5.8/doc/glxew.html
+++ /dev/null
@@ -1,171 +0,0 @@
-
-
-
-
-
-
-GLEW: The OpenGL Extension Wrangler Library
-
-
-
-
-
-
-
diff --git a/extern/glew-1.5.8/doc/gpl.txt b/extern/glew-1.5.8/doc/gpl.txt
deleted file mode 100644
index b7b5f53df1..0000000000
--- a/extern/glew-1.5.8/doc/gpl.txt
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/extern/glew-1.5.8/doc/index.html b/extern/glew-1.5.8/doc/index.html
deleted file mode 100644
index 18d3f7a506..0000000000
--- a/extern/glew-1.5.8/doc/index.html
+++ /dev/null
@@ -1,204 +0,0 @@
-
-
-
-
-
-
-GLEW: The OpenGL Extension Wrangler Library
-
-
-
-
-
-The OpenGL Extension Wrangler Library (GLEW) is a cross-platform
-open-source C/C++ extension loading library. GLEW provides efficient
-run-time mechanisms for determining which OpenGL extensions are
-supported on the target platform. OpenGL core and extension
-functionality is exposed in a single header file. GLEW has been
-tested on a variety of operating systems, including Windows, Linux,
-Mac OS X, FreeBSD, Irix, and Solaris.
-
-
-
Download Center
-
-GLEW is distributed
-as source and precompiled binaries. The latest release is
-1.5.8
-[01-31-11]:
-
-To use the shared library version of GLEW, you need to copy the
-headers and libraries into their destination directories. On Windows
-this typically boils down to copying:
-
-
-
-
bin/glew32.dll
to
-
%SystemRoot%/system32
-
lib/glew32.lib
to
-
{VC Root}/Lib
-
include/GL/glew.h
to
-
{VC Root}/Include/GL
-
include/GL/wglew.h
to
-
{VC Root}/Include/GL
-
-
-
-
-
-where {VC Root} is the Visual C++ root directory, typically
-C:/Program Files/Microsoft Visual Studio/VC98 for Visual
-Studio 6.0 or C:/Program Files/Microsoft Visual
-Studio .NET 2003/Vc7/PlatformSDK for Visual Studio .NET.
-
-
-
-On Unix, typing make install will attempt to install GLEW
-into /usr/include/GL and /usr/lib. You can
-customize the installation target via the GLEW_DEST
-environment variable if you do not have write access to these
-directories.
-
-
-
Building Your Project with GLEW
-
-There are two ways to build your project with GLEW.
-
-
Including the source files / project file
-
-The simpler but less flexible way is to include glew.h and
-glew.c into your project. On Windows, you also need to
-define the GLEW_STATIC preprocessor token when building a
-static library or executable, and the GLEW_BUILD preprocessor
-token when building a dll. You also need to replace
-<GL/gl.h> and <GL/glu.h> with
-<glew.h> in your code and set the appropriate include
-flag (-I) to tell the compiler where to look for it. For
-example:
-
-
-#include <glew.h>
-#include <GL/glut.h>
-<gl, glu, and glut functionality is available here>
-
-
-Depending on where you put glew.h you may also need to change
-the include directives in glew.c. Note that if you are using
-GLEW together with GLUT, you have to include glew.h first.
-In addition, glew.h includes glu.h, so you do not
-need to include it separately.
-
-
-On Windows, you also have the option of adding the supplied project
-file glew_static.dsp to your workspace (solution) and compile
-it together with your other projects. In this case you also need to
-change the GLEW_BUILD preprocessor constant to
-GLEW_STATIC when building a static library or executable,
-otherwise you get build errors.
-
-
-Note that GLEW does not use the C
-runtime library, so it does not matter which version (single-threaded,
-multi-threaded or multi-threaded DLL) it is linked with (without
-debugging information). It is, however, always a good idea to compile all
-your projects including GLEW with the same C runtime settings.
-
-
-
Using GLEW as a shared library
-
-
-Alternatively, you can use the provided project files / makefile to
-build a separate shared library you can link your projects with later.
-In this case the best practice is to install glew.h,
-glew32.lib, and glew32.dll / libGLEW.so to
-where the OpenGL equivalents gl.h, opengl32.lib, and
-opengl32.dll / libGL.so are located. Note that you
-need administrative privileges to do this. If you do not have
-administrator access and your system administrator will not do it for
-you, you can install GLEW into your own lib and include subdirectories
-and tell the compiler where to find it. Then you can just replace
-<GL/gl.h> with <GL/glew.h> in your
-program:
-
-
-
-#include <GL/glew.h>
-#include <GL/glut.h>
-<gl, glu, and glut functionality is available here>
-
-
-
-or:
-
-
-
-#include <GL/glew.h>
-<gl and glu functionality is available here>
-
-
-
-Remember to link your project with glew32.lib,
-glu32.lib, and opengl32.lib on Windows and
-libGLEW.so, libGLU.so, and libGL.so on
-Unix (-lGLEW -lGLU -lGL).
-
-
-
-It is important to keep in mind that glew.h includes neither
-windows.h nor gl.h. Also, GLEW will warn you by
-issuing a preprocessor error in case you have included gl.h,
-glext.h, or glATI.h before glew.h.
-
-
-
-
-
-
diff --git a/extern/glew-1.5.8/doc/khronos.txt b/extern/glew-1.5.8/doc/khronos.txt
deleted file mode 100644
index ffc271c915..0000000000
--- a/extern/glew-1.5.8/doc/khronos.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright (c) 2007 The Khronos Group Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and/or associated documentation files (the
-"Materials"), to deal in the Materials without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Materials, and to
-permit persons to whom the Materials are furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Materials.
-
-THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
diff --git a/extern/glew-1.5.8/doc/log.html b/extern/glew-1.5.8/doc/log.html
deleted file mode 100644
index ff504f2e4a..0000000000
--- a/extern/glew-1.5.8/doc/log.html
+++ /dev/null
@@ -1,797 +0,0 @@
-
-
-
-
-
-
-GLEW: The OpenGL Extension Wrangler Library
-
-
-
-
-
Bug fix in OpenGL version query (early release of 1.2.0 contained this bug)
-
Bug fix in GL_ARB_shader_objects and temporary bug fix in GL_ARB_vertex_shader
-
Added flags on GDI support and multisampling to wglinfo
-
-
-
-
-
1.2.0 [02-19-04]
-
-
Added full OpenGL 1.5 support
-
Added support for multiple rendering contexts with different capabilities
-
Added command line flags to glewinfo for selecting displays and visuals
-
Added GLX_SGIS_multisample, GLX_SUN_video_resize, and GL_SUN_read_video_pixels
-
Added MinGW/MSYS support
-
Bug fixes in GL_ARB_shader_objects and the OS X build
-
-
-
-
-
1.1.4 [12-15-03]
-
-
Added GL_APPLE_float_pixels, GL_APPLE_texture_range,
-GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp,
-GLX_ATI_pixel_format_float, and GLX_ATI_render_texture
-
Bug fixes in GL_ATI_map_object_buffer and GL_ATI_fragment_shader
-
-
-
-
-
1.1.3 [10-28-03]
-
-
Added Solaris and Darwin support
-
Added GL_ARB_fragment_shader, GL_ARB_shader_objects, and GL_ARB_vertex_shader
-
Fixed bug in GL_WIN_swap_hint
-
Removed glewinfo's dependency on GLUT
-
-
-
-
-
1.1.2 [09-15-03]
-
-
Removed dependency on WGL_{ARB,EXT}_extensions_string to make GLEW run on Matrox cards
-
Added glewGetString for querying the GLEW version string
-
-
-
-
-
1.1.1 [08-11-03]
-
-
Added GLX_NV_float_buffer, GL_ARB_shading_language_100, and GL_ARB_texture_non_power_of_two
-
Fixed bug in GL_ARB_vertex_buffer_object
-
Minor updates in documentation
-
-
-
-
-
1.1.0 [07-08-03]
-
-
Added automatic code generation
-
Added almost every extension in the registry
-
Added separate namespace
-
Added Irix support
-
Updated documentation
-
-
-
-
-
1.0.7 [06-29-03]
-
-
Added GL_EXT_depth_bounds_test
-
Fixed typos
-
-
-
-
-
1.0.6 [05-05-03]
-
-
Added ARB_vertex_buffer_object and NV_half_float
-
Updated wglinfo
-
Temporary Linux bug fixes (problems with SDL and MESA)
-
-
-
-
-
1.0.5 [02-17-03]
-
-
Bug fixes
-
Added wglinfo
-
Updated documentation
-
-
-
-
-
1.0.4 [02-02-03]
-
-
Added NV_texture_expand_normal
-
Added mingw support
-
Updated documentation
-
-
-
-
-
1.0.3 [01-09-03]
-
-
Cleaned up ATI extensions
-
Changed function prototypes to match glext.h
-
Added EXT_texture3D
-
Fixed typos in ATI_vertex_attrib_array_object and ATI_draw_buffers
-
-
-
-
-
1.0.2 [12-21-02]
-
-
Added list of supported extensions to documentation
-
Added NV_half_float and NV_texgen_emboss
-
-
-
-
-
1.0.1 [12-17-02]
-
-
Bug fixes
-
Added glewGetExtension
-
-
-
-
-
1.0.0 [12-12-02]
-
-
Initial release
-
-
-
-
-
-
-
-
diff --git a/extern/glew-1.5.8/doc/mesa.txt b/extern/glew-1.5.8/doc/mesa.txt
deleted file mode 100644
index a82dd4bd44..0000000000
--- a/extern/glew-1.5.8/doc/mesa.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-Mesa 3-D graphics library
-Version: 7.0
-
-Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/extern/glew-1.5.8/doc/new.png b/extern/glew-1.5.8/doc/new.png
deleted file mode 100644
index 7ce2b47960..0000000000
Binary files a/extern/glew-1.5.8/doc/new.png and /dev/null differ
diff --git a/extern/glew-1.5.8/doc/ogl_sm.jpg b/extern/glew-1.5.8/doc/ogl_sm.jpg
deleted file mode 100644
index f318d7655b..0000000000
Binary files a/extern/glew-1.5.8/doc/ogl_sm.jpg and /dev/null differ
diff --git a/extern/glew-1.5.8/doc/wglew.html b/extern/glew-1.5.8/doc/wglew.html
deleted file mode 100644
index e29fb56345..0000000000
--- a/extern/glew-1.5.8/doc/wglew.html
+++ /dev/null
@@ -1,159 +0,0 @@
-
-
-
-
-
-
-GLEW: The OpenGL Extension Wrangler Library
-
-
-
-
-
+///
+/// The implementation mode requires to define the preprocessor macro
+/// NK_IMPLEMENTATION in *one* .c/.cpp file before #includeing this file, e.g.:
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~C
+/// #define NK_IMPLEMENTATION
+/// #include "nuklear.h"
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Also optionally define the symbols listed in the section "OPTIONAL DEFINES"
+/// below in header and implementation mode if you want to use additional functionality
+/// or need more control over the library.
+///
+/// !!! WARNING
+/// Every time nuklear is included define the same compiler flags. This very important not doing so could lead to compiler errors or even worse stack corruptions.
+///
+/// ### Flags
+/// Flag | Description
+/// --------------------------------|------------------------------------------
+/// NK_PRIVATE | If defined declares all functions as static, so they can only be accessed inside the file that contains the implementation
+/// NK_INCLUDE_FIXED_TYPES | If defined it will include header `` for fixed sized types otherwise nuklear tries to select the correct type. If that fails it will throw a compiler error and you have to select the correct types yourself.
+/// NK_INCLUDE_DEFAULT_ALLOCATOR | If defined it will include header `` and provide additional functions to use this library without caring for memory allocation control and therefore ease memory management.
+/// NK_INCLUDE_STANDARD_IO | If defined it will include header `` and provide additional functions depending on file loading.
+/// NK_INCLUDE_STANDARD_VARARGS | If defined it will include header and provide additional functions depending on file loading.
+/// NK_INCLUDE_VERTEX_BUFFER_OUTPUT | Defining this adds a vertex draw command list backend to this library, which allows you to convert queue commands into vertex draw commands. This is mainly if you need a hardware accessible format for OpenGL, DirectX, Vulkan, Metal,...
+/// NK_INCLUDE_FONT_BAKING | Defining this adds `stb_truetype` and `stb_rect_pack` implementation to this library and provides font baking and rendering. If you already have font handling or do not want to use this font handler you don't have to define it.
+/// NK_INCLUDE_DEFAULT_FONT | Defining this adds the default font: ProggyClean.ttf into this library which can be loaded into a font atlas and allows using this library without having a truetype font
+/// NK_INCLUDE_COMMAND_USERDATA | Defining this adds a userdata pointer into each command. Can be useful for example if you want to provide custom shaders depending on the used widget. Can be combined with the style structures.
+/// NK_BUTTON_TRIGGER_ON_RELEASE | Different platforms require button clicks occurring either on buttons being pressed (up to down) or released (down to up). By default this library will react on buttons being pressed, but if you define this it will only trigger if a button is released.
+/// NK_ZERO_COMMAND_MEMORY | Defining this will zero out memory for each drawing command added to a drawing queue (inside nk_command_buffer_push). Zeroing command memory is very useful for fast checking (using memcmp) if command buffers are equal and avoid drawing frames when nothing on screen has changed since previous frame.
+///
+/// !!! WARNING
+/// The following flags will pull in the standard C library:
+/// - NK_INCLUDE_DEFAULT_ALLOCATOR
+/// - NK_INCLUDE_STANDARD_IO
+/// - NK_INCLUDE_STANDARD_VARARGS
+///
+/// !!! WARNING
+/// The following flags if defined need to be defined for both header and implementation:
+/// - NK_INCLUDE_FIXED_TYPES
+/// - NK_INCLUDE_DEFAULT_ALLOCATOR
+/// - NK_INCLUDE_STANDARD_VARARGS
+/// - NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+/// - NK_INCLUDE_FONT_BAKING
+/// - NK_INCLUDE_DEFAULT_FONT
+/// - NK_INCLUDE_STANDARD_VARARGS
+/// - NK_INCLUDE_COMMAND_USERDATA
+///
+/// ### Constants
+/// Define | Description
+/// --------------------------------|---------------------------------------
+/// NK_BUFFER_DEFAULT_INITIAL_SIZE | Initial buffer size allocated by all buffers while using the default allocator functions included by defining NK_INCLUDE_DEFAULT_ALLOCATOR. If you don't want to allocate the default 4k memory then redefine it.
+/// NK_MAX_NUMBER_BUFFER | Maximum buffer size for the conversion buffer between float and string Under normal circumstances this should be more than sufficient.
+/// NK_INPUT_MAX | Defines the max number of bytes which can be added as text input in one frame. Under normal circumstances this should be more than sufficient.
+///
+/// !!! WARNING
+/// The following constants if defined need to be defined for both header and implementation:
+/// - NK_MAX_NUMBER_BUFFER
+/// - NK_BUFFER_DEFAULT_INITIAL_SIZE
+/// - NK_INPUT_MAX
+///
+/// ### Dependencies
+/// Function | Description
+/// ------------|---------------------------------------------------------------
+/// NK_ASSERT | If you don't define this, nuklear will use with assert().
+/// NK_MEMSET | You can define this to 'memset' or your own memset implementation replacement. If not nuklear will use its own version.
+/// NK_MEMCPY | You can define this to 'memcpy' or your own memcpy implementation replacement. If not nuklear will use its own version.
+/// NK_SQRT | You can define this to 'sqrt' or your own sqrt implementation replacement. If not nuklear will use its own slow and not highly accurate version.
+/// NK_SIN | You can define this to 'sinf' or your own sine implementation replacement. If not nuklear will use its own approximation implementation.
+/// NK_COS | You can define this to 'cosf' or your own cosine implementation replacement. If not nuklear will use its own approximation implementation.
+/// NK_STRTOD | You can define this to `strtod` or your own string to double conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!).
+/// NK_DTOA | You can define this to `dtoa` or your own double to string conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!).
+/// NK_VSNPRINTF| If you define `NK_INCLUDE_STANDARD_VARARGS` as well as `NK_INCLUDE_STANDARD_IO` and want to be safe define this to `vsnprintf` on compilers supporting later versions of C or C++. By default nuklear will check for your stdlib version in C as well as compiler version in C++. if `vsnprintf` is available it will define it to `vsnprintf` directly. If not defined and if you have older versions of C or C++ it will be defined to `vsprintf` which is unsafe.
+///
+/// !!! WARNING
+/// The following dependencies will pull in the standard C library if not redefined:
+/// - NK_ASSERT
+///
+/// !!! WARNING
+/// The following dependencies if defined need to be defined for both header and implementation:
+/// - NK_ASSERT
+///
+/// !!! WARNING
+/// The following dependencies if defined need to be defined only for the implementation part:
+/// - NK_MEMSET
+/// - NK_MEMCPY
+/// - NK_SQRT
+/// - NK_SIN
+/// - NK_COS
+/// - NK_STRTOD
+/// - NK_DTOA
+/// - NK_VSNPRINTF
+///
+/// ## Example
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// // init gui state
+/// enum {EASY, HARD};
+/// static int op = EASY;
+/// static float value = 0.6f;
+/// static int i = 20;
+/// struct nk_context ctx;
+///
+/// nk_init_fixed(&ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, &font);
+/// if (nk_begin(&ctx, "Show", nk_rect(50, 50, 220, 220),
+/// NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {
+/// // fixed widget pixel width
+/// nk_layout_row_static(&ctx, 30, 80, 1);
+/// if (nk_button_label(&ctx, "button")) {
+/// // event handling
+/// }
+///
+/// // fixed widget window ratio width
+/// nk_layout_row_dynamic(&ctx, 30, 2);
+/// if (nk_option_label(&ctx, "easy", op == EASY)) op = EASY;
+/// if (nk_option_label(&ctx, "hard", op == HARD)) op = HARD;
+///
+/// // custom widget pixel width
+/// nk_layout_row_begin(&ctx, NK_STATIC, 30, 2);
+/// {
+/// nk_layout_row_push(&ctx, 50);
+/// nk_label(&ctx, "Volume:", NK_TEXT_LEFT);
+/// nk_layout_row_push(&ctx, 110);
+/// nk_slider_float(&ctx, 0, &value, 1.0f, 0.1f);
+/// }
+/// nk_layout_row_end(&ctx);
+/// }
+/// nk_end(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// 
+///
+/// ## API
+///
+*/
+#ifndef NK_SINGLE_FILE
+ #define NK_SINGLE_FILE
+#endif
+
+#ifndef NK_NUKLEAR_H_
+#define NK_NUKLEAR_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * ==============================================================
+ *
+ * CONSTANTS
+ *
+ * ===============================================================
+ */
+#define NK_UNDEFINED (-1.0f)
+#define NK_UTF_INVALID 0xFFFD /* internal invalid utf8 rune */
+#define NK_UTF_SIZE 4 /* describes the number of bytes a glyph consists of*/
+#ifndef NK_INPUT_MAX
+ #define NK_INPUT_MAX 16
+#endif
+#ifndef NK_MAX_NUMBER_BUFFER
+ #define NK_MAX_NUMBER_BUFFER 64
+#endif
+#ifndef NK_SCROLLBAR_HIDING_TIMEOUT
+ #define NK_SCROLLBAR_HIDING_TIMEOUT 4.0f
+#endif
+/*
+ * ==============================================================
+ *
+ * HELPER
+ *
+ * ===============================================================
+ */
+#ifndef NK_API
+ #ifdef NK_PRIVATE
+ #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199409L))
+ #define NK_API static inline
+ #elif defined(__cplusplus)
+ #define NK_API static inline
+ #else
+ #define NK_API static
+ #endif
+ #else
+ #define NK_API extern
+ #endif
+#endif
+#ifndef NK_LIB
+ #ifdef NK_SINGLE_FILE
+ #define NK_LIB static
+ #else
+ #define NK_LIB extern
+ #endif
+#endif
+
+#define NK_INTERN static
+#define NK_STORAGE static
+#define NK_GLOBAL static
+
+#define NK_FLAG(x) (1 << (x))
+#define NK_STRINGIFY(x) #x
+#define NK_MACRO_STRINGIFY(x) NK_STRINGIFY(x)
+#define NK_STRING_JOIN_IMMEDIATE(arg1, arg2) arg1 ## arg2
+#define NK_STRING_JOIN_DELAY(arg1, arg2) NK_STRING_JOIN_IMMEDIATE(arg1, arg2)
+#define NK_STRING_JOIN(arg1, arg2) NK_STRING_JOIN_DELAY(arg1, arg2)
+
+#ifdef _MSC_VER
+ #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__COUNTER__)
+#else
+ #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__LINE__)
+#endif
+
+#ifndef NK_STATIC_ASSERT
+ #define NK_STATIC_ASSERT(exp) typedef char NK_UNIQUE_NAME(_dummy_array)[(exp)?1:-1]
+#endif
+
+#ifndef NK_FILE_LINE
+#ifdef _MSC_VER
+ #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__COUNTER__)
+#else
+ #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__LINE__)
+#endif
+#endif
+
+#define NK_MIN(a,b) ((a) < (b) ? (a) : (b))
+#define NK_MAX(a,b) ((a) < (b) ? (b) : (a))
+#define NK_CLAMP(i,v,x) (NK_MAX(NK_MIN(v,x), i))
+
+#ifdef NK_INCLUDE_STANDARD_VARARGS
+ #if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */
+ #include
+ #define NK_PRINTF_FORMAT_STRING _Printf_format_string_
+ #else
+ #define NK_PRINTF_FORMAT_STRING
+ #endif
+ #if defined(__GNUC__)
+ #define NK_PRINTF_VARARG_FUNC(fmtargnumber) __attribute__((format(__printf__, fmtargnumber, fmtargnumber+1)))
+ #define NK_PRINTF_VALIST_FUNC(fmtargnumber) __attribute__((format(__printf__, fmtargnumber, 0)))
+ #else
+ #define NK_PRINTF_VARARG_FUNC(fmtargnumber)
+ #define NK_PRINTF_VALIST_FUNC(fmtargnumber)
+ #endif
+ #include /* valist, va_start, va_end, ... */
+#endif
+
+/*
+ * ===============================================================
+ *
+ * BASIC
+ *
+ * ===============================================================
+ */
+#ifdef NK_INCLUDE_FIXED_TYPES
+ #include
+ #define NK_INT8 int8_t
+ #define NK_UINT8 uint8_t
+ #define NK_INT16 int16_t
+ #define NK_UINT16 uint16_t
+ #define NK_INT32 int32_t
+ #define NK_UINT32 uint32_t
+ #define NK_SIZE_TYPE uintptr_t
+ #define NK_POINTER_TYPE uintptr_t
+#else
+ #ifndef NK_INT8
+ #define NK_INT8 char
+ #endif
+ #ifndef NK_UINT8
+ #define NK_UINT8 unsigned char
+ #endif
+ #ifndef NK_INT16
+ #define NK_INT16 signed short
+ #endif
+ #ifndef NK_UINT16
+ #define NK_UINT16 unsigned short
+ #endif
+ #ifndef NK_INT32
+ #if defined(_MSC_VER)
+ #define NK_INT32 __int32
+ #else
+ #define NK_INT32 signed int
+ #endif
+ #endif
+ #ifndef NK_UINT32
+ #if defined(_MSC_VER)
+ #define NK_UINT32 unsigned __int32
+ #else
+ #define NK_UINT32 unsigned int
+ #endif
+ #endif
+ #ifndef NK_SIZE_TYPE
+ #if defined(_WIN64) && defined(_MSC_VER)
+ #define NK_SIZE_TYPE unsigned __int64
+ #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER)
+ #define NK_SIZE_TYPE unsigned __int32
+ #elif defined(__GNUC__) || defined(__clang__)
+ #if defined(__x86_64__) || defined(__ppc64__)
+ #define NK_SIZE_TYPE unsigned long
+ #else
+ #define NK_SIZE_TYPE unsigned int
+ #endif
+ #else
+ #define NK_SIZE_TYPE unsigned long
+ #endif
+ #endif
+ #ifndef NK_POINTER_TYPE
+ #if defined(_WIN64) && defined(_MSC_VER)
+ #define NK_POINTER_TYPE unsigned __int64
+ #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER)
+ #define NK_POINTER_TYPE unsigned __int32
+ #elif defined(__GNUC__) || defined(__clang__)
+ #if defined(__x86_64__) || defined(__ppc64__)
+ #define NK_POINTER_TYPE unsigned long
+ #else
+ #define NK_POINTER_TYPE unsigned int
+ #endif
+ #else
+ #define NK_POINTER_TYPE unsigned long
+ #endif
+ #endif
+#endif
+
+typedef NK_INT8 nk_char;
+typedef NK_UINT8 nk_uchar;
+typedef NK_UINT8 nk_byte;
+typedef NK_INT16 nk_short;
+typedef NK_UINT16 nk_ushort;
+typedef NK_INT32 nk_int;
+typedef NK_UINT32 nk_uint;
+typedef NK_SIZE_TYPE nk_size;
+typedef NK_POINTER_TYPE nk_ptr;
+
+typedef nk_uint nk_hash;
+typedef nk_uint nk_flags;
+typedef nk_uint nk_rune;
+
+/* Make sure correct type size:
+ * This will fire with a negative subscript error if the type sizes
+ * are set incorrectly by the compiler, and compile out if not */
+NK_STATIC_ASSERT(sizeof(nk_short) == 2);
+NK_STATIC_ASSERT(sizeof(nk_ushort) == 2);
+NK_STATIC_ASSERT(sizeof(nk_uint) == 4);
+NK_STATIC_ASSERT(sizeof(nk_int) == 4);
+NK_STATIC_ASSERT(sizeof(nk_byte) == 1);
+NK_STATIC_ASSERT(sizeof(nk_flags) >= 4);
+NK_STATIC_ASSERT(sizeof(nk_rune) >= 4);
+NK_STATIC_ASSERT(sizeof(nk_size) >= sizeof(void*));
+NK_STATIC_ASSERT(sizeof(nk_ptr) >= sizeof(void*));
+
+/* ============================================================================
+ *
+ * API
+ *
+ * =========================================================================== */
+struct nk_buffer;
+struct nk_allocator;
+struct nk_command_buffer;
+struct nk_draw_command;
+struct nk_convert_config;
+struct nk_style_item;
+struct nk_text_edit;
+struct nk_draw_list;
+struct nk_user_font;
+struct nk_panel;
+struct nk_context;
+struct nk_draw_vertex_layout_element;
+struct nk_style_button;
+struct nk_style_toggle;
+struct nk_style_selectable;
+struct nk_style_slide;
+struct nk_style_progress;
+struct nk_style_scrollbar;
+struct nk_style_edit;
+struct nk_style_property;
+struct nk_style_chart;
+struct nk_style_combo;
+struct nk_style_tab;
+struct nk_style_window_header;
+struct nk_style_window;
+
+enum {nk_false, nk_true};
+struct nk_color {nk_byte r,g,b,a;};
+struct nk_colorf {float r,g,b,a;};
+struct nk_vec2 {float x,y;};
+struct nk_vec2i {short x, y;};
+struct nk_rect {float x,y,w,h;};
+struct nk_recti {short x,y,w,h;};
+typedef char nk_glyph[NK_UTF_SIZE];
+typedef union {void *ptr; int id;} nk_handle;
+struct nk_image {nk_handle handle;unsigned short w,h;unsigned short region[4];};
+struct nk_cursor {struct nk_image img; struct nk_vec2 size, offset;};
+struct nk_scroll {nk_uint x, y;};
+
+enum nk_heading {NK_UP, NK_RIGHT, NK_DOWN, NK_LEFT};
+enum nk_button_behavior {NK_BUTTON_DEFAULT, NK_BUTTON_REPEATER};
+enum nk_modify {NK_FIXED = nk_false, NK_MODIFIABLE = nk_true};
+enum nk_orientation {NK_VERTICAL, NK_HORIZONTAL};
+enum nk_collapse_states {NK_MINIMIZED = nk_false, NK_MAXIMIZED = nk_true};
+enum nk_show_states {NK_HIDDEN = nk_false, NK_SHOWN = nk_true};
+enum nk_chart_type {NK_CHART_LINES, NK_CHART_COLUMN, NK_CHART_MAX};
+enum nk_chart_event {NK_CHART_HOVERING = 0x01, NK_CHART_CLICKED = 0x02};
+enum nk_color_format {NK_RGB, NK_RGBA};
+enum nk_popup_type {NK_POPUP_STATIC, NK_POPUP_DYNAMIC};
+enum nk_layout_format {NK_DYNAMIC, NK_STATIC};
+enum nk_tree_type {NK_TREE_NODE, NK_TREE_TAB};
+
+typedef void*(*nk_plugin_alloc)(nk_handle, void *old, nk_size);
+typedef void (*nk_plugin_free)(nk_handle, void *old);
+typedef int(*nk_plugin_filter)(const struct nk_text_edit*, nk_rune unicode);
+typedef void(*nk_plugin_paste)(nk_handle, struct nk_text_edit*);
+typedef void(*nk_plugin_copy)(nk_handle, const char*, int len);
+
+struct nk_allocator {
+ nk_handle userdata;
+ nk_plugin_alloc alloc;
+ nk_plugin_free free;
+};
+enum nk_symbol_type {
+ NK_SYMBOL_NONE,
+ NK_SYMBOL_X,
+ NK_SYMBOL_UNDERSCORE,
+ NK_SYMBOL_CIRCLE_SOLID,
+ NK_SYMBOL_CIRCLE_OUTLINE,
+ NK_SYMBOL_RECT_SOLID,
+ NK_SYMBOL_RECT_OUTLINE,
+ NK_SYMBOL_TRIANGLE_UP,
+ NK_SYMBOL_TRIANGLE_DOWN,
+ NK_SYMBOL_TRIANGLE_LEFT,
+ NK_SYMBOL_TRIANGLE_RIGHT,
+ NK_SYMBOL_PLUS,
+ NK_SYMBOL_MINUS,
+ NK_SYMBOL_MAX
+};
+/* =============================================================================
+ *
+ * CONTEXT
+ *
+ * =============================================================================*/
+/*/// ### Context
+/// Contexts are the main entry point and the majestro of nuklear and contain all required state.
+/// They are used for window, memory, input, style, stack, commands and time management and need
+/// to be passed into all nuklear GUI specific functions.
+///
+/// #### Usage
+/// To use a context it first has to be initialized which can be achieved by calling
+/// one of either `nk_init_default`, `nk_init_fixed`, `nk_init`, `nk_init_custom`.
+/// Each takes in a font handle and a specific way of handling memory. Memory control
+/// hereby ranges from standard library to just specifying a fixed sized block of memory
+/// which nuklear has to manage itself from.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_context ctx;
+/// nk_init_xxx(&ctx, ...);
+/// while (1) {
+/// // [...]
+/// nk_clear(&ctx);
+/// }
+/// nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Reference
+/// Function | Description
+/// --------------------|-------------------------------------------------------
+/// __nk_init_default__ | Initializes context with standard library memory allocation (malloc,free)
+/// __nk_init_fixed__ | Initializes context from single fixed size memory block
+/// __nk_init__ | Initializes context with memory allocator callbacks for alloc and free
+/// __nk_init_custom__ | Initializes context from two buffers. One for draw commands the other for window/panel/table allocations
+/// __nk_clear__ | Called at the end of the frame to reset and prepare the context for the next frame
+/// __nk_free__ | Shutdown and free all memory allocated inside the context
+/// __nk_set_user_data__| Utility function to pass user data to draw command
+ */
+#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+/*/// #### nk_init_default
+/// Initializes a `nk_context` struct with a default standard library allocator.
+/// Should be used if you don't want to be bothered with memory management in nuklear.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_init_default(struct nk_context *ctx, const struct nk_user_font *font);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|---------------------------------------------------------------
+/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
+/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
+///
+/// Returns either `false(0)` on failure or `true(1)` on success.
+///
+*/
+NK_API int nk_init_default(struct nk_context*, const struct nk_user_font*);
+#endif
+/*/// #### nk_init_fixed
+/// Initializes a `nk_context` struct from single fixed size memory block
+/// Should be used if you want complete control over nuklear's memory management.
+/// Especially recommended for system with little memory or systems with virtual memory.
+/// For the later case you can just allocate for example 16MB of virtual memory
+/// and only the required amount of memory will actually be committed.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size, const struct nk_user_font *font);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// !!! Warning
+/// make sure the passed memory block is aligned correctly for `nk_draw_commands`.
+///
+/// Parameter | Description
+/// ------------|--------------------------------------------------------------
+/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
+/// __memory__ | Must point to a previously allocated memory block
+/// __size__ | Must contain the total size of __memory__
+/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
+///
+/// Returns either `false(0)` on failure or `true(1)` on success.
+*/
+NK_API int nk_init_fixed(struct nk_context*, void *memory, nk_size size, const struct nk_user_font*);
+/*/// #### nk_init
+/// Initializes a `nk_context` struct with memory allocation callbacks for nuklear to allocate
+/// memory from. Used internally for `nk_init_default` and provides a kitchen sink allocation
+/// interface to nuklear. Can be useful for cases like monitoring memory consumption.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_init(struct nk_context *ctx, struct nk_allocator *alloc, const struct nk_user_font *font);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|---------------------------------------------------------------
+/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
+/// __alloc__ | Must point to a previously allocated memory allocator
+/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
+///
+/// Returns either `false(0)` on failure or `true(1)` on success.
+*/
+NK_API int nk_init(struct nk_context*, struct nk_allocator*, const struct nk_user_font*);
+/*/// #### nk_init_custom
+/// Initializes a `nk_context` struct from two different either fixed or growing
+/// buffers. The first buffer is for allocating draw commands while the second buffer is
+/// used for allocating windows, panels and state tables.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *font);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|---------------------------------------------------------------
+/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
+/// __cmds__ | Must point to a previously initialized memory buffer either fixed or dynamic to store draw commands into
+/// __pool__ | Must point to a previously initialized memory buffer either fixed or dynamic to store windows, panels and tables
+/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
+///
+/// Returns either `false(0)` on failure or `true(1)` on success.
+*/
+NK_API int nk_init_custom(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font*);
+/*/// #### nk_clear
+/// Resets the context state at the end of the frame. This includes mostly
+/// garbage collector tasks like removing windows or table not called and therefore
+/// used anymore.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_clear(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+*/
+NK_API void nk_clear(struct nk_context*);
+/*/// #### nk_free
+/// Frees all memory allocated by nuklear. Not needed if context was
+/// initialized with `nk_init_fixed`.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_free(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+*/
+NK_API void nk_free(struct nk_context*);
+#ifdef NK_INCLUDE_COMMAND_USERDATA
+/*/// #### nk_set_user_data
+/// Sets the currently passed userdata passed down into each draw command.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_set_user_data(struct nk_context *ctx, nk_handle data);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|--------------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __data__ | Handle with either pointer or index to be passed into every draw commands
+*/
+NK_API void nk_set_user_data(struct nk_context*, nk_handle handle);
+#endif
+/* =============================================================================
+ *
+ * INPUT
+ *
+ * =============================================================================*/
+/*/// ### Input
+/// The input API is responsible for holding the current input state composed of
+/// mouse, key and text input states.
+/// It is worth noting that no direct OS or window handling is done in nuklear.
+/// Instead all input state has to be provided by platform specific code. This on one hand
+/// expects more work from the user and complicates usage but on the other hand
+/// provides simple abstraction over a big number of platforms, libraries and other
+/// already provided functionality.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// nk_input_begin(&ctx);
+/// while (GetEvent(&evt)) {
+/// if (evt.type == MOUSE_MOVE)
+/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+/// else if (evt.type == [...]) {
+/// // [...]
+/// }
+/// } nk_input_end(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Usage
+/// Input state needs to be provided to nuklear by first calling `nk_input_begin`
+/// which resets internal state like delta mouse position and button transistions.
+/// After `nk_input_begin` all current input state needs to be provided. This includes
+/// mouse motion, button and key pressed and released, text input and scrolling.
+/// Both event- or state-based input handling are supported by this API
+/// and should work without problems. Finally after all input state has been
+/// mirrored `nk_input_end` needs to be called to finish input process.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_context ctx;
+/// nk_init_xxx(&ctx, ...);
+/// while (1) {
+/// Event evt;
+/// nk_input_begin(&ctx);
+/// while (GetEvent(&evt)) {
+/// if (evt.type == MOUSE_MOVE)
+/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+/// else if (evt.type == [...]) {
+/// // [...]
+/// }
+/// }
+/// nk_input_end(&ctx);
+/// // [...]
+/// nk_clear(&ctx);
+/// } nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Reference
+/// Function | Description
+/// --------------------|-------------------------------------------------------
+/// __nk_input_begin__ | Begins the input mirroring process. Needs to be called before all other `nk_input_xxx` calls
+/// __nk_input_motion__ | Mirrors mouse cursor position
+/// __nk_input_key__ | Mirrors key state with either pressed or released
+/// __nk_input_button__ | Mirrors mouse button state with either pressed or released
+/// __nk_input_scroll__ | Mirrors mouse scroll values
+/// __nk_input_char__ | Adds a single ASCII text character into an internal text buffer
+/// __nk_input_glyph__ | Adds a single multi-byte UTF-8 character into an internal text buffer
+/// __nk_input_unicode__| Adds a single unicode rune into an internal text buffer
+/// __nk_input_end__ | Ends the input mirroring process by calculating state changes. Don't call any `nk_input_xxx` function referenced above after this call
+*/
+enum nk_keys {
+ NK_KEY_NONE,
+ NK_KEY_SHIFT,
+ NK_KEY_CTRL,
+ NK_KEY_DEL,
+ NK_KEY_ENTER,
+ NK_KEY_TAB,
+ NK_KEY_BACKSPACE,
+ NK_KEY_COPY,
+ NK_KEY_CUT,
+ NK_KEY_PASTE,
+ NK_KEY_UP,
+ NK_KEY_DOWN,
+ NK_KEY_LEFT,
+ NK_KEY_RIGHT,
+ /* Shortcuts: text field */
+ NK_KEY_TEXT_INSERT_MODE,
+ NK_KEY_TEXT_REPLACE_MODE,
+ NK_KEY_TEXT_RESET_MODE,
+ NK_KEY_TEXT_LINE_START,
+ NK_KEY_TEXT_LINE_END,
+ NK_KEY_TEXT_START,
+ NK_KEY_TEXT_END,
+ NK_KEY_TEXT_UNDO,
+ NK_KEY_TEXT_REDO,
+ NK_KEY_TEXT_SELECT_ALL,
+ NK_KEY_TEXT_WORD_LEFT,
+ NK_KEY_TEXT_WORD_RIGHT,
+ /* Shortcuts: scrollbar */
+ NK_KEY_SCROLL_START,
+ NK_KEY_SCROLL_END,
+ NK_KEY_SCROLL_DOWN,
+ NK_KEY_SCROLL_UP,
+ NK_KEY_MAX
+};
+enum nk_buttons {
+ NK_BUTTON_LEFT,
+ NK_BUTTON_MIDDLE,
+ NK_BUTTON_RIGHT,
+ NK_BUTTON_DOUBLE,
+ NK_BUTTON_MAX
+};
+/*/// #### nk_input_begin
+/// Begins the input mirroring process by resetting text, scroll
+/// mouse, previous mouse position and movement as well as key state transitions,
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_begin(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+*/
+NK_API void nk_input_begin(struct nk_context*);
+/*/// #### nk_input_motion
+/// Mirrors current mouse position to nuklear
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_motion(struct nk_context *ctx, int x, int y);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __x__ | Must hold an integer describing the current mouse cursor x-position
+/// __y__ | Must hold an integer describing the current mouse cursor y-position
+*/
+NK_API void nk_input_motion(struct nk_context*, int x, int y);
+/*/// #### nk_input_key
+/// Mirrors the state of a specific key to nuklear
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_key(struct nk_context*, enum nk_keys key, int down);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __key__ | Must be any value specified in enum `nk_keys` that needs to be mirrored
+/// __down__ | Must be 0 for key is up and 1 for key is down
+*/
+NK_API void nk_input_key(struct nk_context*, enum nk_keys, int down);
+/*/// #### nk_input_button
+/// Mirrors the state of a specific mouse button to nuklear
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_button(struct nk_context *ctx, enum nk_buttons btn, int x, int y, int down);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __btn__ | Must be any value specified in enum `nk_buttons` that needs to be mirrored
+/// __x__ | Must contain an integer describing mouse cursor x-position on click up/down
+/// __y__ | Must contain an integer describing mouse cursor y-position on click up/down
+/// __down__ | Must be 0 for key is up and 1 for key is down
+*/
+NK_API void nk_input_button(struct nk_context*, enum nk_buttons, int x, int y, int down);
+/*/// #### nk_input_scroll
+/// Copies the last mouse scroll value to nuklear. Is generally
+/// a scroll value. So does not have to come from mouse and could also originate
+/// TODO finish this sentence
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_scroll(struct nk_context *ctx, struct nk_vec2 val);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __val__ | vector with both X- as well as Y-scroll value
+*/
+NK_API void nk_input_scroll(struct nk_context*, struct nk_vec2 val);
+/*/// #### nk_input_char
+/// Copies a single ASCII character into an internal text buffer
+/// This is basically a helper function to quickly push ASCII characters into
+/// nuklear.
+///
+/// !!! Note
+/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_char(struct nk_context *ctx, char c);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __c__ | Must be a single ASCII character preferable one that can be printed
+*/
+NK_API void nk_input_char(struct nk_context*, char);
+/*/// #### nk_input_glyph
+/// Converts an encoded unicode rune into UTF-8 and copies the result into an
+/// internal text buffer.
+///
+/// !!! Note
+/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_glyph(struct nk_context *ctx, const nk_glyph g);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __g__ | UTF-32 unicode codepoint
+*/
+NK_API void nk_input_glyph(struct nk_context*, const nk_glyph);
+/*/// #### nk_input_unicode
+/// Converts a unicode rune into UTF-8 and copies the result
+/// into an internal text buffer.
+/// !!! Note
+/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_unicode(struct nk_context*, nk_rune rune);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __rune__ | UTF-32 unicode codepoint
+*/
+NK_API void nk_input_unicode(struct nk_context*, nk_rune);
+/*/// #### nk_input_end
+/// End the input mirroring process by resetting mouse grabbing
+/// state to ensure the mouse cursor is not grabbed indefinitely.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_end(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+*/
+NK_API void nk_input_end(struct nk_context*);
+/* =============================================================================
+ *
+ * DRAWING
+ *
+ * =============================================================================*/
+/*/// ### Drawing
+/// This library was designed to be render backend agnostic so it does
+/// not draw anything to screen directly. Instead all drawn shapes, widgets
+/// are made of, are buffered into memory and make up a command queue.
+/// Each frame therefore fills the command buffer with draw commands
+/// that then need to be executed by the user and his own render backend.
+/// After that the command buffer needs to be cleared and a new frame can be
+/// started. It is probably important to note that the command buffer is the main
+/// drawing API and the optional vertex buffer API only takes this format and
+/// converts it into a hardware accessible format.
+///
+/// #### Usage
+/// To draw all draw commands accumulated over a frame you need your own render
+/// backend able to draw a number of 2D primitives. This includes at least
+/// filled and stroked rectangles, circles, text, lines, triangles and scissors.
+/// As soon as this criterion is met you can iterate over each draw command
+/// and execute each draw command in a interpreter like fashion:
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// const struct nk_command *cmd = 0;
+/// nk_foreach(cmd, &ctx) {
+/// switch (cmd->type) {
+/// case NK_COMMAND_LINE:
+/// your_draw_line_function(...)
+/// break;
+/// case NK_COMMAND_RECT
+/// your_draw_rect_function(...)
+/// break;
+/// case //...:
+/// //[...]
+/// }
+/// }
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// In program flow context draw commands need to be executed after input has been
+/// gathered and the complete UI with windows and their contained widgets have
+/// been executed and before calling `nk_clear` which frees all previously
+/// allocated draw commands.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_context ctx;
+/// nk_init_xxx(&ctx, ...);
+/// while (1) {
+/// Event evt;
+/// nk_input_begin(&ctx);
+/// while (GetEvent(&evt)) {
+/// if (evt.type == MOUSE_MOVE)
+/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+/// else if (evt.type == [...]) {
+/// [...]
+/// }
+/// }
+/// nk_input_end(&ctx);
+/// //
+/// // [...]
+/// //
+/// const struct nk_command *cmd = 0;
+/// nk_foreach(cmd, &ctx) {
+/// switch (cmd->type) {
+/// case NK_COMMAND_LINE:
+/// your_draw_line_function(...)
+/// break;
+/// case NK_COMMAND_RECT
+/// your_draw_rect_function(...)
+/// break;
+/// case ...:
+/// // [...]
+/// }
+/// nk_clear(&ctx);
+/// }
+/// nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// You probably noticed that you have to draw all of the UI each frame which is
+/// quite wasteful. While the actual UI updating loop is quite fast rendering
+/// without actually needing it is not. So there are multiple things you could do.
+///
+/// First is only update on input. This of course is only an option if your
+/// application only depends on the UI and does not require any outside calculations.
+/// If you actually only update on input make sure to update the UI two times each
+/// frame and call `nk_clear` directly after the first pass and only draw in
+/// the second pass. In addition it is recommended to also add additional timers
+/// to make sure the UI is not drawn more than a fixed number of frames per second.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_context ctx;
+/// nk_init_xxx(&ctx, ...);
+/// while (1) {
+/// // [...wait for input ]
+/// // [...do two UI passes ...]
+/// do_ui(...)
+/// nk_clear(&ctx);
+/// do_ui(...)
+/// //
+/// // draw
+/// const struct nk_command *cmd = 0;
+/// nk_foreach(cmd, &ctx) {
+/// switch (cmd->type) {
+/// case NK_COMMAND_LINE:
+/// your_draw_line_function(...)
+/// break;
+/// case NK_COMMAND_RECT
+/// your_draw_rect_function(...)
+/// break;
+/// case ...:
+/// //[...]
+/// }
+/// nk_clear(&ctx);
+/// }
+/// nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// The second probably more applicable trick is to only draw if anything changed.
+/// It is not really useful for applications with continuous draw loop but
+/// quite useful for desktop applications. To actually get nuklear to only
+/// draw on changes you first have to define `NK_ZERO_COMMAND_MEMORY` and
+/// allocate a memory buffer that will store each unique drawing output.
+/// After each frame you compare the draw command memory inside the library
+/// with your allocated buffer by memcmp. If memcmp detects differences
+/// you have to copy the command buffer into the allocated buffer
+/// and then draw like usual (this example uses fixed memory but you could
+/// use dynamically allocated memory).
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// //[... other defines ...]
+/// #define NK_ZERO_COMMAND_MEMORY
+/// #include "nuklear.h"
+/// //
+/// // setup context
+/// struct nk_context ctx;
+/// void *last = calloc(1,64*1024);
+/// void *buf = calloc(1,64*1024);
+/// nk_init_fixed(&ctx, buf, 64*1024);
+/// //
+/// // loop
+/// while (1) {
+/// // [...input...]
+/// // [...ui...]
+/// void *cmds = nk_buffer_memory(&ctx.memory);
+/// if (memcmp(cmds, last, ctx.memory.allocated)) {
+/// memcpy(last,cmds,ctx.memory.allocated);
+/// const struct nk_command *cmd = 0;
+/// nk_foreach(cmd, &ctx) {
+/// switch (cmd->type) {
+/// case NK_COMMAND_LINE:
+/// your_draw_line_function(...)
+/// break;
+/// case NK_COMMAND_RECT
+/// your_draw_rect_function(...)
+/// break;
+/// case ...:
+/// // [...]
+/// }
+/// }
+/// }
+/// nk_clear(&ctx);
+/// }
+/// nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Finally while using draw commands makes sense for higher abstracted platforms like
+/// X11 and Win32 or drawing libraries it is often desirable to use graphics
+/// hardware directly. Therefore it is possible to just define
+/// `NK_INCLUDE_VERTEX_BUFFER_OUTPUT` which includes optional vertex output.
+/// To access the vertex output you first have to convert all draw commands into
+/// vertexes by calling `nk_convert` which takes in your preferred vertex format.
+/// After successfully converting all draw commands just iterate over and execute all
+/// vertex draw commands:
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// // fill configuration
+/// struct nk_convert_config cfg = {};
+/// static const struct nk_draw_vertex_layout_element vertex_layout[] = {
+/// {NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, pos)},
+/// {NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, uv)},
+/// {NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct your_vertex, col)},
+/// {NK_VERTEX_LAYOUT_END}
+/// };
+/// cfg.shape_AA = NK_ANTI_ALIASING_ON;
+/// cfg.line_AA = NK_ANTI_ALIASING_ON;
+/// cfg.vertex_layout = vertex_layout;
+/// cfg.vertex_size = sizeof(struct your_vertex);
+/// cfg.vertex_alignment = NK_ALIGNOF(struct your_vertex);
+/// cfg.circle_segment_count = 22;
+/// cfg.curve_segment_count = 22;
+/// cfg.arc_segment_count = 22;
+/// cfg.global_alpha = 1.0f;
+/// cfg.null = dev->null;
+/// //
+/// // setup buffers and convert
+/// struct nk_buffer cmds, verts, idx;
+/// nk_buffer_init_default(&cmds);
+/// nk_buffer_init_default(&verts);
+/// nk_buffer_init_default(&idx);
+/// nk_convert(&ctx, &cmds, &verts, &idx, &cfg);
+/// //
+/// // draw
+/// nk_draw_foreach(cmd, &ctx, &cmds) {
+/// if (!cmd->elem_count) continue;
+/// //[...]
+/// }
+/// nk_buffer_free(&cms);
+/// nk_buffer_free(&verts);
+/// nk_buffer_free(&idx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Reference
+/// Function | Description
+/// --------------------|-------------------------------------------------------
+/// __nk__begin__ | Returns the first draw command in the context draw command list to be drawn
+/// __nk__next__ | Increments the draw command iterator to the next command inside the context draw command list
+/// __nk_foreach__ | Iterates over each draw command inside the context draw command list
+/// __nk_convert__ | Converts from the abstract draw commands list into a hardware accessible vertex format
+/// __nk_draw_begin__ | Returns the first vertex command in the context vertex draw list to be executed
+/// __nk__draw_next__ | Increments the vertex command iterator to the next command inside the context vertex command list
+/// __nk__draw_end__ | Returns the end of the vertex draw list
+/// __nk_draw_foreach__ | Iterates over each vertex draw command inside the vertex draw list
+*/
+enum nk_anti_aliasing {NK_ANTI_ALIASING_OFF, NK_ANTI_ALIASING_ON};
+enum nk_convert_result {
+ NK_CONVERT_SUCCESS = 0,
+ NK_CONVERT_INVALID_PARAM = 1,
+ NK_CONVERT_COMMAND_BUFFER_FULL = NK_FLAG(1),
+ NK_CONVERT_VERTEX_BUFFER_FULL = NK_FLAG(2),
+ NK_CONVERT_ELEMENT_BUFFER_FULL = NK_FLAG(3)
+};
+struct nk_draw_null_texture {
+ nk_handle texture; /* texture handle to a texture with a white pixel */
+ struct nk_vec2 uv; /* coordinates to a white pixel in the texture */
+};
+struct nk_convert_config {
+ float global_alpha; /* global alpha value */
+ enum nk_anti_aliasing line_AA; /* line anti-aliasing flag can be turned off if you are tight on memory */
+ enum nk_anti_aliasing shape_AA; /* shape anti-aliasing flag can be turned off if you are tight on memory */
+ unsigned circle_segment_count; /* number of segments used for circles: default to 22 */
+ unsigned arc_segment_count; /* number of segments used for arcs: default to 22 */
+ unsigned curve_segment_count; /* number of segments used for curves: default to 22 */
+ struct nk_draw_null_texture null; /* handle to texture with a white pixel for shape drawing */
+ const struct nk_draw_vertex_layout_element *vertex_layout; /* describes the vertex output format and packing */
+ nk_size vertex_size; /* sizeof one vertex for vertex packing */
+ nk_size vertex_alignment; /* vertex alignment: Can be obtained by NK_ALIGNOF */
+};
+/*/// #### nk__begin
+/// Returns a draw command list iterator to iterate all draw
+/// commands accumulated over one frame.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// const struct nk_command* nk__begin(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | must point to an previously initialized `nk_context` struct at the end of a frame
+///
+/// Returns draw command pointer pointing to the first command inside the draw command list
+*/
+NK_API const struct nk_command* nk__begin(struct nk_context*);
+/*/// #### nk__next
+/// Returns draw command pointer pointing to the next command inside the draw command list
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// const struct nk_command* nk__next(struct nk_context*, const struct nk_command*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+/// __cmd__ | Must point to an previously a draw command either returned by `nk__begin` or `nk__next`
+///
+/// Returns draw command pointer pointing to the next command inside the draw command list
+*/
+NK_API const struct nk_command* nk__next(struct nk_context*, const struct nk_command*);
+/*/// #### nk_foreach
+/// Iterates over each draw command inside the context draw command list
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// #define nk_foreach(c, ctx)
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+/// __cmd__ | Command pointer initialized to NULL
+///
+/// Iterates over each draw command inside the context draw command list
+*/
+#define nk_foreach(c, ctx) for((c) = nk__begin(ctx); (c) != 0; (c) = nk__next(ctx,c))
+#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+/*/// #### nk_convert
+/// Converts all internal draw commands into vertex draw commands and fills
+/// three buffers with vertexes, vertex draw commands and vertex indices. The vertex format
+/// as well as some other configuration values have to be configured by filling out a
+/// `nk_convert_config` struct.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// nk_flags nk_convert(struct nk_context *ctx, struct nk_buffer *cmds,
+// struct nk_buffer *vertices, struct nk_buffer *elements, const struct nk_convert_config*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+/// __cmds__ | Must point to a previously initialized buffer to hold converted vertex draw commands
+/// __vertices__| Must point to a previously initialized buffer to hold all produced vertices
+/// __elements__| Must point to a previously initialized buffer to hold all produced vertex indices
+/// __config__ | Must point to a filled out `nk_config` struct to configure the conversion process
+///
+/// Returns one of enum nk_convert_result error codes
+///
+/// Parameter | Description
+/// --------------------------------|-----------------------------------------------------------
+/// NK_CONVERT_SUCCESS | Signals a successful draw command to vertex buffer conversion
+/// NK_CONVERT_INVALID_PARAM | An invalid argument was passed in the function call
+/// NK_CONVERT_COMMAND_BUFFER_FULL | The provided buffer for storing draw commands is full or failed to allocate more memory
+/// NK_CONVERT_VERTEX_BUFFER_FULL | The provided buffer for storing vertices is full or failed to allocate more memory
+/// NK_CONVERT_ELEMENT_BUFFER_FULL | The provided buffer for storing indicies is full or failed to allocate more memory
+*/
+NK_API nk_flags nk_convert(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements, const struct nk_convert_config*);
+/*/// #### nk__draw_begin
+/// Returns a draw vertex command buffer iterator to iterate over the vertex draw command buffer
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// const struct nk_draw_command* nk__draw_begin(const struct nk_context*, const struct nk_buffer*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer
+///
+/// Returns vertex draw command pointer pointing to the first command inside the vertex draw command buffer
+*/
+NK_API const struct nk_draw_command* nk__draw_begin(const struct nk_context*, const struct nk_buffer*);
+/*/// #### nk__draw_end
+/// Returns the vertex draw command at the end of the vertex draw command buffer
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// const struct nk_draw_command* nk__draw_end(const struct nk_context *ctx, const struct nk_buffer *buf);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer
+///
+/// Returns vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer
+*/
+NK_API const struct nk_draw_command* nk__draw_end(const struct nk_context*, const struct nk_buffer*);
+/*/// #### nk__draw_next
+/// Increments the vertex draw command buffer iterator
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __cmd__ | Must point to an previously either by `nk__draw_begin` or `nk__draw_next` returned vertex draw command
+/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+///
+/// Returns vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer
+*/
+NK_API const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_context*);
+/*/// #### nk_draw_foreach
+/// Iterates over each vertex draw command inside a vertex draw command buffer
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// #define nk_draw_foreach(cmd,ctx, b)
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __cmd__ | `nk_draw_command`iterator set to NULL
+/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+*/
+#define nk_draw_foreach(cmd,ctx, b) for((cmd)=nk__draw_begin(ctx, b); (cmd)!=0; (cmd)=nk__draw_next(cmd, b, ctx))
+#endif
+/* =============================================================================
+ *
+ * WINDOW
+ *
+ * =============================================================================
+/// ### Window
+/// Windows are the main persistent state used inside nuklear and are life time
+/// controlled by simply "retouching" (i.e. calling) each window each frame.
+/// All widgets inside nuklear can only be added inside the function pair `nk_begin_xxx`
+/// and `nk_end`. Calling any widgets outside these two functions will result in an
+/// assert in debug or no state change in release mode.
+///
+/// Each window holds frame persistent state like position, size, flags, state tables,
+/// and some garbage collected internal persistent widget state. Each window
+/// is linked into a window stack list which determines the drawing and overlapping
+/// order. The topmost window thereby is the currently active window.
+///
+/// To change window position inside the stack occurs either automatically by
+/// user input by being clicked on or programmatically by calling `nk_window_focus`.
+/// Windows by default are visible unless explicitly being defined with flag
+/// `NK_WINDOW_HIDDEN`, the user clicked the close button on windows with flag
+/// `NK_WINDOW_CLOSABLE` or if a window was explicitly hidden by calling
+/// `nk_window_show`. To explicitly close and destroy a window call `nk_window_close`.
+///
+/// #### Usage
+/// To create and keep a window you have to call one of the two `nk_begin_xxx`
+/// functions to start window declarations and `nk_end` at the end. Furthermore it
+/// is recommended to check the return value of `nk_begin_xxx` and only process
+/// widgets inside the window if the value is not 0. Either way you have to call
+/// `nk_end` at the end of window declarations. Furthermore, do not attempt to
+/// nest `nk_begin_xxx` calls which will hopefully result in an assert or if not
+/// in a segmentation fault.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // [... widgets ...]
+/// }
+/// nk_end(ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// In the grand concept window and widget declarations need to occur after input
+/// handling and before drawing to screen. Not doing so can result in higher
+/// latency or at worst invalid behavior. Furthermore make sure that `nk_clear`
+/// is called at the end of the frame. While nuklear's default platform backends
+/// already call `nk_clear` for you if you write your own backend not calling
+/// `nk_clear` can cause asserts or even worse undefined behavior.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_context ctx;
+/// nk_init_xxx(&ctx, ...);
+/// while (1) {
+/// Event evt;
+/// nk_input_begin(&ctx);
+/// while (GetEvent(&evt)) {
+/// if (evt.type == MOUSE_MOVE)
+/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+/// else if (evt.type == [...]) {
+/// nk_input_xxx(...);
+/// }
+/// }
+/// nk_input_end(&ctx);
+///
+/// if (nk_begin_xxx(...) {
+/// //[...]
+/// }
+/// nk_end(ctx);
+///
+/// const struct nk_command *cmd = 0;
+/// nk_foreach(cmd, &ctx) {
+/// case NK_COMMAND_LINE:
+/// your_draw_line_function(...)
+/// break;
+/// case NK_COMMAND_RECT
+/// your_draw_rect_function(...)
+/// break;
+/// case //...:
+/// //[...]
+/// }
+/// nk_clear(&ctx);
+/// }
+/// nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Reference
+/// Function | Description
+/// ------------------------------------|----------------------------------------
+/// nk_begin | Starts a new window; needs to be called every frame for every window (unless hidden) or otherwise the window gets removed
+/// nk_begin_titled | Extended window start with separated title and identifier to allow multiple windows with same name but not title
+/// nk_end | Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup
+//
+/// nk_window_find | Finds and returns the window with give name
+/// nk_window_get_bounds | Returns a rectangle with screen position and size of the currently processed window.
+/// nk_window_get_position | Returns the position of the currently processed window
+/// nk_window_get_size | Returns the size with width and height of the currently processed window
+/// nk_window_get_width | Returns the width of the currently processed window
+/// nk_window_get_height | Returns the height of the currently processed window
+/// nk_window_get_panel | Returns the underlying panel which contains all processing state of the current window
+/// nk_window_get_content_region | Returns the position and size of the currently visible and non-clipped space inside the currently processed window
+/// nk_window_get_content_region_min | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window
+/// nk_window_get_content_region_max | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window
+/// nk_window_get_content_region_size | Returns the size of the currently visible and non-clipped space inside the currently processed window
+/// nk_window_get_canvas | Returns the draw command buffer. Can be used to draw custom widgets
+/// nk_window_has_focus | Returns if the currently processed window is currently active
+/// nk_window_is_collapsed | Returns if the window with given name is currently minimized/collapsed
+/// nk_window_is_closed | Returns if the currently processed window was closed
+/// nk_window_is_hidden | Returns if the currently processed window was hidden
+/// nk_window_is_active | Same as nk_window_has_focus for some reason
+/// nk_window_is_hovered | Returns if the currently processed window is currently being hovered by mouse
+/// nk_window_is_any_hovered | Return if any window currently hovered
+/// nk_item_is_any_active | Returns if any window or widgets is currently hovered or active
+//
+/// nk_window_set_bounds | Updates position and size of the currently processed window
+/// nk_window_set_position | Updates position of the currently process window
+/// nk_window_set_size | Updates the size of the currently processed window
+/// nk_window_set_focus | Set the currently processed window as active window
+//
+/// nk_window_close | Closes the window with given window name which deletes the window at the end of the frame
+/// nk_window_collapse | Collapses the window with given window name
+/// nk_window_collapse_if | Collapses the window with given window name if the given condition was met
+/// nk_window_show | Hides a visible or reshows a hidden window
+/// nk_window_show_if | Hides/shows a window depending on condition
+*/
+/*
+/// #### nk_panel_flags
+/// Flag | Description
+/// ----------------------------|----------------------------------------
+/// NK_WINDOW_BORDER | Draws a border around the window to visually separate window from the background
+/// NK_WINDOW_MOVABLE | The movable flag indicates that a window can be moved by user input or by dragging the window header
+/// NK_WINDOW_SCALABLE | The scalable flag indicates that a window can be scaled by user input by dragging a scaler icon at the button of the window
+/// NK_WINDOW_CLOSABLE | Adds a closable icon into the header
+/// NK_WINDOW_MINIMIZABLE | Adds a minimize icon into the header
+/// NK_WINDOW_NO_SCROLLBAR | Removes the scrollbar from the window
+/// NK_WINDOW_TITLE | Forces a header at the top at the window showing the title
+/// NK_WINDOW_SCROLL_AUTO_HIDE | Automatically hides the window scrollbar if no user interaction: also requires delta time in `nk_context` to be set each frame
+/// NK_WINDOW_BACKGROUND | Always keep window in the background
+/// NK_WINDOW_SCALE_LEFT | Puts window scaler in the left-ottom corner instead right-bottom
+/// NK_WINDOW_NO_INPUT | Prevents window of scaling, moving or getting focus
+///
+/// #### nk_collapse_states
+/// State | Description
+/// ----------------|-----------------------------------------------------------
+/// __NK_MINIMIZED__| UI section is collased and not visibile until maximized
+/// __NK_MAXIMIZED__| UI section is extended and visibile until minimized
+///
+*/
+enum nk_panel_flags {
+ NK_WINDOW_BORDER = NK_FLAG(0),
+ NK_WINDOW_MOVABLE = NK_FLAG(1),
+ NK_WINDOW_SCALABLE = NK_FLAG(2),
+ NK_WINDOW_CLOSABLE = NK_FLAG(3),
+ NK_WINDOW_MINIMIZABLE = NK_FLAG(4),
+ NK_WINDOW_NO_SCROLLBAR = NK_FLAG(5),
+ NK_WINDOW_TITLE = NK_FLAG(6),
+ NK_WINDOW_SCROLL_AUTO_HIDE = NK_FLAG(7),
+ NK_WINDOW_BACKGROUND = NK_FLAG(8),
+ NK_WINDOW_SCALE_LEFT = NK_FLAG(9),
+ NK_WINDOW_NO_INPUT = NK_FLAG(10)
+};
+/*/// #### nk_begin
+/// Starts a new window; needs to be called every frame for every
+/// window (unless hidden) or otherwise the window gets removed
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __title__ | Window title and identifier. Needs to be persistent over frames to identify the window
+/// __bounds__ | Initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame
+/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different window behaviors
+///
+/// Returns `true(1)` if the window can be filled up with widgets from this point
+/// until `nk_end` or `false(0)` otherwise for example if minimized
+*/
+NK_API int nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags);
+/*/// #### nk_begin_titled
+/// Extended window start with separated title and identifier to allow multiple
+/// windows with same title but not name
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Window identifier. Needs to be persistent over frames to identify the window
+/// __title__ | Window title displayed inside header if flag `NK_WINDOW_TITLE` or either `NK_WINDOW_CLOSABLE` or `NK_WINDOW_MINIMIZED` was set
+/// __bounds__ | Initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame
+/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different window behaviors
+///
+/// Returns `true(1)` if the window can be filled up with widgets from this point
+/// until `nk_end` or `false(0)` otherwise for example if minimized
+*/
+NK_API int nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags);
+/*/// #### nk_end
+/// Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup.
+/// All widget calls after this functions will result in asserts or no state changes
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_end(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+*/
+NK_API void nk_end(struct nk_context *ctx);
+/*/// #### nk_window_find
+/// Finds and returns a window from passed name
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_end(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Window identifier
+///
+/// Returns a `nk_window` struct pointing to the identified window or NULL if
+/// no window with the given name was found
+*/
+NK_API struct nk_window *nk_window_find(struct nk_context *ctx, const char *name);
+/*/// #### nk_window_get_bounds
+/// Returns a rectangle with screen position and size of the currently processed window
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns a `nk_rect` struct with window upper left window position and size
+*/
+NK_API struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
+/*/// #### nk_window_get_position
+/// Returns the position of the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_window_get_position(const struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns a `nk_vec2` struct with window upper left position
+*/
+NK_API struct nk_vec2 nk_window_get_position(const struct nk_context *ctx);
+/*/// #### nk_window_get_size
+/// Returns the size with width and height of the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_window_get_size(const struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns a `nk_vec2` struct with window width and height
+*/
+NK_API struct nk_vec2 nk_window_get_size(const struct nk_context*);
+/*/// #### nk_window_get_width
+/// Returns the width of the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// float nk_window_get_width(const struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns the current window width
+*/
+NK_API float nk_window_get_width(const struct nk_context*);
+/*/// #### nk_window_get_height
+/// Returns the height of the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// float nk_window_get_height(const struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns the current window height
+*/
+NK_API float nk_window_get_height(const struct nk_context*);
+/*/// #### nk_window_get_panel
+/// Returns the underlying panel which contains all processing state of the current window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// !!! WARNING
+/// Do not keep the returned panel pointer around, it is only valid until `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_panel* nk_window_get_panel(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns a pointer to window internal `nk_panel` state.
+*/
+NK_API struct nk_panel* nk_window_get_panel(struct nk_context*);
+/*/// #### nk_window_get_content_region
+/// Returns the position and size of the currently visible and non-clipped space
+/// inside the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_rect nk_window_get_content_region(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `nk_rect` struct with screen position and size (no scrollbar offset)
+/// of the visible space inside the current window
+*/
+NK_API struct nk_rect nk_window_get_content_region(struct nk_context*);
+/*/// #### nk_window_get_content_region_min
+/// Returns the upper left position of the currently visible and non-clipped
+/// space inside the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_window_get_content_region_min(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// returns `nk_vec2` struct with upper left screen position (no scrollbar offset)
+/// of the visible space inside the current window
+*/
+NK_API struct nk_vec2 nk_window_get_content_region_min(struct nk_context*);
+/*/// #### nk_window_get_content_region_max
+/// Returns the lower right screen position of the currently visible and
+/// non-clipped space inside the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_window_get_content_region_max(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `nk_vec2` struct with lower right screen position (no scrollbar offset)
+/// of the visible space inside the current window
+*/
+NK_API struct nk_vec2 nk_window_get_content_region_max(struct nk_context*);
+/*/// #### nk_window_get_content_region_size
+/// Returns the size of the currently visible and non-clipped space inside the
+/// currently processed window
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_window_get_content_region_size(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `nk_vec2` struct with size the visible space inside the current window
+*/
+NK_API struct nk_vec2 nk_window_get_content_region_size(struct nk_context*);
+/*/// #### nk_window_get_canvas
+/// Returns the draw command buffer. Can be used to draw custom widgets
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// !!! WARNING
+/// Do not keep the returned command buffer pointer around it is only valid until `nk_end`
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_command_buffer* nk_window_get_canvas(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns a pointer to window internal `nk_command_buffer` struct used as
+/// drawing canvas. Can be used to do custom drawing.
+*/
+NK_API struct nk_command_buffer* nk_window_get_canvas(struct nk_context*);
+/*/// #### nk_window_has_focus
+/// Returns if the currently processed window is currently active
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_has_focus(const struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `false(0)` if current window is not active or `true(1)` if it is
+*/
+NK_API int nk_window_has_focus(const struct nk_context*);
+/*/// #### nk_window_is_hovered
+/// Return if the current window is being hovered
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_is_hovered(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `true(1)` if current window is hovered or `false(0)` otherwise
+*/
+NK_API int nk_window_is_hovered(struct nk_context*);
+/*/// #### nk_window_is_collapsed
+/// Returns if the window with given name is currently minimized/collapsed
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_is_collapsed(struct nk_context *ctx, const char *name);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of window you want to check if it is collapsed
+///
+/// Returns `true(1)` if current window is minimized and `false(0)` if window not
+/// found or is not minimized
+*/
+NK_API int nk_window_is_collapsed(struct nk_context *ctx, const char *name);
+/*/// #### nk_window_is_closed
+/// Returns if the window with given name was closed by calling `nk_close`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_is_closed(struct nk_context *ctx, const char *name);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of window you want to check if it is closed
+///
+/// Returns `true(1)` if current window was closed or `false(0)` window not found or not closed
+*/
+NK_API int nk_window_is_closed(struct nk_context*, const char*);
+/*/// #### nk_window_is_hidden
+/// Returns if the window with given name is hidden
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_is_hidden(struct nk_context *ctx, const char *name);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of window you want to check if it is hidden
+///
+/// Returns `true(1)` if current window is hidden or `false(0)` window not found or visible
+*/
+NK_API int nk_window_is_hidden(struct nk_context*, const char*);
+/*/// #### nk_window_is_active
+/// Same as nk_window_has_focus for some reason
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_is_active(struct nk_context *ctx, const char *name);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of window you want to check if it is active
+///
+/// Returns `true(1)` if current window is active or `false(0)` window not found or not active
+*/
+NK_API int nk_window_is_active(struct nk_context*, const char*);
+/*/// #### nk_window_is_any_hovered
+/// Returns if the any window is being hovered
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_is_any_hovered(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `true(1)` if any window is hovered or `false(0)` otherwise
+*/
+NK_API int nk_window_is_any_hovered(struct nk_context*);
+/*/// #### nk_item_is_any_active
+/// Returns if the any window is being hovered or any widget is currently active.
+/// Can be used to decide if input should be processed by UI or your specific input handling.
+/// Example could be UI and 3D camera to move inside a 3D space.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_item_is_any_active(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `true(1)` if any window is hovered or any item is active or `false(0)` otherwise
+*/
+NK_API int nk_item_is_any_active(struct nk_context*);
+/*/// #### nk_window_set_bounds
+/// Updates position and size of window with passed in name
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to modify both position and size
+/// __bounds__ | Must point to a `nk_rect` struct with the new position and size
+*/
+NK_API void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds);
+/*/// #### nk_window_set_position
+/// Updates position of window with passed name
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_set_position(struct nk_context*, const char *name, struct nk_vec2 pos);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to modify both position
+/// __pos__ | Must point to a `nk_vec2` struct with the new position
+*/
+NK_API void nk_window_set_position(struct nk_context*, const char *name, struct nk_vec2 pos);
+/*/// #### nk_window_set_size
+/// Updates size of window with passed in name
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_set_size(struct nk_context*, const char *name, struct nk_vec2);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to modify both window size
+/// __size__ | Must point to a `nk_vec2` struct with new window size
+*/
+NK_API void nk_window_set_size(struct nk_context*, const char *name, struct nk_vec2);
+/*/// #### nk_window_set_focus
+/// Sets the window with given name as active
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_set_focus(struct nk_context*, const char *name);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to set focus on
+*/
+NK_API void nk_window_set_focus(struct nk_context*, const char *name);
+/*/// #### nk_window_close
+/// Closes a window and marks it for being freed at the end of the frame
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_close(struct nk_context *ctx, const char *name);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to close
+*/
+NK_API void nk_window_close(struct nk_context *ctx, const char *name);
+/*/// #### nk_window_collapse
+/// Updates collapse state of a window with given name
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_collapse(struct nk_context*, const char *name, enum nk_collapse_states state);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to close
+/// __state__ | value out of nk_collapse_states section
+*/
+NK_API void nk_window_collapse(struct nk_context*, const char *name, enum nk_collapse_states state);
+/*/// #### nk_window_collapse_if
+/// Updates collapse state of a window with given name if given condition is met
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_collapse_if(struct nk_context*, const char *name, enum nk_collapse_states, int cond);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to either collapse or maximize
+/// __state__ | value out of nk_collapse_states section the window should be put into
+/// __cond__ | condition that has to be met to actually commit the collapse state change
+*/
+NK_API void nk_window_collapse_if(struct nk_context*, const char *name, enum nk_collapse_states, int cond);
+/*/// #### nk_window_show
+/// updates visibility state of a window with given name
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_show(struct nk_context*, const char *name, enum nk_show_states);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to either collapse or maximize
+/// __state__ | state with either visible or hidden to modify the window with
+*/
+NK_API void nk_window_show(struct nk_context*, const char *name, enum nk_show_states);
+/*/// #### nk_window_show_if
+/// Updates visibility state of a window with given name if a given condition is met
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_show_if(struct nk_context*, const char *name, enum nk_show_states, int cond);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to either hide or show
+/// __state__ | state with either visible or hidden to modify the window with
+/// __cond__ | condition that has to be met to actually commit the visbility state change
+*/
+NK_API void nk_window_show_if(struct nk_context*, const char *name, enum nk_show_states, int cond);
+/* =============================================================================
+ *
+ * LAYOUT
+ *
+ * =============================================================================
+/// ### Layouting
+/// Layouting in general describes placing widget inside a window with position and size.
+/// While in this particular implementation there are five different APIs for layouting
+/// each with different trade offs between control and ease of use.
+///
+/// All layouting methods in this library are based around the concept of a row.
+/// A row has a height the window content grows by and a number of columns and each
+/// layouting method specifies how each widget is placed inside the row.
+/// After a row has been allocated by calling a layouting functions and then
+/// filled with widgets will advance an internal pointer over the allocated row.
+///
+/// To actually define a layout you just call the appropriate layouting function
+/// and each subsequent widget call will place the widget as specified. Important
+/// here is that if you define more widgets then columns defined inside the layout
+/// functions it will allocate the next row without you having to make another layouting
+/// call.
+///
+/// Biggest limitation with using all these APIs outside the `nk_layout_space_xxx` API
+/// is that you have to define the row height for each. However the row height
+/// often depends on the height of the font.
+///
+/// To fix that internally nuklear uses a minimum row height that is set to the
+/// height plus padding of currently active font and overwrites the row height
+/// value if zero.
+///
+/// If you manually want to change the minimum row height then
+/// use nk_layout_set_min_row_height, and use nk_layout_reset_min_row_height to
+/// reset it back to be derived from font height.
+///
+/// Also if you change the font in nuklear it will automatically change the minimum
+/// row height for you and. This means if you change the font but still want
+/// a minimum row height smaller than the font you have to repush your value.
+///
+/// For actually more advanced UI I would even recommend using the `nk_layout_space_xxx`
+/// layouting method in combination with a cassowary constraint solver (there are
+/// some versions on github with permissive license model) to take over all control over widget
+/// layouting yourself. However for quick and dirty layouting using all the other layouting
+/// functions should be fine.
+///
+/// #### Usage
+/// 1. __nk_layout_row_dynamic__
+/// The easiest layouting function is `nk_layout_row_dynamic`. It provides each
+/// widgets with same horizontal space inside the row and dynamically grows
+/// if the owning window grows in width. So the number of columns dictates
+/// the size of each widget dynamically by formula:
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// widget_width = (window_width - padding - spacing) * (1/colum_count)
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Just like all other layouting APIs if you define more widget than columns this
+/// library will allocate a new row and keep all layouting parameters previously
+/// defined.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // first row with height: 30 composed of two widgets
+/// nk_layout_row_dynamic(&ctx, 30, 2);
+/// nk_widget(...);
+/// nk_widget(...);
+/// //
+/// // second row with same parameter as defined above
+/// nk_widget(...);
+/// nk_widget(...);
+/// //
+/// // third row uses 0 for height which will use auto layouting
+/// nk_layout_row_dynamic(&ctx, 0, 2);
+/// nk_widget(...);
+/// nk_widget(...);
+/// }
+/// nk_end(...);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// 2. __nk_layout_row_static__
+/// Another easy layouting function is `nk_layout_row_static`. It provides each
+/// widget with same horizontal pixel width inside the row and does not grow
+/// if the owning window scales smaller or bigger.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // first row with height: 30 composed of two widgets with width: 80
+/// nk_layout_row_static(&ctx, 30, 80, 2);
+/// nk_widget(...);
+/// nk_widget(...);
+/// //
+/// // second row with same parameter as defined above
+/// nk_widget(...);
+/// nk_widget(...);
+/// //
+/// // third row uses 0 for height which will use auto layouting
+/// nk_layout_row_static(&ctx, 0, 80, 2);
+/// nk_widget(...);
+/// nk_widget(...);
+/// }
+/// nk_end(...);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// 3. __nk_layout_row_xxx__
+/// A little bit more advanced layouting API are functions `nk_layout_row_begin`,
+/// `nk_layout_row_push` and `nk_layout_row_end`. They allow to directly
+/// specify each column pixel or window ratio in a row. It supports either
+/// directly setting per column pixel width or widget window ratio but not
+/// both. Furthermore it is a immediate mode API so each value is directly
+/// pushed before calling a widget. Therefore the layout is not automatically
+/// repeating like the last two layouting functions.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // first row with height: 25 composed of two widgets with width 60 and 40
+/// nk_layout_row_begin(ctx, NK_STATIC, 25, 2);
+/// nk_layout_row_push(ctx, 60);
+/// nk_widget(...);
+/// nk_layout_row_push(ctx, 40);
+/// nk_widget(...);
+/// nk_layout_row_end(ctx);
+/// //
+/// // second row with height: 25 composed of two widgets with window ratio 0.25 and 0.75
+/// nk_layout_row_begin(ctx, NK_DYNAMIC, 25, 2);
+/// nk_layout_row_push(ctx, 0.25f);
+/// nk_widget(...);
+/// nk_layout_row_push(ctx, 0.75f);
+/// nk_widget(...);
+/// nk_layout_row_end(ctx);
+/// //
+/// // third row with auto generated height: composed of two widgets with window ratio 0.25 and 0.75
+/// nk_layout_row_begin(ctx, NK_DYNAMIC, 0, 2);
+/// nk_layout_row_push(ctx, 0.25f);
+/// nk_widget(...);
+/// nk_layout_row_push(ctx, 0.75f);
+/// nk_widget(...);
+/// nk_layout_row_end(ctx);
+/// }
+/// nk_end(...);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// 4. __nk_layout_row__
+/// The array counterpart to API nk_layout_row_xxx is the single nk_layout_row
+/// functions. Instead of pushing either pixel or window ratio for every widget
+/// it allows to define it by array. The trade of for less control is that
+/// `nk_layout_row` is automatically repeating. Otherwise the behavior is the
+/// same.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // two rows with height: 30 composed of two widgets with width 60 and 40
+/// const float size[] = {60,40};
+/// nk_layout_row(ctx, NK_STATIC, 30, 2, ratio);
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// //
+/// // two rows with height: 30 composed of two widgets with window ratio 0.25 and 0.75
+/// const float ratio[] = {0.25, 0.75};
+/// nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio);
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// //
+/// // two rows with auto generated height composed of two widgets with window ratio 0.25 and 0.75
+/// const float ratio[] = {0.25, 0.75};
+/// nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio);
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// }
+/// nk_end(...);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// 5. __nk_layout_row_template_xxx__
+/// The most complex and second most flexible API is a simplified flexbox version without
+/// line wrapping and weights for dynamic widgets. It is an immediate mode API but
+/// unlike `nk_layout_row_xxx` it has auto repeat behavior and needs to be called
+/// before calling the templated widgets.
+/// The row template layout has three different per widget size specifier. The first
+/// one is the `nk_layout_row_template_push_static` with fixed widget pixel width.
+/// They do not grow if the row grows and will always stay the same.
+/// The second size specifier is `nk_layout_row_template_push_variable`
+/// which defines a minimum widget size but it also can grow if more space is available
+/// not taken by other widgets.
+/// Finally there are dynamic widgets with `nk_layout_row_template_push_dynamic`
+/// which are completely flexible and unlike variable widgets can even shrink
+/// to zero if not enough space is provided.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // two rows with height: 30 composed of three widgets
+/// nk_layout_row_template_begin(ctx, 30);
+/// nk_layout_row_template_push_dynamic(ctx);
+/// nk_layout_row_template_push_variable(ctx, 80);
+/// nk_layout_row_template_push_static(ctx, 80);
+/// nk_layout_row_template_end(ctx);
+/// //
+/// // first row
+/// nk_widget(...); // dynamic widget can go to zero if not enough space
+/// nk_widget(...); // variable widget with min 80 pixel but can grow bigger if enough space
+/// nk_widget(...); // static widget with fixed 80 pixel width
+/// //
+/// // second row same layout
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// }
+/// nk_end(...);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// 6. __nk_layout_space_xxx__
+/// Finally the most flexible API directly allows you to place widgets inside the
+/// window. The space layout API is an immediate mode API which does not support
+/// row auto repeat and directly sets position and size of a widget. Position
+/// and size hereby can be either specified as ratio of allocated space or
+/// allocated space local position and pixel size. Since this API is quite
+/// powerful there are a number of utility functions to get the available space
+/// and convert between local allocated space and screen space.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // static row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered)
+/// nk_layout_space_begin(ctx, NK_STATIC, 500, INT_MAX);
+/// nk_layout_space_push(ctx, nk_rect(0,0,150,200));
+/// nk_widget(...);
+/// nk_layout_space_push(ctx, nk_rect(200,200,100,200));
+/// nk_widget(...);
+/// nk_layout_space_end(ctx);
+/// //
+/// // dynamic row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered)
+/// nk_layout_space_begin(ctx, NK_DYNAMIC, 500, INT_MAX);
+/// nk_layout_space_push(ctx, nk_rect(0.5,0.5,0.1,0.1));
+/// nk_widget(...);
+/// nk_layout_space_push(ctx, nk_rect(0.7,0.6,0.1,0.1));
+/// nk_widget(...);
+/// }
+/// nk_end(...);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Reference
+/// Function | Description
+/// ----------------------------------------|------------------------------------
+/// nk_layout_set_min_row_height | Set the currently used minimum row height to a specified value
+/// nk_layout_reset_min_row_height | Resets the currently used minimum row height to font height
+/// nk_layout_widget_bounds | Calculates current width a static layout row can fit inside a window
+/// nk_layout_ratio_from_pixel | Utility functions to calculate window ratio from pixel size
+//
+/// nk_layout_row_dynamic | Current layout is divided into n same sized growing columns
+/// nk_layout_row_static | Current layout is divided into n same fixed sized columns
+/// nk_layout_row_begin | Starts a new row with given height and number of columns
+/// nk_layout_row_push | Pushes another column with given size or window ratio
+/// nk_layout_row_end | Finished previously started row
+/// nk_layout_row | Specifies row columns in array as either window ratio or size
+//
+/// nk_layout_row_template_begin | Begins the row template declaration
+/// nk_layout_row_template_push_dynamic | Adds a dynamic column that dynamically grows and can go to zero if not enough space
+/// nk_layout_row_template_push_variable | Adds a variable column that dynamically grows but does not shrink below specified pixel width
+/// nk_layout_row_template_push_static | Adds a static column that does not grow and will always have the same size
+/// nk_layout_row_template_end | Marks the end of the row template
+//
+/// nk_layout_space_begin | Begins a new layouting space that allows to specify each widgets position and size
+/// nk_layout_space_push | Pushes position and size of the next widget in own coordinate space either as pixel or ratio
+/// nk_layout_space_end | Marks the end of the layouting space
+//
+/// nk_layout_space_bounds | Callable after nk_layout_space_begin and returns total space allocated
+/// nk_layout_space_to_screen | Converts vector from nk_layout_space coordinate space into screen space
+/// nk_layout_space_to_local | Converts vector from screen space into nk_layout_space coordinates
+/// nk_layout_space_rect_to_screen | Converts rectangle from nk_layout_space coordinate space into screen space
+/// nk_layout_space_rect_to_local | Converts rectangle from screen space into nk_layout_space coordinates
+*/
+/*/// #### nk_layout_set_min_row_height
+/// Sets the currently used minimum row height.
+/// !!! WARNING
+/// The passed height needs to include both your preferred row height
+/// as well as padding. No internal padding is added.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_set_min_row_height(struct nk_context*, float height);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __height__ | New minimum row height to be used for auto generating the row height
+*/
+NK_API void nk_layout_set_min_row_height(struct nk_context*, float height);
+/*/// #### nk_layout_reset_min_row_height
+/// Reset the currently used minimum row height back to `font_height + text_padding + padding`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_reset_min_row_height(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+*/
+NK_API void nk_layout_reset_min_row_height(struct nk_context*);
+/*/// #### nk_layout_widget_bounds
+/// Returns the width of the next row allocate by one of the layouting functions
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_rect nk_layout_widget_bounds(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+///
+/// Return `nk_rect` with both position and size of the next row
+*/
+NK_API struct nk_rect nk_layout_widget_bounds(struct nk_context*);
+/*/// #### nk_layout_ratio_from_pixel
+/// Utility functions to calculate window ratio from pixel size
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// float nk_layout_ratio_from_pixel(struct nk_context*, float pixel_width);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __pixel__ | Pixel_width to convert to window ratio
+///
+/// Returns `nk_rect` with both position and size of the next row
+*/
+NK_API float nk_layout_ratio_from_pixel(struct nk_context*, float pixel_width);
+/*/// #### nk_layout_row_dynamic
+/// Sets current row layout to share horizontal space
+/// between @cols number of widgets evenly. Once called all subsequent widget
+/// calls greater than @cols will allocate a new row with same layout.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __height__ | Holds height of each widget in row or zero for auto layouting
+/// __columns__ | Number of widget inside row
+*/
+NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols);
+/*/// #### nk_layout_row_static
+/// Sets current row layout to fill @cols number of widgets
+/// in row with same @item_width horizontal size. Once called all subsequent widget
+/// calls greater than @cols will allocate a new row with same layout.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __height__ | Holds height of each widget in row or zero for auto layouting
+/// __width__ | Holds pixel width of each widget in the row
+/// __columns__ | Number of widget inside row
+*/
+NK_API void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols);
+/*/// #### nk_layout_row_begin
+/// Starts a new dynamic or fixed row with given height and columns.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __fmt__ | either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns
+/// __height__ | holds height of each widget in row or zero for auto layouting
+/// __columns__ | Number of widget inside row
+*/
+NK_API void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols);
+/*/// #### nk_layout_row_push
+/// Specifies either window ratio or width of a single column
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_push(struct nk_context*, float value);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __value__ | either a window ratio or fixed width depending on @fmt in previous `nk_layout_row_begin` call
+*/
+NK_API void nk_layout_row_push(struct nk_context*, float value);
+/*/// #### nk_layout_row_end
+/// Finished previously started row
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_end(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+*/
+NK_API void nk_layout_row_end(struct nk_context*);
+/*/// #### nk_layout_row
+/// Specifies row columns in array as either window ratio or size
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __fmt__ | Either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns
+/// __height__ | Holds height of each widget in row or zero for auto layouting
+/// __columns__ | Number of widget inside row
+*/
+NK_API void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio);
+/*/// #### nk_layout_row_template_begin
+/// Begins the row template declaration
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_template_begin(struct nk_context*, float row_height);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __height__ | Holds height of each widget in row or zero for auto layouting
+*/
+NK_API void nk_layout_row_template_begin(struct nk_context*, float row_height);
+/*/// #### nk_layout_row_template_push_dynamic
+/// Adds a dynamic column that dynamically grows and can go to zero if not enough space
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_template_push_dynamic(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __height__ | Holds height of each widget in row or zero for auto layouting
+*/
+NK_API void nk_layout_row_template_push_dynamic(struct nk_context*);
+/*/// #### nk_layout_row_template_push_variable
+/// Adds a variable column that dynamically grows but does not shrink below specified pixel width
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_template_push_variable(struct nk_context*, float min_width);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __width__ | Holds the minimum pixel width the next column must always be
+*/
+NK_API void nk_layout_row_template_push_variable(struct nk_context*, float min_width);
+/*/// #### nk_layout_row_template_push_static
+/// Adds a static column that does not grow and will always have the same size
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_template_push_static(struct nk_context*, float width);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __width__ | Holds the absolute pixel width value the next column must be
+*/
+NK_API void nk_layout_row_template_push_static(struct nk_context*, float width);
+/*/// #### nk_layout_row_template_end
+/// Marks the end of the row template
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_template_end(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+*/
+NK_API void nk_layout_row_template_end(struct nk_context*);
+/*/// #### nk_layout_space_begin
+/// Begins a new layouting space that allows to specify each widgets position and size.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __fmt__ | Either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns
+/// __height__ | Holds height of each widget in row or zero for auto layouting
+/// __columns__ | Number of widgets inside row
+*/
+NK_API void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count);
+/*/// #### nk_layout_space_push
+/// Pushes position and size of the next widget in own coordinate space either as pixel or ratio
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_space_push(struct nk_context *ctx, struct nk_rect bounds);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+/// __bounds__ | Position and size in laoyut space local coordinates
+*/
+NK_API void nk_layout_space_push(struct nk_context*, struct nk_rect bounds);
+/*/// #### nk_layout_space_end
+/// Marks the end of the layout space
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_space_end(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+*/
+NK_API void nk_layout_space_end(struct nk_context*);
+/*/// #### nk_layout_space_bounds
+/// Utility function to calculate total space allocated for `nk_layout_space`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_rect nk_layout_space_bounds(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+///
+/// Returns `nk_rect` holding the total space allocated
+*/
+NK_API struct nk_rect nk_layout_space_bounds(struct nk_context*);
+/*/// #### nk_layout_space_to_screen
+/// Converts vector from nk_layout_space coordinate space into screen space
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_layout_space_to_screen(struct nk_context*, struct nk_vec2);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+/// __vec__ | Position to convert from layout space into screen coordinate space
+///
+/// Returns transformed `nk_vec2` in screen space coordinates
+*/
+NK_API struct nk_vec2 nk_layout_space_to_screen(struct nk_context*, struct nk_vec2);
+/*/// #### nk_layout_space_to_local
+/// Converts vector from layout space into screen space
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_layout_space_to_local(struct nk_context*, struct nk_vec2);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+/// __vec__ | Position to convert from screen space into layout coordinate space
+///
+/// Returns transformed `nk_vec2` in layout space coordinates
+*/
+NK_API struct nk_vec2 nk_layout_space_to_local(struct nk_context*, struct nk_vec2);
+/*/// #### nk_layout_space_rect_to_screen
+/// Converts rectangle from screen space into layout space
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_rect nk_layout_space_rect_to_screen(struct nk_context*, struct nk_rect);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+/// __bounds__ | Rectangle to convert from layout space into screen space
+///
+/// Returns transformed `nk_rect` in screen space coordinates
+*/
+NK_API struct nk_rect nk_layout_space_rect_to_screen(struct nk_context*, struct nk_rect);
+/*/// #### nk_layout_space_rect_to_local
+/// Converts rectangle from layout space into screen space
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_rect nk_layout_space_rect_to_local(struct nk_context*, struct nk_rect);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+/// __bounds__ | Rectangle to convert from layout space into screen space
+///
+/// Returns transformed `nk_rect` in layout space coordinates
+*/
+NK_API struct nk_rect nk_layout_space_rect_to_local(struct nk_context*, struct nk_rect);
+/* =============================================================================
+ *
+ * GROUP
+ *
+ * =============================================================================
+/// ### Groups
+/// Groups are basically windows inside windows. They allow to subdivide space
+/// in a window to layout widgets as a group. Almost all more complex widget
+/// layouting requirements can be solved using groups and basic layouting
+/// fuctionality. Groups just like windows are identified by an unique name and
+/// internally keep track of scrollbar offsets by default. However additional
+/// versions are provided to directly manage the scrollbar.
+///
+/// #### Usage
+/// To create a group you have to call one of the three `nk_group_begin_xxx`
+/// functions to start group declarations and `nk_group_end` at the end. Furthermore it
+/// is required to check the return value of `nk_group_begin_xxx` and only process
+/// widgets inside the window if the value is not 0.
+/// Nesting groups is possible and even encouraged since many layouting schemes
+/// can only be achieved by nesting. Groups, unlike windows, need `nk_group_end`
+/// to be only called if the corosponding `nk_group_begin_xxx` call does not return 0:
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_group_begin_xxx(ctx, ...) {
+/// // [... widgets ...]
+/// nk_group_end(ctx);
+/// }
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// In the grand concept groups can be called after starting a window
+/// with `nk_begin_xxx` and before calling `nk_end`:
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_context ctx;
+/// nk_init_xxx(&ctx, ...);
+/// while (1) {
+/// // Input
+/// Event evt;
+/// nk_input_begin(&ctx);
+/// while (GetEvent(&evt)) {
+/// if (evt.type == MOUSE_MOVE)
+/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+/// else if (evt.type == [...]) {
+/// nk_input_xxx(...);
+/// }
+/// }
+/// nk_input_end(&ctx);
+/// //
+/// // Window
+/// if (nk_begin_xxx(...) {
+/// // [...widgets...]
+/// nk_layout_row_dynamic(...);
+/// if (nk_group_begin_xxx(ctx, ...) {
+/// //[... widgets ...]
+/// nk_group_end(ctx);
+/// }
+/// }
+/// nk_end(ctx);
+/// //
+/// // Draw
+/// const struct nk_command *cmd = 0;
+/// nk_foreach(cmd, &ctx) {
+/// switch (cmd->type) {
+/// case NK_COMMAND_LINE:
+/// your_draw_line_function(...)
+/// break;
+/// case NK_COMMAND_RECT
+/// your_draw_rect_function(...)
+/// break;
+/// case ...:
+/// // [...]
+/// }
+// nk_clear(&ctx);
+/// }
+/// nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/// #### Reference
+/// Function | Description
+/// --------------------------------|-------------------------------------------
+/// nk_group_begin | Start a new group with internal scrollbar handling
+/// nk_group_begin_titled | Start a new group with separeted name and title and internal scrollbar handling
+/// nk_group_end | Ends a group. Should only be called if nk_group_begin returned non-zero
+/// nk_group_scrolled_offset_begin | Start a new group with manual separated handling of scrollbar x- and y-offset
+/// nk_group_scrolled_begin | Start a new group with manual scrollbar handling
+/// nk_group_scrolled_end | Ends a group with manual scrollbar handling. Should only be called if nk_group_begin returned non-zero
+*/
+/*/// #### nk_group_begin
+/// Starts a new widget group. Requires a previous layouting function to specify a pos/size.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_group_begin(struct nk_context*, const char *title, nk_flags);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __title__ | Must be an unique identifier for this group that is also used for the group header
+/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different group behaviors
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+NK_API int nk_group_begin(struct nk_context*, const char *title, nk_flags);
+/*/// #### nk_group_begin_titled
+/// Starts a new widget group. Requires a previous layouting function to specify a pos/size.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __id__ | Must be an unique identifier for this group
+/// __title__ | Group header title
+/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different group behaviors
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+NK_API int nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags);
+/*/// #### nk_group_end
+/// Ends a widget group
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_group_end(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+*/
+NK_API void nk_group_end(struct nk_context*);
+/*/// #### nk_group_scrolled_offset_begin
+/// starts a new widget group. requires a previous layouting function to specify
+/// a size. Does not keep track of scrollbar.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __x_offset__| Scrollbar x-offset to offset all widgets inside the group horizontally.
+/// __y_offset__| Scrollbar y-offset to offset all widgets inside the group vertically
+/// __title__ | Window unique group title used to both identify and display in the group header
+/// __flags__ | Window flags from the nk_panel_flags section
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+NK_API int nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags);
+/*/// #### nk_group_scrolled_begin
+/// Starts a new widget group. requires a previous
+/// layouting function to specify a size. Does not keep track of scrollbar.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __off__ | Both x- and y- scroll offset. Allows for manual scrollbar control
+/// __title__ | Window unique group title used to both identify and display in the group header
+/// __flags__ | Window flags from nk_panel_flags section
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+NK_API int nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags);
+/*/// #### nk_group_scrolled_end
+/// Ends a widget group after calling nk_group_scrolled_offset_begin or nk_group_scrolled_begin.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_group_scrolled_end(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+*/
+NK_API void nk_group_scrolled_end(struct nk_context*);
+/* =============================================================================
+ *
+ * TREE
+ *
+ * =============================================================================
+/// ### Tree
+/// Trees represent two different concept. First the concept of a collapsable
+/// UI section that can be either in a hidden or visibile state. They allow the UI
+/// user to selectively minimize the current set of visible UI to comprehend.
+/// The second concept are tree widgets for visual UI representation of trees.
+///
+/// Trees thereby can be nested for tree representations and multiple nested
+/// collapsable UI sections. All trees are started by calling of the
+/// `nk_tree_xxx_push_tree` functions and ended by calling one of the
+/// `nk_tree_xxx_pop_xxx()` functions. Each starting functions takes a title label
+/// and optionally an image to be displayed and the initial collapse state from
+/// the nk_collapse_states section.
+
+
diff --git a/extern/glfw/docs/input.dox b/extern/glfw/docs/input.dox
new file mode 100644
index 0000000000..d9c27a6778
--- /dev/null
+++ b/extern/glfw/docs/input.dox
@@ -0,0 +1,950 @@
+/*!
+
+@page input_guide Input guide
+
+@tableofcontents
+
+This guide introduces the input related functions of GLFW. For details on
+a specific function in this category, see the @ref input. There are also guides
+for the other areas of GLFW.
+
+ - @ref intro_guide
+ - @ref window_guide
+ - @ref context_guide
+ - @ref vulkan_guide
+ - @ref monitor_guide
+
+GLFW provides many kinds of input. While some can only be polled, like time, or
+only received via callbacks, like scrolling, many provide both callbacks and
+polling. Callbacks are more work to use than polling but is less CPU intensive
+and guarantees that you do not miss state changes.
+
+All input callbacks receive a window handle. By using the
+[window user pointer](@ref window_userptr), you can access non-global structures
+or objects from your callbacks.
+
+To get a better feel for how the various events callbacks behave, run the
+`events` test program. It register every callback supported by GLFW and prints
+out all arguments provided for every event, along with time and sequence
+information.
+
+
+@section events Event processing
+
+GLFW needs to poll the window system for events both to provide input to the
+application and to prove to the window system that the application hasn't locked
+up. Event processing is normally done each frame after
+[buffer swapping](@ref buffer_swap). Even when you have no windows, event
+polling needs to be done in order to receive monitor and joystick connection
+events.
+
+There are three functions for processing pending events. @ref glfwPollEvents,
+processes only those events that have already been received and then returns
+immediately.
+
+@code
+glfwPollEvents();
+@endcode
+
+This is the best choice when rendering continuously, like most games do.
+
+If you only need to update the contents of the window when you receive new
+input, @ref glfwWaitEvents is a better choice.
+
+@code
+glfwWaitEvents();
+@endcode
+
+It puts the thread to sleep until at least one event has been received and then
+processes all received events. This saves a great deal of CPU cycles and is
+useful for, for example, editing tools.
+
+If you want to wait for events but have UI elements or other tasks that need
+periodic updates, @ref glfwWaitEventsTimeout lets you specify a timeout.
+
+@code
+glfwWaitEventsTimeout(0.7);
+@endcode
+
+It puts the thread to sleep until at least one event has been received, or until
+the specified number of seconds have elapsed. It then processes any received
+events.
+
+If the main thread is sleeping in @ref glfwWaitEvents, you can wake it from
+another thread by posting an empty event to the event queue with @ref
+glfwPostEmptyEvent.
+
+@code
+glfwPostEmptyEvent();
+@endcode
+
+Do not assume that callbacks will _only_ be called in response to the above
+functions. While it is necessary to process events in one or more of the ways
+above, window systems that require GLFW to register callbacks of its own can
+pass events to GLFW in response to many window system function calls. GLFW will
+pass those events on to the application callbacks before returning.
+
+For example, on Windows the system function that @ref glfwSetWindowSize is
+implemented with will send window size events directly to the event callback
+that every window has and that GLFW implements for its windows. If you have set
+a [window size callback](@ref window_size) GLFW will call it in turn with the
+new size before everything returns back out of the @ref glfwSetWindowSize call.
+
+
+@section input_keyboard Keyboard input
+
+GLFW divides keyboard input into two categories; key events and character
+events. Key events relate to actual physical keyboard keys, whereas character
+events relate to the Unicode code points generated by pressing some of them.
+
+Keys and characters do not map 1:1. A single key press may produce several
+characters, and a single character may require several keys to produce. This
+may not be the case on your machine, but your users are likely not all using the
+same keyboard layout, input method or even operating system as you.
+
+
+@subsection input_key Key input
+
+If you wish to be notified when a physical key is pressed or released or when it
+repeats, set a key callback.
+
+@code
+glfwSetKeyCallback(window, key_callback);
+@endcode
+
+The callback function receives the [keyboard key](@ref keys), platform-specific
+scancode, key action and [modifier bits](@ref mods).
+
+@code
+void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
+{
+ if (key == GLFW_KEY_E && action == GLFW_PRESS)
+ activate_airship();
+}
+@endcode
+
+The action is one of `GLFW_PRESS`, `GLFW_REPEAT` or `GLFW_RELEASE`. The key
+will be `GLFW_KEY_UNKNOWN` if GLFW lacks a key token for it, for example
+_E-mail_ and _Play_ keys.
+
+The scancode is unique for every key, regardless of whether it has a key token.
+Scancodes are platform-specific but consistent over time, so keys will have
+different scancodes depending on the platform but they are safe to save to disk.
+You can query the scancode for any [named key](@ref keys) on the current
+platform with @ref glfwGetKeyScancode.
+
+@code
+const int scancode = glfwGetKeyScancode(GLFW_KEY_X);
+set_key_mapping(scancode, swap_weapons);
+@endcode
+
+The last reported state for every [named key](@ref keys) is also saved in
+per-window state arrays that can be polled with @ref glfwGetKey.
+
+@code
+int state = glfwGetKey(window, GLFW_KEY_E);
+if (state == GLFW_PRESS)
+{
+ activate_airship();
+}
+@endcode
+
+The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`.
+
+This function only returns cached key event state. It does not poll the
+system for the current physical state of the key.
+
+@anchor GLFW_STICKY_KEYS
+Whenever you poll state, you risk missing the state change you are looking for.
+If a pressed key is released again before you poll its state, you will have
+missed the key press. The recommended solution for this is to use a
+key callback, but there is also the `GLFW_STICKY_KEYS` input mode.
+
+@code
+glfwSetInputMode(window, GLFW_STICKY_KEYS, GLFW_TRUE);
+@endcode
+
+When sticky keys mode is enabled, the pollable state of a key will remain
+`GLFW_PRESS` until the state of that key is polled with @ref glfwGetKey. Once
+it has been polled, if a key release event had been processed in the meantime,
+the state will reset to `GLFW_RELEASE`, otherwise it will remain `GLFW_PRESS`.
+
+@anchor GLFW_LOCK_KEY_MODS
+If you wish to know what the state of the Caps Lock and Num Lock keys was when
+input events were generated, set the `GLFW_LOCK_KEY_MODS` input mode.
+
+@code
+glfwSetInputMode(window, GLFW_LOCK_KEY_MODS, GLFW_TRUE);
+@endcode
+
+When this input mode is enabled, any callback that receives
+[modifier bits](@ref mods) will have the @ref GLFW_MOD_CAPS_LOCK bit set if Caps
+Lock was on when the event occurred and the @ref GLFW_MOD_NUM_LOCK bit set if
+Num Lock was on.
+
+The `GLFW_KEY_LAST` constant holds the highest value of any
+[named key](@ref keys).
+
+
+@subsection input_char Text input
+
+GLFW supports text input in the form of a stream of
+[Unicode code points](https://en.wikipedia.org/wiki/Unicode), as produced by the
+operating system text input system. Unlike key input, text input obeys keyboard
+layouts and modifier keys and supports composing characters using
+[dead keys](https://en.wikipedia.org/wiki/Dead_key). Once received, you can
+encode the code points into UTF-8 or any other encoding you prefer.
+
+Because an `unsigned int` is 32 bits long on all platforms supported by GLFW,
+you can treat the code point argument as native endian UTF-32.
+
+If you wish to offer regular text input, set a character callback.
+
+@code
+glfwSetCharCallback(window, character_callback);
+@endcode
+
+The callback function receives Unicode code points for key events that would
+have led to regular text input and generally behaves as a standard text field on
+that platform.
+
+@code
+void character_callback(GLFWwindow* window, unsigned int codepoint)
+{
+}
+@endcode
+
+
+@subsection input_key_name Key names
+
+If you wish to refer to keys by name, you can query the keyboard layout
+dependent name of printable keys with @ref glfwGetKeyName.
+
+@code
+const char* key_name = glfwGetKeyName(GLFW_KEY_W, 0);
+show_tutorial_hint("Press %s to move forward", key_name);
+@endcode
+
+This function can handle both [keys and scancodes](@ref input_key). If the
+specified key is `GLFW_KEY_UNKNOWN` then the scancode is used, otherwise it is
+ignored. This matches the behavior of the key callback, meaning the callback
+arguments can always be passed unmodified to this function.
+
+
+@section input_mouse Mouse input
+
+Mouse input comes in many forms, including mouse motion, button presses and
+scrolling offsets. The cursor appearance can also be changed, either to
+a custom image or a standard cursor shape from the system theme.
+
+
+@subsection cursor_pos Cursor position
+
+If you wish to be notified when the cursor moves over the window, set a cursor
+position callback.
+
+@code
+glfwSetCursorPosCallback(window, cursor_position_callback);
+@endcode
+
+The callback functions receives the cursor position, measured in screen
+coordinates but relative to the top-left corner of the window content area. On
+platforms that provide it, the full sub-pixel cursor position is passed on.
+
+@code
+static void cursor_position_callback(GLFWwindow* window, double xpos, double ypos)
+{
+}
+@endcode
+
+The cursor position is also saved per-window and can be polled with @ref
+glfwGetCursorPos.
+
+@code
+double xpos, ypos;
+glfwGetCursorPos(window, &xpos, &ypos);
+@endcode
+
+
+@subsection cursor_mode Cursor mode
+
+@anchor GLFW_CURSOR
+The `GLFW_CURSOR` input mode provides several cursor modes for special forms of
+mouse motion input. By default, the cursor mode is `GLFW_CURSOR_NORMAL`,
+meaning the regular arrow cursor (or another cursor set with @ref glfwSetCursor)
+is used and cursor motion is not limited.
+
+If you wish to implement mouse motion based camera controls or other input
+schemes that require unlimited mouse movement, set the cursor mode to
+`GLFW_CURSOR_DISABLED`.
+
+@code
+glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
+@endcode
+
+This will hide the cursor and lock it to the specified window. GLFW will then
+take care of all the details of cursor re-centering and offset calculation and
+providing the application with a virtual cursor position. This virtual position
+is provided normally via both the cursor position callback and through polling.
+
+@note You should not implement your own version of this functionality using
+other features of GLFW. It is not supported and will not work as robustly as
+`GLFW_CURSOR_DISABLED`.
+
+If you only wish the cursor to become hidden when it is over a window but still
+want it to behave normally, set the cursor mode to `GLFW_CURSOR_HIDDEN`.
+
+@code
+glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
+@endcode
+
+This mode puts no limit on the motion of the cursor.
+
+To exit out of either of these special modes, restore the `GLFW_CURSOR_NORMAL`
+cursor mode.
+
+@code
+glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
+@endcode
+
+
+@anchor GLFW_RAW_MOUSE_MOTION
+@subsection raw_mouse_motion Raw mouse motion
+
+When the cursor is disabled, raw (unscaled and unaccelerated) mouse motion can
+be enabled if available.
+
+Raw mouse motion is closer to the actual motion of the mouse across a surface.
+It is not affected by the scaling and acceleration applied to the motion of the
+desktop cursor. That processing is suitable for a cursor while raw motion is
+better for controlling for example a 3D camera. Because of this, raw mouse
+motion is only provided when the cursor is disabled.
+
+Call @ref glfwRawMouseMotionSupported to check if the current machine provides
+raw motion and set the `GLFW_RAW_MOUSE_MOTION` input mode to enable it. It is
+disabled by default.
+
+@code
+if (glfwRawMouseMotionSupported())
+ glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE);
+@endcode
+
+If supported, raw mouse motion can be enabled or disabled per-window and at any
+time but it will only be provided when the cursor is disabled.
+
+
+@subsection cursor_object Cursor objects
+
+GLFW supports creating both custom and system theme cursor images, encapsulated
+as @ref GLFWcursor objects. They are created with @ref glfwCreateCursor or @ref
+glfwCreateStandardCursor and destroyed with @ref glfwDestroyCursor, or @ref
+glfwTerminate, if any remain.
+
+
+@subsubsection cursor_custom Custom cursor creation
+
+A custom cursor is created with @ref glfwCreateCursor, which returns a handle to
+the created cursor object. For example, this creates a 16x16 white square
+cursor with the hot-spot in the upper-left corner:
+
+@code
+unsigned char pixels[16 * 16 * 4];
+memset(pixels, 0xff, sizeof(pixels));
+
+GLFWimage image;
+image.width = 16;
+image.height = 16;
+image.pixels = pixels;
+
+GLFWcursor* cursor = glfwCreateCursor(&image, 0, 0);
+@endcode
+
+If cursor creation fails, `NULL` will be returned, so it is necessary to check
+the return value.
+
+The image data is 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits
+per channel with the red channel first. The pixels are arranged canonically as
+sequential rows, starting from the top-left corner.
+
+
+@subsubsection cursor_standard Standard cursor creation
+
+A cursor with a [standard shape](@ref shapes) from the current system cursor
+theme can be can be created with @ref glfwCreateStandardCursor.
+
+@code
+GLFWcursor* cursor = glfwCreateStandardCursor(GLFW_HRESIZE_CURSOR);
+@endcode
+
+These cursor objects behave in the exact same way as those created with @ref
+glfwCreateCursor except that the system cursor theme provides the actual image.
+
+
+@subsubsection cursor_destruction Cursor destruction
+
+When a cursor is no longer needed, destroy it with @ref glfwDestroyCursor.
+
+@code
+glfwDestroyCursor(cursor);
+@endcode
+
+Cursor destruction always succeeds. If the cursor is current for any window,
+that window will revert to the default cursor. This does not affect the cursor
+mode. All remaining cursors are destroyed when @ref glfwTerminate is called.
+
+
+@subsubsection cursor_set Cursor setting
+
+A cursor can be set as current for a window with @ref glfwSetCursor.
+
+@code
+glfwSetCursor(window, cursor);
+@endcode
+
+Once set, the cursor image will be used as long as the system cursor is over the
+content area of the window and the [cursor mode](@ref cursor_mode) is set
+to `GLFW_CURSOR_NORMAL`.
+
+A single cursor may be set for any number of windows.
+
+To revert to the default cursor, set the cursor of that window to `NULL`.
+
+@code
+glfwSetCursor(window, NULL);
+@endcode
+
+When a cursor is destroyed, any window that has it set will revert to the
+default cursor. This does not affect the cursor mode.
+
+
+@subsection cursor_enter Cursor enter/leave events
+
+If you wish to be notified when the cursor enters or leaves the content area of
+a window, set a cursor enter/leave callback.
+
+@code
+glfwSetCursorEnterCallback(window, cursor_enter_callback);
+@endcode
+
+The callback function receives the new classification of the cursor.
+
+@code
+void cursor_enter_callback(GLFWwindow* window, int entered)
+{
+ if (entered)
+ {
+ // The cursor entered the content area of the window
+ }
+ else
+ {
+ // The cursor left the content area of the window
+ }
+}
+@endcode
+
+You can query whether the cursor is currently inside the content area of the
+window with the [GLFW_HOVERED](@ref GLFW_HOVERED_attrib) window attribute.
+
+@code
+if (glfwGetWindowAttrib(window, GLFW_HOVERED))
+{
+ highlight_interface();
+}
+@endcode
+
+
+@subsection input_mouse_button Mouse button input
+
+If you wish to be notified when a mouse button is pressed or released, set
+a mouse button callback.
+
+@code
+glfwSetMouseButtonCallback(window, mouse_button_callback);
+@endcode
+
+The callback function receives the [mouse button](@ref buttons), button action
+and [modifier bits](@ref mods).
+
+@code
+void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
+{
+ if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_PRESS)
+ popup_menu();
+}
+@endcode
+
+The action is one of `GLFW_PRESS` or `GLFW_RELEASE`.
+
+Mouse button states for [named buttons](@ref buttons) are also saved in
+per-window state arrays that can be polled with @ref glfwGetMouseButton.
+
+@code
+int state = glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT);
+if (state == GLFW_PRESS)
+{
+ upgrade_cow();
+}
+@endcode
+
+The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`.
+
+This function only returns cached mouse button event state. It does not poll
+the system for the current state of the mouse button.
+
+@anchor GLFW_STICKY_MOUSE_BUTTONS
+Whenever you poll state, you risk missing the state change you are looking for.
+If a pressed mouse button is released again before you poll its state, you will have
+missed the button press. The recommended solution for this is to use a
+mouse button callback, but there is also the `GLFW_STICKY_MOUSE_BUTTONS`
+input mode.
+
+@code
+glfwSetInputMode(window, GLFW_STICKY_MOUSE_BUTTONS, GLFW_TRUE);
+@endcode
+
+When sticky mouse buttons mode is enabled, the pollable state of a mouse button
+will remain `GLFW_PRESS` until the state of that button is polled with @ref
+glfwGetMouseButton. Once it has been polled, if a mouse button release event
+had been processed in the meantime, the state will reset to `GLFW_RELEASE`,
+otherwise it will remain `GLFW_PRESS`.
+
+The `GLFW_MOUSE_BUTTON_LAST` constant holds the highest value of any
+[named button](@ref buttons).
+
+
+@subsection scrolling Scroll input
+
+If you wish to be notified when the user scrolls, whether with a mouse wheel or
+touchpad gesture, set a scroll callback.
+
+@code
+glfwSetScrollCallback(window, scroll_callback);
+@endcode
+
+The callback function receives two-dimensional scroll offsets.
+
+@code
+void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
+{
+}
+@endcode
+
+A normal mouse wheel, being vertical, provides offsets along the Y-axis.
+
+
+@section joystick Joystick input
+
+The joystick functions expose connected joysticks and controllers, with both
+referred to as joysticks. It supports up to sixteen joysticks, ranging from
+`GLFW_JOYSTICK_1`, `GLFW_JOYSTICK_2` up to and including `GLFW_JOYSTICK_16` or
+`GLFW_JOYSTICK_LAST`. You can test whether a [joystick](@ref joysticks) is
+present with @ref glfwJoystickPresent.
+
+@code
+int present = glfwJoystickPresent(GLFW_JOYSTICK_1);
+@endcode
+
+Each joystick has zero or more axes, zero or more buttons, zero or more hats,
+a human-readable name, a user pointer and an SDL compatible GUID.
+
+When GLFW is initialized, detected joysticks are added to the beginning of
+the array. Once a joystick is detected, it keeps its assigned ID until it is
+disconnected or the library is terminated, so as joysticks are connected and
+disconnected, there may appear gaps in the IDs.
+
+Joystick axis, button and hat state is updated when polled and does not require
+a window to be created or events to be processed. However, if you want joystick
+connection and disconnection events reliably delivered to the
+[joystick callback](@ref joystick_event) then you must
+[process events](@ref events).
+
+To see all the properties of all connected joysticks in real-time, run the
+`joysticks` test program.
+
+
+@subsection joystick_axis Joystick axis states
+
+The positions of all axes of a joystick are returned by @ref
+glfwGetJoystickAxes. See the reference documentation for the lifetime of the
+returned array.
+
+@code
+int count;
+const float* axes = glfwGetJoystickAxes(GLFW_JOYSTICK_5, &count);
+@endcode
+
+Each element in the returned array is a value between -1.0 and 1.0.
+
+
+@subsection joystick_button Joystick button states
+
+The states of all buttons of a joystick are returned by @ref
+glfwGetJoystickButtons. See the reference documentation for the lifetime of the
+returned array.
+
+@code
+int count;
+const unsigned char* buttons = glfwGetJoystickButtons(GLFW_JOYSTICK_3, &count);
+@endcode
+
+Each element in the returned array is either `GLFW_PRESS` or `GLFW_RELEASE`.
+
+For backward compatibility with earlier versions that did not have @ref
+glfwGetJoystickHats, the button array by default also includes all hats. See
+the reference documentation for @ref glfwGetJoystickButtons for details.
+
+
+@subsection joystick_hat Joystick hat states
+
+The states of all hats are returned by @ref glfwGetJoystickHats. See the
+reference documentation for the lifetime of the returned array.
+
+@code
+int count;
+const unsigned char* hats = glfwGetJoystickHats(GLFW_JOYSTICK_7, &count);
+@endcode
+
+Each element in the returned array is one of the following:
+
+Name | Value
+---- | -----
+`GLFW_HAT_CENTERED` | 0
+`GLFW_HAT_UP` | 1
+`GLFW_HAT_RIGHT` | 2
+`GLFW_HAT_DOWN` | 4
+`GLFW_HAT_LEFT` | 8
+`GLFW_HAT_RIGHT_UP` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_UP`
+`GLFW_HAT_RIGHT_DOWN` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_DOWN`
+`GLFW_HAT_LEFT_UP` | `GLFW_HAT_LEFT` \| `GLFW_HAT_UP`
+`GLFW_HAT_LEFT_DOWN` | `GLFW_HAT_LEFT` \| `GLFW_HAT_DOWN`
+
+The diagonal directions are bitwise combinations of the primary (up, right, down
+and left) directions and you can test for these individually by ANDing it with
+the corresponding direction.
+
+@code
+if (hats[2] & GLFW_HAT_RIGHT)
+{
+ // State of hat 2 could be right-up, right or right-down
+}
+@endcode
+
+For backward compatibility with earlier versions that did not have @ref
+glfwGetJoystickHats, all hats are by default also included in the button array.
+See the reference documentation for @ref glfwGetJoystickButtons for details.
+
+
+@subsection joystick_name Joystick name
+
+The human-readable, UTF-8 encoded name of a joystick is returned by @ref
+glfwGetJoystickName. See the reference documentation for the lifetime of the
+returned string.
+
+@code
+const char* name = glfwGetJoystickName(GLFW_JOYSTICK_4);
+@endcode
+
+Joystick names are not guaranteed to be unique. Two joysticks of the same model
+and make may have the same name. Only the [joystick ID](@ref joysticks) is
+guaranteed to be unique, and only until that joystick is disconnected.
+
+
+@subsection joystick_userptr Joystick user pointer
+
+Each joystick has a user pointer that can be set with @ref
+glfwSetJoystickUserPointer and queried with @ref glfwGetJoystickUserPointer.
+This can be used for any purpose you need and will not be modified by GLFW. The
+value will be kept until the joystick is disconnected or until the library is
+terminated.
+
+The initial value of the pointer is `NULL`.
+
+
+@subsection joystick_event Joystick configuration changes
+
+If you wish to be notified when a joystick is connected or disconnected, set
+a joystick callback.
+
+@code
+glfwSetJoystickCallback(joystick_callback);
+@endcode
+
+The callback function receives the ID of the joystick that has been connected
+and disconnected and the event that occurred.
+
+@code
+void joystick_callback(int jid, int event)
+{
+ if (event == GLFW_CONNECTED)
+ {
+ // The joystick was connected
+ }
+ else if (event == GLFW_DISCONNECTED)
+ {
+ // The joystick was disconnected
+ }
+}
+@endcode
+
+For joystick connection and disconnection events to be delivered on all
+platforms, you need to call one of the [event processing](@ref events)
+functions. Joystick disconnection may also be detected and the callback
+called by joystick functions. The function will then return whatever it
+returns for a disconnected joystick.
+
+Only @ref glfwGetJoystickName and @ref glfwGetJoystickUserPointer will return
+useful values for a disconnected joystick and only before the monitor callback
+returns.
+
+
+@subsection gamepad Gamepad input
+
+The joystick functions provide unlabeled axes, buttons and hats, with no
+indication of where they are located on the device. Their order may also vary
+between platforms even with the same device.
+
+To solve this problem the SDL community crowdsourced the
+[SDL_GameControllerDB](https://github.com/gabomdq/SDL_GameControllerDB) project,
+a database of mappings from many different devices to an Xbox-like gamepad.
+
+GLFW supports this mapping format and contains a copy of the mappings
+available at the time of release. See @ref gamepad_mapping for how to update
+this at runtime. Mappings will be assigned to joysticks automatically any time
+a joystick is connected or the mappings are updated.
+
+You can check whether a joystick is both present and has a gamepad mapping with
+@ref glfwJoystickIsGamepad.
+
+@code
+if (glfwJoystickIsGamepad(GLFW_JOYSTICK_2))
+{
+ // Use as gamepad
+}
+@endcode
+
+If you are only interested in gamepad input you can use this function instead of
+@ref glfwJoystickPresent.
+
+You can query the human-readable name provided by the gamepad mapping with @ref
+glfwGetGamepadName. This may or may not be the same as the
+[joystick name](@ref joystick_name).
+
+@code
+const char* name = glfwGetGamepadName(GLFW_JOYSTICK_7);
+@endcode
+
+To retrieve the gamepad state of a joystick, call @ref glfwGetGamepadState.
+
+@code
+GLFWgamepadstate state;
+
+if (glfwGetGamepadState(GLFW_JOYSTICK_3, &state))
+{
+ if (state.buttons[GLFW_GAMEPAD_BUTTON_A])
+ {
+ input_jump();
+ }
+
+ input_speed(state.axes[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER]);
+}
+@endcode
+
+The @ref GLFWgamepadstate struct has two arrays; one for button states and one
+for axis states. The values for each button and axis are the same as for the
+@ref glfwGetJoystickButtons and @ref glfwGetJoystickAxes functions, i.e.
+`GLFW_PRESS` or `GLFW_RELEASE` for buttons and -1.0 to 1.0 inclusive for axes.
+
+The sizes of the arrays and the positions within each array are fixed.
+
+The [button indices](@ref gamepad_buttons) are `GLFW_GAMEPAD_BUTTON_A`,
+`GLFW_GAMEPAD_BUTTON_B`, `GLFW_GAMEPAD_BUTTON_X`, `GLFW_GAMEPAD_BUTTON_Y`,
+`GLFW_GAMEPAD_BUTTON_LEFT_BUMPER`, `GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER`,
+`GLFW_GAMEPAD_BUTTON_BACK`, `GLFW_GAMEPAD_BUTTON_START`,
+`GLFW_GAMEPAD_BUTTON_GUIDE`, `GLFW_GAMEPAD_BUTTON_LEFT_THUMB`,
+`GLFW_GAMEPAD_BUTTON_RIGHT_THUMB`, `GLFW_GAMEPAD_BUTTON_DPAD_UP`,
+`GLFW_GAMEPAD_BUTTON_DPAD_RIGHT`, `GLFW_GAMEPAD_BUTTON_DPAD_DOWN` and
+`GLFW_GAMEPAD_BUTTON_DPAD_LEFT`.
+
+For those who prefer, there are also the `GLFW_GAMEPAD_BUTTON_CROSS`,
+`GLFW_GAMEPAD_BUTTON_CIRCLE`, `GLFW_GAMEPAD_BUTTON_SQUARE` and
+`GLFW_GAMEPAD_BUTTON_TRIANGLE` aliases for the A, B, X and Y button indices.
+
+The [axis indices](@ref gamepad_axes) are `GLFW_GAMEPAD_AXIS_LEFT_X`,
+`GLFW_GAMEPAD_AXIS_LEFT_Y`, `GLFW_GAMEPAD_AXIS_RIGHT_X`,
+`GLFW_GAMEPAD_AXIS_RIGHT_Y`, `GLFW_GAMEPAD_AXIS_LEFT_TRIGGER` and
+`GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER`.
+
+The `GLFW_GAMEPAD_BUTTON_LAST` and `GLFW_GAMEPAD_AXIS_LAST` constants equal
+the largest available index for each array.
+
+
+@subsection gamepad_mapping Gamepad mappings
+
+GLFW contains a copy of the mappings available in
+[SDL_GameControllerDB](https://github.com/gabomdq/SDL_GameControllerDB) at the
+time of release. Newer ones can be added at runtime with @ref
+glfwUpdateGamepadMappings.
+
+@code
+const char* mappings = load_file_contents("game/data/gamecontrollerdb.txt");
+
+glfwUpdateGamepadMappings(mappings);
+@endcode
+
+This function supports everything from single lines up to and including the
+unmodified contents of the whole `gamecontrollerdb.txt` file.
+
+If you are compiling GLFW from source with CMake you can update the built-in mappings by
+building the _update_mappings_ target. This runs the `GenerateMappings.cmake` CMake
+script, which downloads `gamecontrollerdb.txt` and regenerates the `mappings.h` header
+file.
+
+Below is a description of the mapping format. Please keep in mind that __this
+description is not authoritative__. The format is defined by the SDL and
+SDL_GameControllerDB projects and their documentation and code takes precedence.
+
+Each mapping is a single line of comma-separated values describing the GUID,
+name and layout of the gamepad. Lines that do not begin with a hexadecimal
+digit are ignored.
+
+The first value is always the gamepad GUID, a 32 character long hexadecimal
+string that typically identifies its make, model, revision and the type of
+connection to the computer. When this information is not available, the GUID is
+generated using the gamepad name. GLFW uses the SDL 2.0.5+ GUID format but can
+convert from the older formats.
+
+The second value is always the human-readable name of the gamepad.
+
+All subsequent values are in the form `:` and describe the layout
+of the mapping. These fields may not all be present and may occur in any order.
+
+The button fields are `a`, `b`, `c`, `d`, `back`, `start`, `guide`, `dpup`,
+`dpright`, `dpdown`, `dpleft`, `leftshoulder`, `rightshoulder`, `leftstick` and
+`rightstick`.
+
+The axis fields are `leftx`, `lefty`, `rightx`, `righty`, `lefttrigger` and
+`righttrigger`.
+
+The value of an axis or button field can be a joystick button, a joystick axis,
+a hat bitmask or empty. Joystick buttons are specified as `bN`, for example
+`b2` for the third button. Joystick axes are specified as `aN`, for example
+`a7` for the eighth button. Joystick hat bit masks are specified as `hN.N`, for
+example `h0.8` for left on the first hat. More than one bit may be set in the
+mask.
+
+Before an axis there may be a `+` or `-` range modifier, for example `+a3` for
+the positive half of the fourth axis. This restricts input to only the positive
+or negative halves of the joystick axis. After an axis or half-axis there may
+be the `~` inversion modifier, for example `a2~` or `-a7~`. This negates the
+values of the gamepad axis.
+
+The hat bit mask match the [hat states](@ref hat_state) in the joystick
+functions.
+
+There is also the special `platform` field that specifies which platform the
+mapping is valid for. Possible values are `Windows`, `Mac OS X` and `Linux`.
+
+Below is an example of what a gamepad mapping might look like. It is the
+one built into GLFW for Xbox controllers accessed via the XInput API on Windows.
+This example has been broken into several lines to fit on the page, but real
+gamepad mappings must be a single line.
+
+@code{.unparsed}
+78696e70757401000000000000000000,XInput Gamepad (GLFW),platform:Windows,a:b0,
+b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,
+rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,
+righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,
+@endcode
+
+@note GLFW does not yet support the output range and modifiers `+` and `-` that
+were recently added to SDL. The input modifiers `+`, `-` and `~` are supported
+and described above.
+
+
+@section time Time input
+
+GLFW provides high-resolution time input, in seconds, with @ref glfwGetTime.
+
+@code
+double seconds = glfwGetTime();
+@endcode
+
+It returns the number of seconds since the library was initialized with @ref
+glfwInit. The platform-specific time sources used typically have micro- or
+nanosecond resolution.
+
+You can modify the base time with @ref glfwSetTime.
+
+@code
+glfwSetTime(4.0);
+@endcode
+
+This sets the time to the specified time, in seconds, and it continues to count
+from there.
+
+You can also access the raw timer used to implement the functions above,
+with @ref glfwGetTimerValue.
+
+@code
+uint64_t value = glfwGetTimerValue();
+@endcode
+
+This value is in 1 / frequency seconds. The frequency of the raw
+timer varies depending on the operating system and hardware. You can query the
+frequency, in Hz, with @ref glfwGetTimerFrequency.
+
+@code
+uint64_t frequency = glfwGetTimerFrequency();
+@endcode
+
+
+@section clipboard Clipboard input and output
+
+If the system clipboard contains a UTF-8 encoded string or if it can be
+converted to one, you can retrieve it with @ref glfwGetClipboardString. See the
+reference documentation for the lifetime of the returned string.
+
+@code
+const char* text = glfwGetClipboardString(NULL);
+if (text)
+{
+ insert_text(text);
+}
+@endcode
+
+If the clipboard is empty or if its contents could not be converted, `NULL` is
+returned.
+
+The contents of the system clipboard can be set to a UTF-8 encoded string with
+@ref glfwSetClipboardString.
+
+@code
+glfwSetClipboardString(NULL, "A string with words in it");
+@endcode
+
+
+@section path_drop Path drop input
+
+If you wish to receive the paths of files and/or directories dropped on
+a window, set a file drop callback.
+
+@code
+glfwSetDropCallback(window, drop_callback);
+@endcode
+
+The callback function receives an array of paths encoded as UTF-8.
+
+@code
+void drop_callback(GLFWwindow* window, int count, const char** paths)
+{
+ int i;
+ for (i = 0; i < count; i++)
+ handle_dropped_file(paths[i]);
+}
+@endcode
+
+The path array and its strings are only valid until the file drop callback
+returns, as they may have been generated specifically for that event. You need
+to make a deep copy of the array if you want to keep the paths.
+
+*/
diff --git a/extern/glfw/docs/internal.dox b/extern/glfw/docs/internal.dox
new file mode 100644
index 0000000000..685c6d131c
--- /dev/null
+++ b/extern/glfw/docs/internal.dox
@@ -0,0 +1,115 @@
+/*!
+
+@page internals_guide Internal structure
+
+@tableofcontents
+
+There are several interfaces inside GLFW. Each interface has its own area of
+responsibility and its own naming conventions.
+
+
+@section internals_public Public interface
+
+The most well-known is the public interface, described in the glfw3.h header
+file. This is implemented in source files shared by all platforms and these
+files contain no platform-specific code. This code usually ends up calling the
+platform and internal interfaces to do the actual work.
+
+The public interface uses the OpenGL naming conventions except with GLFW and
+glfw instead of GL and gl. For struct members, where OpenGL sets no precedent,
+it use headless camel case.
+
+Examples: `glfwCreateWindow`, `GLFWwindow`, `GLFW_RED_BITS`
+
+
+@section internals_native Native interface
+
+The [native interface](@ref native) is a small set of publicly available
+but platform-specific functions, described in the glfw3native.h header file and
+used to gain access to the underlying window, context and (on some platforms)
+display handles used by the platform interface.
+
+The function names of the native interface are similar to those of the public
+interface, but embeds the name of the interface that the returned handle is
+from.
+
+Examples: `glfwGetX11Window`, `glfwGetWGLContext`
+
+
+@section internals_internal Internal interface
+
+The internal interface consists of utility functions used by all other
+interfaces. It is shared code implemented in the same shared source files as
+the public and event interfaces. The internal interface is described in the
+internal.h header file.
+
+The internal interface is in charge of GLFW's global data, which it stores in
+a `_GLFWlibrary` struct named `_glfw`.
+
+The internal interface uses the same style as the public interface, except all
+global names have a leading underscore.
+
+Examples: `_glfwIsValidContextConfig`, `_GLFWwindow`, `_glfw.monitorCount`
+
+
+@section internals_platform Platform interface
+
+The platform interface implements all platform-specific operations as a service
+to the public interface. This includes event processing. The platform
+interface is never directly called by application code and never directly calls
+application-provided callbacks. It is also prohibited from modifying the
+platform-independent part of the internal structs. Instead, it calls the event
+interface when events interesting to GLFW are received.
+
+The platform interface mirrors those parts of the public interface that needs to
+perform platform-specific operations on some or all platforms. The are also
+named the same except that the glfw function prefix is replaced by
+_glfwPlatform.
+
+Examples: `_glfwPlatformCreateWindow`
+
+The platform interface also defines structs that contain platform-specific
+global and per-object state. Their names mirror those of the internal
+interface, except that an interface-specific suffix is added.
+
+Examples: `_GLFWwindowX11`, `_GLFWcontextWGL`
+
+These structs are incorporated as members into the internal interface structs
+using special macros that name them after the specific interface used. This
+prevents shared code from accidentally using these members.
+
+Examples: `window->win32.handle`, `_glfw.x11.display`
+
+
+@section internals_event Event interface
+
+The event interface is implemented in the same shared source files as the public
+interface and is responsible for delivering the events it receives to the
+application, either via callbacks, via window state changes or both.
+
+The function names of the event interface use a `_glfwInput` prefix and the
+ObjectEvent pattern.
+
+Examples: `_glfwInputWindowFocus`, `_glfwInputCursorPos`
+
+
+@section internals_static Static functions
+
+Static functions may be used by any interface and have no prefixes or suffixes.
+These use headless camel case.
+
+Examples: `isValidElementForJoystick`
+
+
+@section internals_config Configuration macros
+
+GLFW uses a number of configuration macros to select at compile time which
+interfaces and code paths to use. They are defined in the glfw_config.h header file,
+which is generated from the `glfw_config.h.in` file by CMake.
+
+Configuration macros the same style as tokens in the public interface, except
+with a leading underscore.
+
+Examples: `_GLFW_WIN32`, `_GLFW_BUILD_DLL`
+
+*/
diff --git a/extern/glfw/docs/intro.dox b/extern/glfw/docs/intro.dox
new file mode 100644
index 0000000000..e563b5050a
--- /dev/null
+++ b/extern/glfw/docs/intro.dox
@@ -0,0 +1,454 @@
+/*!
+
+@page intro_guide Introduction to the API
+
+@tableofcontents
+
+This guide introduces the basic concepts of GLFW and describes initialization,
+error handling and API guarantees and limitations. For a broad but shallow
+tutorial, see @ref quick_guide instead. For details on a specific function in
+this category, see the @ref init.
+
+There are also guides for the other areas of GLFW.
+
+ - @ref window_guide
+ - @ref context_guide
+ - @ref vulkan_guide
+ - @ref monitor_guide
+ - @ref input_guide
+
+
+@section intro_init Initialization and termination
+
+Before most GLFW functions may be called, the library must be initialized.
+This initialization checks what features are available on the machine,
+enumerates monitors and joysticks, initializes the timer and performs any
+required platform-specific initialization.
+
+Only the following functions may be called before the library has been
+successfully initialized, and only from the main thread.
+
+ - @ref glfwGetVersion
+ - @ref glfwGetVersionString
+ - @ref glfwGetError
+ - @ref glfwSetErrorCallback
+ - @ref glfwInitHint
+ - @ref glfwInit
+ - @ref glfwTerminate
+
+Calling any other function before successful initialization will cause a @ref
+GLFW_NOT_INITIALIZED error.
+
+
+@subsection intro_init_init Initializing GLFW
+
+The library is initialized with @ref glfwInit, which returns `GLFW_FALSE` if an
+error occurred.
+
+@code
+if (!glfwInit())
+{
+ // Handle initialization failure
+}
+@endcode
+
+If any part of initialization fails, any parts that succeeded are terminated as
+if @ref glfwTerminate had been called. The library only needs to be initialized
+once and additional calls to an already initialized library will return
+`GLFW_TRUE` immediately.
+
+Once the library has been successfully initialized, it should be terminated
+before the application exits. Modern systems are very good at freeing resources
+allocated by programs that exit, but GLFW sometimes has to change global system
+settings and these might not be restored without termination.
+
+
+@subsection init_hints Initialization hints
+
+Initialization hints are set before @ref glfwInit and affect how the library
+behaves until termination. Hints are set with @ref glfwInitHint.
+
+@code
+glfwInitHint(GLFW_JOYSTICK_HAT_BUTTONS, GLFW_FALSE);
+@endcode
+
+The values you set hints to are never reset by GLFW, but they only take effect
+during initialization. Once GLFW has been initialized, any values you set will
+be ignored until the library is terminated and initialized again.
+
+Some hints are platform specific. These may be set on any platform but they
+will only affect their specific platform. Other platforms will ignore them.
+Setting these hints requires no platform specific headers or functions.
+
+
+@subsubsection init_hints_shared Shared init hints
+
+@anchor GLFW_JOYSTICK_HAT_BUTTONS
+__GLFW_JOYSTICK_HAT_BUTTONS__ specifies whether to also expose joystick hats as
+buttons, for compatibility with earlier versions of GLFW that did not have @ref
+glfwGetJoystickHats. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+
+
+@subsubsection init_hints_osx macOS specific init hints
+
+@anchor GLFW_COCOA_CHDIR_RESOURCES_hint
+__GLFW_COCOA_CHDIR_RESOURCES__ specifies whether to set the current directory to
+the application to the `Contents/Resources` subdirectory of the application's
+bundle, if present. Set this with @ref glfwInitHint.
+
+@anchor GLFW_COCOA_MENUBAR_hint
+__GLFW_COCOA_MENUBAR__ specifies whether to create a basic menu bar, either from
+a nib or manually, when the first window is created, which is when AppKit is
+initialized. Set this with @ref glfwInitHint.
+
+
+@subsubsection init_hints_values Supported and default values
+
+Initialization hint | Default value | Supported values
+------------------------------- | ------------- | ----------------
+@ref GLFW_JOYSTICK_HAT_BUTTONS | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+@ref GLFW_COCOA_CHDIR_RESOURCES | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+@ref GLFW_COCOA_MENUBAR | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+
+
+@subsection intro_init_terminate Terminating GLFW
+
+Before your application exits, you should terminate the GLFW library if it has
+been initialized. This is done with @ref glfwTerminate.
+
+@code
+glfwTerminate();
+@endcode
+
+This will destroy any remaining window, monitor and cursor objects, restore any
+modified gamma ramps, re-enable the screensaver if it had been disabled and free
+any other resources allocated by GLFW.
+
+Once the library is terminated, it is as if it had never been initialized and
+you will need to initialize it again before being able to use GLFW. If the
+library was not initialized or had already been terminated, it return
+immediately.
+
+
+@section error_handling Error handling
+
+Some GLFW functions have return values that indicate an error, but this is often
+not very helpful when trying to figure out what happened or why it occurred.
+Other functions have no return value reserved for errors, so error notification
+needs a separate channel. Finally, far from all GLFW functions have return
+values.
+
+The last [error code](@ref errors) for the calling thread can be queried at any
+time with @ref glfwGetError.
+
+@code
+int code = glfwGetError(NULL);
+
+if (code != GLFW_NO_ERROR)
+ handle_error(code);
+@endcode
+
+If no error has occurred since the last call, @ref GLFW_NO_ERROR (zero) is
+returned. The error is cleared before the function returns.
+
+The error code indicates the general category of the error. Some error codes,
+such as @ref GLFW_NOT_INITIALIZED has only a single meaning, whereas others like
+@ref GLFW_PLATFORM_ERROR are used for many different errors.
+
+GLFW often has more information about an error than its general category. You
+can retrieve a UTF-8 encoded human-readable description along with the error
+code. If no error has occurred since the last call, the description is set to
+`NULL`.
+
+@code
+const char* description;
+int code = glfwGetError(&description);
+
+if (description)
+ display_error_message(code, description);
+@endcode
+
+The retrieved description string is only valid until the next error occurs.
+This means you must make a copy of it if you want to keep it.
+
+You can also set an error callback, which will be called each time an error
+occurs. It is set with @ref glfwSetErrorCallback.
+
+@code
+glfwSetErrorCallback(error_callback);
+@endcode
+
+The error callback receives the same error code and human-readable description
+returned by @ref glfwGetError.
+
+@code
+void error_callback(int code, const char* description)
+{
+ display_error_message(code, description);
+}
+@endcode
+
+The error callback is called after the error is stored, so calling @ref
+glfwGetError from within the error callback returns the same values as the
+callback argument.
+
+The description string passed to the callback is only valid until the error
+callback returns. This means you must make a copy of it if you want to keep it.
+
+__Reported errors are never fatal.__ As long as GLFW was successfully
+initialized, it will remain initialized and in a safe state until terminated
+regardless of how many errors occur. If an error occurs during initialization
+that causes @ref glfwInit to fail, any part of the library that was initialized
+will be safely terminated.
+
+Do not rely on a currently invalid call to generate a specific error, as in the
+future that same call may generate a different error or become valid.
+
+
+@section coordinate_systems Coordinate systems
+
+GLFW has two primary coordinate systems: the _virtual screen_ and the window
+_content area_ or _content area_. Both use the same unit: _virtual screen
+coordinates_, or just _screen coordinates_, which don't necessarily correspond
+to pixels.
+
+
+
+Both the virtual screen and the content area coordinate systems have the X-axis
+pointing to the right and the Y-axis pointing down.
+
+Window and monitor positions are specified as the position of the upper-left
+corners of their content areas relative to the virtual screen, while cursor
+positions are specified relative to a window's content area.
+
+Because the origin of the window's content area coordinate system is also the
+point from which the window position is specified, you can translate content
+area coordinates to the virtual screen by adding the window position. The
+window frame, when present, extends out from the content area but does not
+affect the window position.
+
+Almost all positions and sizes in GLFW are measured in screen coordinates
+relative to one of the two origins above. This includes cursor positions,
+window positions and sizes, window frame sizes, monitor positions and video mode
+resolutions.
+
+Two exceptions are the [monitor physical size](@ref monitor_size), which is
+measured in millimetres, and [framebuffer size](@ref window_fbsize), which is
+measured in pixels.
+
+Pixels and screen coordinates may map 1:1 on your machine, but they won't on
+every other machine, for example on a Mac with a Retina display. The ratio
+between screen coordinates and pixels may also change at run-time depending on
+which monitor the window is currently considered to be on.
+
+
+@section guarantees_limitations Guarantees and limitations
+
+This section describes the conditions under which GLFW can be expected to
+function, barring bugs in the operating system or drivers. Use of GLFW outside
+of these limits may work on some platforms, or on some machines, or some of the
+time, or on some versions of GLFW, but it may break at any time and this will
+not be considered a bug.
+
+
+@subsection lifetime Pointer lifetimes
+
+GLFW will never free any pointer you provide to it and you must never free any
+pointer it provides to you.
+
+Many GLFW functions return pointers to dynamically allocated structures, strings
+or arrays, and some callbacks are provided with strings or arrays. These are
+always managed by GLFW and should never be freed by the application. The
+lifetime of these pointers is documented for each GLFW function and callback.
+If you need to keep this data, you must copy it before its lifetime expires.
+
+Many GLFW functions accept pointers to structures or strings allocated by the
+application. These are never freed by GLFW and are always the responsibility of
+the application. If GLFW needs to keep the data in these structures or strings,
+it is copied before the function returns.
+
+Pointer lifetimes are guaranteed not to be shortened in future minor or patch
+releases.
+
+
+@subsection reentrancy Reentrancy
+
+GLFW event processing and object destruction are not reentrant. This means that
+the following functions must not be called from any callback function:
+
+ - @ref glfwDestroyWindow
+ - @ref glfwDestroyCursor
+ - @ref glfwPollEvents
+ - @ref glfwWaitEvents
+ - @ref glfwWaitEventsTimeout
+ - @ref glfwTerminate
+
+These functions may be made reentrant in future minor or patch releases, but
+functions not on this list will not be made non-reentrant.
+
+
+@subsection thread_safety Thread safety
+
+Most GLFW functions must only be called from the main thread (the thread that
+calls main), but some may be called from any thread once the library has been
+initialized. Before initialization the whole library is thread-unsafe.
+
+The reference documentation for every GLFW function states whether it is limited
+to the main thread.
+
+Initialization, termination, event processing and the creation and
+destruction of windows, cursors and OpenGL and OpenGL ES contexts are all
+restricted to the main thread due to limitations of one or several platforms.
+
+Because event processing must be performed on the main thread, all callbacks
+except for the error callback will only be called on that thread. The error
+callback may be called on any thread, as any GLFW function may generate errors.
+
+The error code and description may be queried from any thread.
+
+ - @ref glfwGetError
+
+Empty events may be posted from any thread.
+
+ - @ref glfwPostEmptyEvent
+
+The window user pointer and close flag may be read and written from any thread,
+but this is not synchronized by GLFW.
+
+ - @ref glfwGetWindowUserPointer
+ - @ref glfwSetWindowUserPointer
+ - @ref glfwWindowShouldClose
+ - @ref glfwSetWindowShouldClose
+
+These functions for working with OpenGL and OpenGL ES contexts may be called
+from any thread, but the window object is not synchronized by GLFW.
+
+ - @ref glfwMakeContextCurrent
+ - @ref glfwGetCurrentContext
+ - @ref glfwSwapBuffers
+ - @ref glfwSwapInterval
+ - @ref glfwExtensionSupported
+ - @ref glfwGetProcAddress
+
+The raw timer functions may be called from any thread.
+
+ - @ref glfwGetTimerFrequency
+ - @ref glfwGetTimerValue
+
+The regular timer may be used from any thread, but reading and writing the timer
+offset is not synchronized by GLFW.
+
+ - @ref glfwGetTime
+ - @ref glfwSetTime
+
+Library version information may be queried from any thread.
+
+ - @ref glfwGetVersion
+ - @ref glfwGetVersionString
+
+All Vulkan related functions may be called from any thread.
+
+ - @ref glfwVulkanSupported
+ - @ref glfwGetRequiredInstanceExtensions
+ - @ref glfwGetInstanceProcAddress
+ - @ref glfwGetPhysicalDevicePresentationSupport
+ - @ref glfwCreateWindowSurface
+
+GLFW uses synchronization objects internally only to manage the per-thread
+context and error states. Additional synchronization is left to the
+application.
+
+Functions that may currently be called from any thread will always remain so,
+but functions that are currently limited to the main thread may be updated to
+allow calls from any thread in future releases.
+
+
+@subsection compatibility Version compatibility
+
+GLFW uses [Semantic Versioning](https://semver.org/). This guarantees source
+and binary backward compatibility with earlier minor versions of the API. This
+means that you can drop in a newer version of the library and existing programs
+will continue to compile and existing binaries will continue to run.
+
+Once a function or constant has been added, the signature of that function or
+value of that constant will remain unchanged until the next major version of
+GLFW. No compatibility of any kind is guaranteed between major versions.
+
+Undocumented behavior, i.e. behavior that is not described in the documentation,
+may change at any time until it is documented.
+
+If the reference documentation and the implementation differ, the reference
+documentation will almost always take precedence and the implementation will be
+fixed in the next release. The reference documentation will also take
+precedence over anything stated in a guide.
+
+
+@subsection event_order Event order
+
+The order of arrival of related events is not guaranteed to be consistent
+across platforms. The exception is synthetic key and mouse button release
+events, which are always delivered after the window defocus event.
+
+
+@section intro_version Version management
+
+GLFW provides mechanisms for identifying what version of GLFW your application
+was compiled against as well as what version it is currently running against.
+If you are loading GLFW dynamically (not just linking dynamically), you can use
+this to verify that the library binary is compatible with your application.
+
+
+@subsection intro_version_compile Compile-time version
+
+The compile-time version of GLFW is provided by the GLFW header with the
+`GLFW_VERSION_MAJOR`, `GLFW_VERSION_MINOR` and `GLFW_VERSION_REVISION` macros.
+
+@code
+printf("Compiled against GLFW %i.%i.%i\n",
+ GLFW_VERSION_MAJOR,
+ GLFW_VERSION_MINOR,
+ GLFW_VERSION_REVISION);
+@endcode
+
+
+@subsection intro_version_runtime Run-time version
+
+The run-time version can be retrieved with @ref glfwGetVersion, a function that
+may be called regardless of whether GLFW is initialized.
+
+@code
+int major, minor, revision;
+glfwGetVersion(&major, &minor, &revision);
+
+printf("Running against GLFW %i.%i.%i\n", major, minor, revision);
+@endcode
+
+
+@subsection intro_version_string Version string
+
+GLFW 3 also provides a compile-time generated version string that describes the
+version, platform, compiler and any platform-specific compile-time options.
+This is primarily intended for submitting bug reports, to allow developers to
+see which code paths are enabled in a binary.
+
+The version string is returned by @ref glfwGetVersionString, a function that may
+be called regardless of whether GLFW is initialized.
+
+__Do not use the version string__ to parse the GLFW library version. The @ref
+glfwGetVersion function already provides the version of the running library
+binary.
+
+The format of the string is as follows:
+ - The version of GLFW
+ - The name of the window system API
+ - The name of the context creation API
+ - Any additional options or APIs
+
+For example, when compiling GLFW 3.0 with MinGW using the Win32 and WGL
+back ends, the version string may look something like this:
+
+@code
+3.0.0 Win32 WGL MinGW
+@endcode
+
+*/
diff --git a/extern/glfw/docs/main.dox b/extern/glfw/docs/main.dox
new file mode 100644
index 0000000000..bd563d9884
--- /dev/null
+++ b/extern/glfw/docs/main.dox
@@ -0,0 +1,46 @@
+/*!
+
+@mainpage notitle
+
+@section main_intro Introduction
+
+GLFW is a free, Open Source, multi-platform library for OpenGL, OpenGL ES and
+Vulkan application development. It provides a simple, platform-independent API
+for creating windows, contexts and surfaces, reading input, handling events, etc.
+
+@ref news_33 list new features, caveats and deprecations.
+
+@ref quick_guide is a guide for users new to GLFW. It takes you through how to
+write a small but complete program.
+
+There are guides for each section of the API:
+
+ - @ref intro_guide – initialization, error handling and high-level design
+ - @ref window_guide – creating and working with windows and framebuffers
+ - @ref context_guide – working with OpenGL and OpenGL ES contexts
+ - @ref vulkan_guide - working with Vulkan objects and extensions
+ - @ref monitor_guide – enumerating and working with monitors and video modes
+ - @ref input_guide – receiving events, polling and processing input
+
+Once you have written a program, see @ref compile_guide and @ref build_guide.
+
+The [reference documentation](modules.html) provides more detailed information
+about specific functions.
+
+@ref moving_guide explains what has changed and how to update existing code to
+use the new API.
+
+There is a section on @ref guarantees_limitations for pointer lifetimes,
+reentrancy, thread safety, event order and backward and forward compatibility.
+
+The [FAQ](https://www.glfw.org/faq.html) answers many common questions about the
+design, implementation and use of GLFW.
+
+Finally, @ref compat_guide explains what APIs, standards and protocols GLFW uses
+and what happens when they are not present on a given machine.
+
+This documentation was generated with Doxygen. The sources for it are available
+in both the [source distribution](https://www.glfw.org/download.html) and
+[GitHub repository](https://github.com/glfw/glfw).
+
+*/
diff --git a/extern/glfw/docs/monitor.dox b/extern/glfw/docs/monitor.dox
new file mode 100644
index 0000000000..86eb4540b0
--- /dev/null
+++ b/extern/glfw/docs/monitor.dox
@@ -0,0 +1,268 @@
+/*!
+
+@page monitor_guide Monitor guide
+
+@tableofcontents
+
+This guide introduces the monitor related functions of GLFW. For details on
+a specific function in this category, see the @ref monitor. There are also
+guides for the other areas of GLFW.
+
+ - @ref intro_guide
+ - @ref window_guide
+ - @ref context_guide
+ - @ref vulkan_guide
+ - @ref input_guide
+
+
+@section monitor_object Monitor objects
+
+A monitor object represents a currently connected monitor and is represented as
+a pointer to the [opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type
+@ref GLFWmonitor. Monitor objects cannot be created or destroyed by the
+application and retain their addresses until the monitors they represent are
+disconnected or until the library is [terminated](@ref intro_init_terminate).
+
+Each monitor has a current video mode, a list of supported video modes,
+a virtual position, a human-readable name, an estimated physical size and
+a gamma ramp. One of the monitors is the primary monitor.
+
+The virtual position of a monitor is in
+[screen coordinates](@ref coordinate_systems) and, together with the current
+video mode, describes the viewports that the connected monitors provide into the
+virtual desktop that spans them.
+
+To see how GLFW views your monitor setup and its available video modes, run the
+`monitors` test program.
+
+
+@subsection monitor_monitors Retrieving monitors
+
+The primary monitor is returned by @ref glfwGetPrimaryMonitor. It is the user's
+preferred monitor and is usually the one with global UI elements like task bar
+or menu bar.
+
+@code
+GLFWmonitor* primary = glfwGetPrimaryMonitor();
+@endcode
+
+You can retrieve all currently connected monitors with @ref glfwGetMonitors.
+See the reference documentation for the lifetime of the returned array.
+
+@code
+int count;
+GLFWmonitor** monitors = glfwGetMonitors(&count);
+@endcode
+
+The primary monitor is always the first monitor in the returned array, but other
+monitors may be moved to a different index when a monitor is connected or
+disconnected.
+
+
+@subsection monitor_event Monitor configuration changes
+
+If you wish to be notified when a monitor is connected or disconnected, set
+a monitor callback.
+
+@code
+glfwSetMonitorCallback(monitor_callback);
+@endcode
+
+The callback function receives the handle for the monitor that has been
+connected or disconnected and the event that occurred.
+
+@code
+void monitor_callback(GLFWmonitor* monitor, int event)
+{
+ if (event == GLFW_CONNECTED)
+ {
+ // The monitor was connected
+ }
+ else if (event == GLFW_DISCONNECTED)
+ {
+ // The monitor was disconnected
+ }
+}
+@endcode
+
+If a monitor is disconnected, all windows that are full screen on it will be
+switched to windowed mode before the callback is called. Only @ref
+glfwGetMonitorName and @ref glfwGetMonitorUserPointer will return useful values
+for a disconnected monitor and only before the monitor callback returns.
+
+
+@section monitor_properties Monitor properties
+
+Each monitor has a current video mode, a list of supported video modes,
+a virtual position, a content scale, a human-readable name, a user pointer, an
+estimated physical size and a gamma ramp.
+
+
+@subsection monitor_modes Video modes
+
+GLFW generally does a good job selecting a suitable video mode when you create
+a full screen window, change its video mode or make a windowed one full
+screen, but it is sometimes useful to know exactly which video modes are
+supported.
+
+Video modes are represented as @ref GLFWvidmode structures. You can get an
+array of the video modes supported by a monitor with @ref glfwGetVideoModes.
+See the reference documentation for the lifetime of the returned array.
+
+@code
+int count;
+GLFWvidmode* modes = glfwGetVideoModes(monitor, &count);
+@endcode
+
+To get the current video mode of a monitor call @ref glfwGetVideoMode. See the
+reference documentation for the lifetime of the returned pointer.
+
+@code
+const GLFWvidmode* mode = glfwGetVideoMode(monitor);
+@endcode
+
+The resolution of a video mode is specified in
+[screen coordinates](@ref coordinate_systems), not pixels.
+
+
+@subsection monitor_size Physical size
+
+The physical size of a monitor in millimetres, or an estimation of it, can be
+retrieved with @ref glfwGetMonitorPhysicalSize. This has no relation to its
+current _resolution_, i.e. the width and height of its current
+[video mode](@ref monitor_modes).
+
+@code
+int width_mm, height_mm;
+glfwGetMonitorPhysicalSize(monitor, &width_mm, &height_mm);
+@endcode
+
+While this can be used to calculate the raw DPI of a monitor, this is often not
+useful. Instead use the [monitor content scale](@ref monitor_scale) and
+[window content scale](@ref window_scale) to scale your content.
+
+
+@subsection monitor_scale Content scale
+
+The content scale for a monitor can be retrieved with @ref
+glfwGetMonitorContentScale.
+
+@code
+float xscale, yscale;
+glfwGetMonitorContentScale(monitor, &xscale, &yscale);
+@endcode
+
+The content scale is the ratio between the current DPI and the platform's
+default DPI. This is especially important for text and any UI elements. If the
+pixel dimensions of your UI scaled by this look appropriate on your machine then
+it should appear at a reasonable size on other machines regardless of their DPI
+and scaling settings. This relies on the system DPI and scaling settings being
+somewhat correct.
+
+The content scale may depend on both the monitor resolution and pixel density
+and on user settings. It may be very different from the raw DPI calculated from
+the physical size and current resolution.
+
+
+@subsection monitor_pos Virtual position
+
+The position of the monitor on the virtual desktop, in
+[screen coordinates](@ref coordinate_systems), can be retrieved with @ref
+glfwGetMonitorPos.
+
+@code
+int xpos, ypos;
+glfwGetMonitorPos(monitor, &xpos, &ypos);
+@endcode
+
+
+@subsection monitor_workarea Work area
+
+The area of a monitor not occupied by global task bars or menu bars is the work
+area. This is specified in [screen coordinates](@ref coordinate_systems) and
+can be retrieved with @ref glfwGetMonitorWorkarea.
+
+@code
+int xpos, ypos, width, height;
+glfwGetMonitorWorkarea(monitor, &xpos, &ypos, &width, &height);
+@endcode
+
+
+@subsection monitor_name Human-readable name
+
+The human-readable, UTF-8 encoded name of a monitor is returned by @ref
+glfwGetMonitorName. See the reference documentation for the lifetime of the
+returned string.
+
+@code
+const char* name = glfwGetMonitorName(monitor);
+@endcode
+
+Monitor names are not guaranteed to be unique. Two monitors of the same model
+and make may have the same name. Only the monitor handle is guaranteed to be
+unique, and only until that monitor is disconnected.
+
+
+@subsection monitor_userptr User pointer
+
+Each monitor has a user pointer that can be set with @ref
+glfwSetMonitorUserPointer and queried with @ref glfwGetMonitorUserPointer. This
+can be used for any purpose you need and will not be modified by GLFW. The
+value will be kept until the monitor is disconnected or until the library is
+terminated.
+
+The initial value of the pointer is `NULL`.
+
+
+@subsection monitor_gamma Gamma ramp
+
+The gamma ramp of a monitor can be set with @ref glfwSetGammaRamp, which accepts
+a monitor handle and a pointer to a @ref GLFWgammaramp structure.
+
+@code
+GLFWgammaramp ramp;
+unsigned short red[256], green[256], blue[256];
+
+ramp.size = 256;
+ramp.red = red;
+ramp.green = green;
+ramp.blue = blue;
+
+for (i = 0; i < ramp.size; i++)
+{
+ // Fill out gamma ramp arrays as desired
+}
+
+glfwSetGammaRamp(monitor, &ramp);
+@endcode
+
+The gamma ramp data is copied before the function returns, so there is no need
+to keep it around once the ramp has been set.
+
+It is recommended that your gamma ramp have the same size as the current gamma
+ramp for that monitor.
+
+The current gamma ramp for a monitor is returned by @ref glfwGetGammaRamp. See
+the reference documentation for the lifetime of the returned structure.
+
+@code
+const GLFWgammaramp* ramp = glfwGetGammaRamp(monitor);
+@endcode
+
+If you wish to set a regular gamma ramp, you can have GLFW calculate it for you
+from the desired exponent with @ref glfwSetGamma, which in turn calls @ref
+glfwSetGammaRamp with the resulting ramp.
+
+@code
+glfwSetGamma(monitor, 1.0);
+@endcode
+
+To experiment with gamma correction via the @ref glfwSetGamma function, run the
+`gamma` test program.
+
+@note The software controlled gamma ramp is applied _in addition_ to the
+hardware gamma correction, which today is usually an approximation of sRGB
+gamma. This means that setting a perfectly linear ramp, or gamma 1.0, will
+produce the default (usually sRGB-like) behavior.
+
+*/
diff --git a/extern/glfw/docs/moving.dox b/extern/glfw/docs/moving.dox
new file mode 100644
index 0000000000..b80d84a2b1
--- /dev/null
+++ b/extern/glfw/docs/moving.dox
@@ -0,0 +1,513 @@
+/*!
+
+@page moving_guide Moving from GLFW 2 to 3
+
+@tableofcontents
+
+This is a transition guide for moving from GLFW 2 to 3. It describes what has
+changed or been removed, but does _not_ include
+[new features](@ref news) unless they are required when moving an existing code
+base onto the new API. For example, the new multi-monitor functions are
+required to create full screen windows with GLFW 3.
+
+
+@section moving_removed Changed and removed features
+
+@subsection moving_renamed_files Renamed library and header file
+
+The GLFW 3 header is named @ref glfw3.h and moved to the `GLFW` directory, to
+avoid collisions with the headers of other major versions. Similarly, the GLFW
+3 library is named `glfw3,` except when it's installed as a shared library on
+Unix-like systems, where it uses the
+[soname](https://en.wikipedia.org/wiki/soname) `libglfw.so.3`.
+
+@par Old syntax
+@code
+#include
+@endcode
+
+@par New syntax
+@code
+#include
+@endcode
+
+
+@subsection moving_threads Removal of threading functions
+
+The threading functions have been removed, including the per-thread sleep
+function. They were fairly primitive, under-used, poorly integrated and took
+time away from the focus of GLFW (i.e. context, input and window). There are
+better threading libraries available and native threading support is available
+in both [C++11](https://en.cppreference.com/w/cpp/thread) and
+[C11](https://en.cppreference.com/w/c/thread), both of which are gaining
+traction.
+
+If you wish to use the C++11 or C11 facilities but your compiler doesn't yet
+support them, see the
+[TinyThread++](https://gitorious.org/tinythread/tinythreadpp) and
+[TinyCThread](https://github.com/tinycthread/tinycthread) projects created by
+the original author of GLFW. These libraries implement a usable subset of the
+threading APIs in C++11 and C11, and in fact some GLFW 3 test programs use
+TinyCThread.
+
+However, GLFW 3 has better support for _use from multiple threads_ than GLFW
+2 had. Contexts can be made current on any thread, although only a single
+thread at a time, and the documentation explicitly states which functions may be
+used from any thread and which must only be used from the main thread.
+
+@par Removed functions
+`glfwSleep`, `glfwCreateThread`, `glfwDestroyThread`, `glfwWaitThread`,
+`glfwGetThreadID`, `glfwCreateMutex`, `glfwDestroyMutex`, `glfwLockMutex`,
+`glfwUnlockMutex`, `glfwCreateCond`, `glfwDestroyCond`, `glfwWaitCond`,
+`glfwSignalCond`, `glfwBroadcastCond` and `glfwGetNumberOfProcessors`.
+
+@par Removed types
+`GLFWthreadfun`
+
+
+@subsection moving_image Removal of image and texture loading
+
+The image and texture loading functions have been removed. They only supported
+the Targa image format, making them mostly useful for beginner level examples.
+To become of sufficiently high quality to warrant keeping them in GLFW 3, they
+would need not only to support other formats, but also modern extensions to
+OpenGL texturing. This would either add a number of external
+dependencies (libjpeg, libpng, etc.), or force GLFW to ship with inline versions
+of these libraries.
+
+As there already are libraries doing this, it is unnecessary both to duplicate
+the work and to tie the duplicate to GLFW. The resulting library would also be
+platform-independent, as both OpenGL and stdio are available wherever GLFW is.
+
+@par Removed functions
+`glfwReadImage`, `glfwReadMemoryImage`, `glfwFreeImage`, `glfwLoadTexture2D`,
+`glfwLoadMemoryTexture2D` and `glfwLoadTextureImage2D`.
+
+
+@subsection moving_stdcall Removal of GLFWCALL macro
+
+The `GLFWCALL` macro, which made callback functions use
+[__stdcall](https://msdn.microsoft.com/en-us/library/zxk0tw93.aspx) on Windows,
+has been removed. GLFW is written in C, not Pascal. Removing this macro means
+there's one less thing for application programmers to remember, i.e. the
+requirement to mark all callback functions with `GLFWCALL`. It also simplifies
+the creation of DLLs and DLL link libraries, as there's no need to explicitly
+disable `@n` entry point suffixes.
+
+@par Old syntax
+@code
+void GLFWCALL callback_function(...);
+@endcode
+
+@par New syntax
+@code
+void callback_function(...);
+@endcode
+
+
+@subsection moving_window_handles Window handle parameters
+
+Because GLFW 3 supports multiple windows, window handle parameters have been
+added to all window-related GLFW functions and callbacks. The handle of
+a newly created window is returned by @ref glfwCreateWindow (formerly
+`glfwOpenWindow`). Window handles are pointers to the
+[opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type @ref GLFWwindow.
+
+@par Old syntax
+@code
+glfwSetWindowTitle("New Window Title");
+@endcode
+
+@par New syntax
+@code
+glfwSetWindowTitle(window, "New Window Title");
+@endcode
+
+
+@subsection moving_monitor Explicit monitor selection
+
+GLFW 3 provides support for multiple monitors. To request a full screen mode window,
+instead of passing `GLFW_FULLSCREEN` you specify which monitor you wish the
+window to use. The @ref glfwGetPrimaryMonitor function returns the monitor that
+GLFW 2 would have selected, but there are many other
+[monitor functions](@ref monitor_guide). Monitor handles are pointers to the
+[opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type @ref GLFWmonitor.
+
+@par Old basic full screen
+@code
+glfwOpenWindow(640, 480, 8, 8, 8, 0, 24, 0, GLFW_FULLSCREEN);
+@endcode
+
+@par New basic full screen
+@code
+window = glfwCreateWindow(640, 480, "My Window", glfwGetPrimaryMonitor(), NULL);
+@endcode
+
+@note The framebuffer bit depth parameters of `glfwOpenWindow` have been turned
+into [window hints](@ref window_hints), but as they have been given
+[sane defaults](@ref window_hints_values) you rarely need to set these hints.
+
+
+@subsection moving_autopoll Removal of automatic event polling
+
+GLFW 3 does not automatically poll for events in @ref glfwSwapBuffers, meaning
+you need to call @ref glfwPollEvents or @ref glfwWaitEvents yourself. Unlike
+buffer swap, which acts on a single window, the event processing functions act
+on all windows at once.
+
+@par Old basic main loop
+@code
+while (...)
+{
+ // Process input
+ // Render output
+ glfwSwapBuffers();
+}
+@endcode
+
+@par New basic main loop
+@code
+while (...)
+{
+ // Process input
+ // Render output
+ glfwSwapBuffers(window);
+ glfwPollEvents();
+}
+@endcode
+
+
+@subsection moving_context Explicit context management
+
+Each GLFW 3 window has its own OpenGL context and only you, the application
+programmer, can know which context should be current on which thread at any
+given time. Therefore, GLFW 3 leaves that decision to you.
+
+This means that you need to call @ref glfwMakeContextCurrent after creating
+a window before you can call any OpenGL functions.
+
+
+@subsection moving_hidpi Separation of window and framebuffer sizes
+
+Window positions and sizes now use screen coordinates, which may not be the same
+as pixels on machines with high-DPI monitors. This is important as OpenGL uses
+pixels, not screen coordinates. For example, the rectangle specified with
+`glViewport` needs to use pixels. Therefore, framebuffer size functions have
+been added. You can retrieve the size of the framebuffer of a window with @ref
+glfwGetFramebufferSize function. A framebuffer size callback has also been
+added, which can be set with @ref glfwSetFramebufferSizeCallback.
+
+@par Old basic viewport setup
+@code
+glfwGetWindowSize(&width, &height);
+glViewport(0, 0, width, height);
+@endcode
+
+@par New basic viewport setup
+@code
+glfwGetFramebufferSize(window, &width, &height);
+glViewport(0, 0, width, height);
+@endcode
+
+
+@subsection moving_window_close Window closing changes
+
+The `GLFW_OPENED` window parameter has been removed. As long as the window has
+not been destroyed, whether through @ref glfwDestroyWindow or @ref
+glfwTerminate, the window is "open".
+
+A user attempting to close a window is now just an event like any other. Unlike
+GLFW 2, windows and contexts created with GLFW 3 will never be destroyed unless
+you choose them to be. Each window now has a close flag that is set to
+`GLFW_TRUE` when the user attempts to close that window. By default, nothing else
+happens and the window stays visible. It is then up to you to either destroy
+the window, take some other action or ignore the request.
+
+You can query the close flag at any time with @ref glfwWindowShouldClose and set
+it at any time with @ref glfwSetWindowShouldClose.
+
+@par Old basic main loop
+@code
+while (glfwGetWindowParam(GLFW_OPENED))
+{
+ ...
+}
+@endcode
+
+@par New basic main loop
+@code
+while (!glfwWindowShouldClose(window))
+{
+ ...
+}
+@endcode
+
+The close callback no longer returns a value. Instead, it is called after the
+close flag has been set so it can override its value, if it chooses to, before
+event processing completes. You may however not call @ref glfwDestroyWindow
+from the close callback (or any other window related callback).
+
+@par Old syntax
+@code
+int GLFWCALL window_close_callback(void);
+@endcode
+
+@par New syntax
+@code
+void window_close_callback(GLFWwindow* window);
+@endcode
+
+@note GLFW never clears the close flag to `GLFW_FALSE`, meaning you can use it
+for other reasons to close the window as well, for example the user choosing
+Quit from an in-game menu.
+
+
+@subsection moving_hints Persistent window hints
+
+The `glfwOpenWindowHint` function has been renamed to @ref glfwWindowHint.
+
+Window hints are no longer reset to their default values on window creation, but
+instead retain their values until modified by @ref glfwWindowHint or @ref
+glfwDefaultWindowHints, or until the library is terminated and re-initialized.
+
+
+@subsection moving_video_modes Video mode enumeration
+
+Video mode enumeration is now per-monitor. The @ref glfwGetVideoModes function
+now returns all available modes for a specific monitor instead of requiring you
+to guess how large an array you need. The `glfwGetDesktopMode` function, which
+had poorly defined behavior, has been replaced by @ref glfwGetVideoMode, which
+returns the current mode of a monitor.
+
+
+@subsection moving_char_up Removal of character actions
+
+The action parameter of the [character callback](@ref GLFWcharfun) has been
+removed. This was an artefact of the origin of GLFW, i.e. being developed in
+English by a Swede. However, many keyboard layouts require more than one key to
+produce characters with diacritical marks. Even the Swedish keyboard layout
+requires this for uncommon cases like ü.
+
+@par Old syntax
+@code
+void GLFWCALL character_callback(int character, int action);
+@endcode
+
+@par New syntax
+@code
+void character_callback(GLFWwindow* window, int character);
+@endcode
+
+
+@subsection moving_cursorpos Cursor position changes
+
+The `glfwGetMousePos` function has been renamed to @ref glfwGetCursorPos,
+`glfwSetMousePos` to @ref glfwSetCursorPos and `glfwSetMousePosCallback` to @ref
+glfwSetCursorPosCallback.
+
+The cursor position is now `double` instead of `int`, both for the direct
+functions and for the callback. Some platforms can provide sub-pixel cursor
+movement and this data is now passed on to the application where available. On
+platforms where this is not provided, the decimal part is zero.
+
+GLFW 3 only allows you to position the cursor within a window using @ref
+glfwSetCursorPos (formerly `glfwSetMousePos`) when that window is active.
+Unless the window is active, the function fails silently.
+
+
+@subsection moving_wheel Wheel position replaced by scroll offsets
+
+The `glfwGetMouseWheel` function has been removed. Scrolling is the input of
+offsets and has no absolute position. The mouse wheel callback has been
+replaced by a [scroll callback](@ref GLFWscrollfun) that receives
+two-dimensional floating point scroll offsets. This allows you to receive
+precise scroll data from for example modern touchpads.
+
+@par Old syntax
+@code
+void GLFWCALL mouse_wheel_callback(int position);
+@endcode
+
+@par New syntax
+@code
+void scroll_callback(GLFWwindow* window, double xoffset, double yoffset);
+@endcode
+
+@par Removed functions
+`glfwGetMouseWheel`
+
+
+@subsection moving_repeat Key repeat action
+
+The `GLFW_KEY_REPEAT` enable has been removed and key repeat is always enabled
+for both keys and characters. A new key action, `GLFW_REPEAT`, has been added
+to allow the [key callback](@ref GLFWkeyfun) to distinguish an initial key press
+from a repeat. Note that @ref glfwGetKey still returns only `GLFW_PRESS` or
+`GLFW_RELEASE`.
+
+
+@subsection moving_keys Physical key input
+
+GLFW 3 key tokens map to physical keys, unlike in GLFW 2 where they mapped to
+the values generated by the current keyboard layout. The tokens are named
+according to the values they would have using the standard US layout, but this
+is only a convenience, as most programmers are assumed to know that layout.
+This means that (for example) `GLFW_KEY_LEFT_BRACKET` is always a single key and
+is the same key in the same place regardless of what keyboard layouts the users
+of your program has.
+
+The key input facility was never meant for text input, although using it that
+way worked slightly better in GLFW 2. If you were using it to input text, you
+should be using the character callback instead, on both GLFW 2 and 3. This will
+give you the characters being input, as opposed to the keys being pressed.
+
+GLFW 3 has key tokens for all keys on a standard 105 key keyboard, so instead of
+having to remember whether to check for `a` or `A`, you now check for
+@ref GLFW_KEY_A.
+
+
+@subsection moving_joystick Joystick function changes
+
+The `glfwGetJoystickPos` function has been renamed to @ref glfwGetJoystickAxes.
+
+The `glfwGetJoystickParam` function and the `GLFW_PRESENT`, `GLFW_AXES` and
+`GLFW_BUTTONS` tokens have been replaced by the @ref glfwJoystickPresent
+function as well as axis and button counts returned by the @ref
+glfwGetJoystickAxes and @ref glfwGetJoystickButtons functions.
+
+
+@subsection moving_mbcs Win32 MBCS support
+
+The Win32 port of GLFW 3 will not compile in
+[MBCS mode](https://msdn.microsoft.com/en-us/library/5z097dxa.aspx).
+However, because the use of the Unicode version of the Win32 API doesn't affect
+the process as a whole, but only those windows created using it, it's perfectly
+possible to call MBCS functions from other parts of the same application.
+Therefore, even if an application using GLFW has MBCS mode code, there's no need
+for GLFW itself to support it.
+
+
+@subsection moving_windows Support for versions of Windows older than XP
+
+All explicit support for version of Windows older than XP has been removed.
+There is no code that actively prevents GLFW 3 from running on these earlier
+versions, but it uses Win32 functions that those versions lack.
+
+Windows XP was released in 2001, and by now (January 2015) it has not only
+replaced almost all earlier versions of Windows, but is itself rapidly being
+replaced by Windows 7 and 8. The MSDN library doesn't even provide
+documentation for version older than Windows 2000, making it difficult to
+maintain compatibility with these versions even if it was deemed worth the
+effort.
+
+The Win32 API has also not stood still, and GLFW 3 uses many functions only
+present on Windows XP or later. Even supporting an OS as new as XP (new
+from the perspective of GLFW 2, which still supports Windows 95) requires
+runtime checking for a number of functions that are present only on modern
+version of Windows.
+
+
+@subsection moving_syskeys Capture of system-wide hotkeys
+
+The ability to disable and capture system-wide hotkeys like Alt+Tab has been
+removed. Modern applications, whether they're games, scientific visualisations
+or something else, are nowadays expected to be good desktop citizens and allow
+these hotkeys to function even when running in full screen mode.
+
+
+@subsection moving_terminate Automatic termination
+
+GLFW 3 does not register @ref glfwTerminate with `atexit` at initialization,
+because `exit` calls registered functions from the calling thread and while it
+is permitted to call `exit` from any thread, @ref glfwTerminate must only be
+called from the main thread.
+
+To release all resources allocated by GLFW, you should call @ref glfwTerminate
+yourself, from the main thread, before the program terminates. Note that this
+destroys all windows not already destroyed with @ref glfwDestroyWindow,
+invalidating any window handles you may still have.
+
+
+@subsection moving_glu GLU header inclusion
+
+GLFW 3 does not by default include the GLU header and GLU itself has been
+deprecated by [Khronos](https://en.wikipedia.org/wiki/Khronos_Group). __New
+projects should not use GLU__, but if you need it for legacy code that
+has been moved to GLFW 3, you can request that the GLFW header includes it by
+defining @ref GLFW_INCLUDE_GLU before the inclusion of the GLFW header.
+
+@par Old syntax
+@code
+#include
+@endcode
+
+@par New syntax
+@code
+#define GLFW_INCLUDE_GLU
+#include
+@endcode
+
+There are many libraries that offer replacements for the functionality offered
+by GLU. For the matrix helper functions, see math libraries like
+[GLM](https://github.com/g-truc/glm) (for C++),
+[linmath.h](https://github.com/datenwolf/linmath.h) (for C) and others. For the
+tessellation functions, see for example
+[libtess2](https://github.com/memononen/libtess2).
+
+
+@section moving_tables Name change tables
+
+
+@subsection moving_renamed_functions Renamed functions
+
+| GLFW 2 | GLFW 3 | Notes |
+| --------------------------- | ----------------------------- | ----- |
+| `glfwOpenWindow` | @ref glfwCreateWindow | All channel bit depths are now hints
+| `glfwCloseWindow` | @ref glfwDestroyWindow | |
+| `glfwOpenWindowHint` | @ref glfwWindowHint | Now accepts all `GLFW_*_BITS` tokens |
+| `glfwEnable` | @ref glfwSetInputMode | |
+| `glfwDisable` | @ref glfwSetInputMode | |
+| `glfwGetMousePos` | @ref glfwGetCursorPos | |
+| `glfwSetMousePos` | @ref glfwSetCursorPos | |
+| `glfwSetMousePosCallback` | @ref glfwSetCursorPosCallback | |
+| `glfwSetMouseWheelCallback` | @ref glfwSetScrollCallback | Accepts two-dimensional scroll offsets as doubles |
+| `glfwGetJoystickPos` | @ref glfwGetJoystickAxes | |
+| `glfwGetWindowParam` | @ref glfwGetWindowAttrib | |
+| `glfwGetGLVersion` | @ref glfwGetWindowAttrib | Use `GLFW_CONTEXT_VERSION_MAJOR`, `GLFW_CONTEXT_VERSION_MINOR` and `GLFW_CONTEXT_REVISION` |
+| `glfwGetDesktopMode` | @ref glfwGetVideoMode | Returns the current mode of a monitor |
+| `glfwGetJoystickParam` | @ref glfwJoystickPresent | The axis and button counts are provided by @ref glfwGetJoystickAxes and @ref glfwGetJoystickButtons |
+
+
+@subsection moving_renamed_types Renamed types
+
+| GLFW 2 | GLFW 3 | Notes |
+| ------------------- | --------------------- | |
+| `GLFWmousewheelfun` | @ref GLFWscrollfun | |
+| `GLFWmouseposfun` | @ref GLFWcursorposfun | |
+
+
+@subsection moving_renamed_tokens Renamed tokens
+
+| GLFW 2 | GLFW 3 | Notes |
+| --------------------------- | ---------------------------- | ----- |
+| `GLFW_OPENGL_VERSION_MAJOR` | `GLFW_CONTEXT_VERSION_MAJOR` | Renamed as it applies to OpenGL ES as well |
+| `GLFW_OPENGL_VERSION_MINOR` | `GLFW_CONTEXT_VERSION_MINOR` | Renamed as it applies to OpenGL ES as well |
+| `GLFW_FSAA_SAMPLES` | `GLFW_SAMPLES` | Renamed to match the OpenGL API |
+| `GLFW_ACTIVE` | `GLFW_FOCUSED` | Renamed to match the window focus callback |
+| `GLFW_WINDOW_NO_RESIZE` | `GLFW_RESIZABLE` | The default has been inverted |
+| `GLFW_MOUSE_CURSOR` | `GLFW_CURSOR` | Used with @ref glfwSetInputMode |
+| `GLFW_KEY_ESC` | `GLFW_KEY_ESCAPE` | |
+| `GLFW_KEY_DEL` | `GLFW_KEY_DELETE` | |
+| `GLFW_KEY_PAGEUP` | `GLFW_KEY_PAGE_UP` | |
+| `GLFW_KEY_PAGEDOWN` | `GLFW_KEY_PAGE_DOWN` | |
+| `GLFW_KEY_KP_NUM_LOCK` | `GLFW_KEY_NUM_LOCK` | |
+| `GLFW_KEY_LCTRL` | `GLFW_KEY_LEFT_CONTROL` | |
+| `GLFW_KEY_LSHIFT` | `GLFW_KEY_LEFT_SHIFT` | |
+| `GLFW_KEY_LALT` | `GLFW_KEY_LEFT_ALT` | |
+| `GLFW_KEY_LSUPER` | `GLFW_KEY_LEFT_SUPER` | |
+| `GLFW_KEY_RCTRL` | `GLFW_KEY_RIGHT_CONTROL` | |
+| `GLFW_KEY_RSHIFT` | `GLFW_KEY_RIGHT_SHIFT` | |
+| `GLFW_KEY_RALT` | `GLFW_KEY_RIGHT_ALT` | |
+| `GLFW_KEY_RSUPER` | `GLFW_KEY_RIGHT_SUPER` | |
+
+*/
diff --git a/extern/glfw/docs/news.dox b/extern/glfw/docs/news.dox
new file mode 100644
index 0000000000..c21a8b8a60
--- /dev/null
+++ b/extern/glfw/docs/news.dox
@@ -0,0 +1,863 @@
+/*!
+
+@page news Release notes
+
+@tableofcontents
+
+
+@section news_33 Release notes for version 3.3
+
+These are the release notes for version 3.3. For a more detailed view including
+all fixed bugs see the [version history](https://www.glfw.org/changelog.html).
+
+Please review the caveats, deprecations and removals if your project was written
+against an earlier version of GLFW 3.
+
+
+@subsection features_33 New features in version 3.3
+
+@subsubsection gamepad_33 Gamepad input via SDL_GameControllerDB
+
+GLFW can now remap game controllers to a standard Xbox-like layout using
+a built-in copy of SDL_GameControllerDB. Call @ref glfwJoystickIsGamepad to
+check if a joystick has a mapping, @ref glfwGetGamepadState to retrieve its
+input state, @ref glfwUpdateGamepadMappings to add newer mappings and @ref
+glfwGetGamepadName and @ref glfwGetJoystickGUID for mapping related information.
+
+For more information see @ref gamepad.
+
+
+@subsubsection moltenvk_33 Support for Vulkan on macOS via MoltenVK
+
+GLFW now supports [MoltenVK](https://moltengl.com/moltenvk/), a Vulkan
+implementation on top of the Metal API, and its `VK_MVK_macos_surface` window
+surface creation extension. MoltenVK is included in the [macOS Vulkan
+SDK](https://vulkan.lunarg.com/).
+
+For more information see @ref vulkan_guide.
+
+
+@subsubsection content_scale_33 Content scale queries for DPI-aware rendering
+
+GLFW now provides content scales for windows and monitors, i.e. the ratio
+between their current DPI and the platform's default DPI, with @ref
+glfwGetWindowContentScale and @ref glfwGetMonitorContentScale.
+
+Changes of the content scale of a window can be received with the window content
+scale callback, set with @ref glfwSetWindowContentScaleCallback.
+
+The @ref GLFW_SCALE_TO_MONITOR window hint enables automatic resizing of a
+window by the content scale of the monitor it is placed, on platforms like
+Windows where this is necessary. This takes effect both on creation and when
+the window is moved between monitors. It is related to but different from
+[GLFW_COCOA_RETINA_FRAMEBUFFER](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint).
+
+For more information see @ref window_scale.
+
+
+@subsubsection setwindowattrib_33 Support for updating window attributes
+
+GLFW now supports changing the [GLFW_DECORATED](@ref GLFW_DECORATED_attrib),
+[GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib),
+[GLFW_FLOATING](@ref GLFW_FLOATING_attrib),
+[GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib) and
+[GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib) attributes for existing
+windows with @ref glfwSetWindowAttrib.
+
+For more information see @ref window_attribs.
+
+
+@subsubsection raw_motion_33 Support for raw mouse motion
+
+GLFW now supports raw (unscaled and unaccelerated) mouse motion in disabled
+cursor mode with the [GLFW_RAW_MOUSE_MOTION](@ref GLFW_RAW_MOUSE_MOTION) input
+mode. Raw mouse motion input is not yet implemented on macOS. Call @ref
+glfwRawMouseMotionSupported to check if GLFW can provide raw mouse motion on the
+current system.
+
+For more information see @ref raw_mouse_motion.
+
+
+@subsubsection joysticks_33 Joystick hats
+
+GLFW can now return the state of hats (i.e. POVs or D-pads) of a joystick with
+@ref glfwGetJoystickHats. For compatibility, hats are also exposed as buttons.
+This can be disabled with the @ref GLFW_JOYSTICK_HAT_BUTTONS initialization
+hint.
+
+For more information see @ref joystick_hat.
+
+
+@subsubsection geterror_33 Error query
+
+GLFW now supports querying the last error code for the calling thread and its
+human-readable description with @ref glfwGetError. This can be used instead of
+or together with the error callback.
+
+For more information see @ref error_handling.
+
+
+@subsubsection init_hints_33 Support for initialization hints
+
+GLFW now supports setting library initialization hints with @ref glfwInitHint.
+These must be set before initialization to take effect. Some of these hints are
+platform specific but are safe to set on any platform.
+
+For more information see @ref init_hints.
+
+
+@subsubsection attention_33 User attention request
+
+GLFW now supports requesting user attention with @ref
+glfwRequestWindowAttention. Where possible this calls attention to the
+specified window. On platforms like macOS it calls attention to the whole
+application.
+
+For more information see @ref window_attention.
+
+
+@subsubsection maximize_33 Window maximization callback
+
+GLFW now supports notifying the application that the window has been maximized
+@ref glfwSetWindowMaximizeCallback. This is called both when the window was
+maximized by the user and when it was done with @ref glfwMaximizeWindow.
+
+For more information see @ref window_maximize.
+
+
+@subsubsection workarea_33 Query for the monitor work area
+
+GLFW now supports querying the work area of a monitor, i.e. the area not
+occupied by task bars or global menu bars, with @ref glfwGetMonitorWorkarea. On
+platforms that lack this concept, the whole area of the monitor is returned.
+
+For more information see @ref monitor_workarea.
+
+
+@subsubsection transparency_33 Transparent windows and framebuffers
+
+GLFW now supports the creation of windows with transparent framebuffers on
+systems with desktop compositing enabled with the @ref
+GLFW_TRANSPARENT_FRAMEBUFFER window hint and attribute. This hint must be set
+before window creation and leaves any window decorations opaque.
+
+GLFW now also supports whole window transparency with @ref glfwGetWindowOpacity
+and @ref glfwSetWindowOpacity. This value controls the opacity of the whole
+window including decorations and unlike framebuffer transparency can be changed
+at any time after window creation.
+
+For more information see @ref window_transparency.
+
+
+@subsubsection key_scancode_33 Query for the scancode of a key
+
+GLFW now supports querying the platform dependent scancode of any physical key
+with @ref glfwGetKeyScancode.
+
+For more information see @ref input_key.
+
+
+@subsubsection center_cursor_33 Cursor centering window hint
+
+GLFW now supports controlling whether the cursor is centered over newly created
+full screen windows with the [GLFW_CENTER_CURSOR](@ref GLFW_CENTER_CURSOR_hint)
+window hint. It is enabled by default.
+
+
+@subsubsection cursor_hover_33 Mouse cursor hover window attribute
+
+GLFW now supports polling whether the cursor is hovering over the window content
+area with the [GLFW_HOVERED](@ref GLFW_HOVERED_attrib) window attribute. This
+attribute corresponds to the [cursor enter/leave](@ref cursor_enter) event.
+
+
+@subsubsection focusonshow_33 Window hint and attribute for input focus on show
+
+GLFW now has the [GLFW_FOCUS_ON_SHOW](@ref GLFW_DECORATED_hint) window hint and
+attribute for controlling whether a window gets input focus when shown. It is
+enabled by default. It applies both when creating an visible window with @ref
+glfwCreateWindow and when showing it with @ref glfwShowWindow.
+
+This is a workaround for GLFW 3.0 lacking @ref glfwFocusWindow and will be
+corrected in the next major version.
+
+For more information see @ref window_hide.
+
+
+@subsubsection device_userptr_33 Monitor and joystick user pointers
+
+GLFW now supports setting and querying user pointers for connected monitors and
+joysticks with @ref glfwSetMonitorUserPointer, @ref glfwGetMonitorUserPointer,
+@ref glfwSetJoystickUserPointer and @ref glfwGetJoystickUserPointer.
+
+For more information see @ref monitor_userptr and @ref joystick_userptr.
+
+
+@subsubsection macos_nib_33 macOS menu bar from nib file
+
+GLFW will now load a `MainMenu.nib` file if found in the `Contents/Resources`
+directory of the application bundle, as a way to replace the GLFW menu bar
+without recompiling GLFW. This behavior can be disabled with the
+[GLFW_COCOA_MENUBAR](@ref GLFW_COCOA_MENUBAR_hint) initialization hint.
+
+
+@subsubsection glext_33 Support for more context creation extensions
+
+The context hint @ref GLFW_SRGB_CAPABLE now supports OpenGL ES via
+`WGL_EXT_colorspace`, the context hint @ref GLFW_CONTEXT_NO_ERROR now supports
+`WGL_ARB_create_context_no_error` and `GLX_ARB_create_context_no_error`, the
+context hint @ref GLFW_CONTEXT_RELEASE_BEHAVIOR now supports
+`EGL_KHR_context_flush_control` and @ref glfwGetProcAddress now supports
+`EGL_KHR_get_all_proc_addresses`.
+
+
+@subsubsection osmesa_33 OSMesa off-screen context creation support
+
+GLFW now supports creating off-screen OpenGL contexts using
+[OSMesa](https://www.mesa3d.org/osmesa.html) by setting
+[GLFW_CONTEXT_CREATION_API](@ref GLFW_CONTEXT_CREATION_API_hint) to
+`GLFW_OSMESA_CONTEXT_API`. Native access function have been added to retrieve
+the OSMesa color and depth buffers.
+
+There is also a new null backend that uses OSMesa as its native context
+creation API, intended for automated testing. This backend does not provide
+input.
+
+
+@subsection caveats_33 Caveats for version 3.3
+
+@subsubsection joystick_layout_33 Layout of joysticks have changed
+
+The way joystick elements are arranged have changed to match SDL2 in order to
+support SDL_GameControllerDB mappings. The layout of joysticks may
+change again if required for compatibility with SDL2. If you need a known and
+stable layout for game controllers, see if you can switch to @ref gamepad.
+
+Existing code that depends on a specific joystick layout will likely have to be
+updated.
+
+
+@subsubsection wait_events_33 No window required to wait for events
+
+The @ref glfwWaitEvents and @ref glfwWaitEventsTimeout functions no longer need
+a window to be created to wait for events. Before version 3.3 these functions
+would return immediately if there were no user-created windows. On platforms
+where only windows can receive events, an internal helper window is used.
+
+Existing code that depends on the earlier behavior will likely have to be
+updated.
+
+
+@subsubsection gamma_ramp_size_33 Gamma ramp size of 256 may be rejected
+
+The documentation for versions before 3.3 stated that a gamma ramp size of 256
+would always be accepted. This was never the case on X11 and could lead to
+artifacts on macOS. The @ref glfwSetGamma function has been updated to always
+generate a ramp of the correct size.
+
+Existing code that hardcodes a size of 256 should be updated to use the size of
+the current ramp of a monitor when setting a new ramp for that monitor.
+
+
+@subsubsection xinput_deadzone_33 Windows XInput deadzone removed
+
+GLFW no longer applies any deadzone to the input state received from the XInput
+API. This was never done for any other platform joystick API so this change
+makes the behavior more consistent but you will need to apply your own deadzone
+if desired.
+
+
+@subsubsection x11_clipboard_33 X11 clipboard transfer limits
+
+GLFW now supports reading clipboard text via the `INCR` method, which removes
+the limit on how much text can be read with @ref glfwGetClipboardString.
+However, writing via this method is not yet supported, so you may not be able to
+write a very large string with @ref glfwSetClipboardString even if you read it
+from the clipboard earlier.
+
+The exact size limit for writing to the clipboard is negotiated with each
+receiving application but is at least several tens of kilobytes. Note that only
+the read limit has changed. Any string that could be written before still can
+be.
+
+
+@subsubsection x11_linking_33 X11 extension libraries are loaded dynamically
+
+GLFW now loads all X11 extension libraries at initialization. The only X11
+library you need to link against is `libX11`. The header files for the
+extension libraries are still required for compilation.
+
+Existing projects and makefiles that link GLFW directly against the extension
+libraries should still build correctly but will add these libraries as load-time
+dependencies.
+
+
+@subsubsection cmake_version_33 CMake 3.0 or later is required
+
+The minimum CMake version has been raised from 2.8.12 to 3.0. This is only
+a requirement of the GLFW CMake files. The GLFW source files do not depend on
+CMake.
+
+
+@subsubsection caveat_fbtransparency_33 Framebuffer transparency requires DWM transparency
+
+GLFW no longer supports framebuffer transparency enabled via @ref
+GLFW_TRANSPARENT_FRAMEBUFFER on Windows 7 if DWM transparency is off
+(the Transparency setting under Personalization > Window Color).
+
+
+@subsection deprecations_33 Deprecations in version 3.3
+
+@subsubsection charmods_callback_33 Character with modifiers callback
+
+The character with modifiers callback set with @ref glfwSetCharModsCallback has
+been deprecated and should if possible not be used.
+
+Existing code should still work but further bug fixes will likely not be made.
+The callback will be removed in the next major version.
+
+
+@subsubsection clipboard_window_33 Window parameter to clipboard functions
+
+The window parameter of the clipboard functions @ref glfwGetClipboardString and
+@ref glfwSetClipboardString has been deprecated and is no longer used on any
+platform. On platforms where the clipboard must be owned by a specific window,
+an internal helper window is used.
+
+Existing code should still work unless it depends on a specific window owning
+the clipboard. New code may pass `NULL` as the window argument. The parameter
+will be removed in a future release.
+
+
+@subsection removals_33 Removals in 3.3
+
+@subsubsection macos_options_33 macOS specific CMake options and macros
+
+The `GLFW_USE_RETINA`, `GLFW_USE_CHDIR` and `GLFW_USE_MENUBAR` CMake options and
+the `_GLFW_USE_RETINA`, `_GLFW_USE_CHDIR` and `_GLFW_USE_MENUBAR` compile-time
+macros have been removed.
+
+These options and macros are replaced by the window hint
+[GLFW_COCOA_RETINA_FRAMEBUFFER](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint)
+and the init hints
+[GLFW_COCOA_CHDIR_RESOURCES](@ref GLFW_COCOA_CHDIR_RESOURCES_hint) and
+[GLFW_COCOA_MENUBAR](@ref GLFW_COCOA_MENUBAR_hint).
+
+Existing projects and makefiles that set these options or define these macros
+during compilation of GLFW will still build but it will have no effect and the
+default behaviors will be used.
+
+
+@subsubsection vulkan_sdk_33 LunarG Vulkan SDK dependency
+
+The GLFW test programs that previously depended on the LunarG Vulkan SDK now
+instead uses a Vulkan loader generated by
+[glad2](https://github.com/Dav1dde/glad). This means the GLFW CMake files no
+longer look for the Vulkan SDK.
+
+Existing CMake projects that depended on the Vulkan SDK cache variables from
+GLFW will need to call `find_package(Vulkan)` themselves. CMake 3.7 and later
+already comes with a
+[Vulkan find module](https://cmake.org/cmake/help/latest/module/FindVulkan.html)
+similar to the one GLFW previously included.
+
+
+@subsubsection lib_suffix_33 CMake option LIB_SUFFIX
+
+The `LIB_SUFFIX` CMake option has been removed. GLFW now uses the
+GNUInstallDirs CMake package to handle platform specific details like the
+library directory suffix and the `LIB_SUFFIX` CMake option has been removed.
+
+Existing projects and makefiles that set the `LIB_SUFFIX` option will use the
+suffix chosen by the GNUInstallDirs package and the option will be ignored.
+
+
+@subsubsection mir_removed_33 Mir support
+
+The experimental Mir support has been completely removed as the Mir project has
+implemented support for the Wayland protocol and is recommending that
+applications use that instead.
+
+Existing projects and makefiles that select Mir when compiling GLFW will fail.
+Use Wayland or X11 instead.
+
+
+@subsection symbols_33 New symbols in version 3.3
+
+@subsubsection functions_33 New functions in version 3.3
+
+ - @ref glfwInitHint
+ - @ref glfwGetError
+ - @ref glfwGetMonitorWorkarea
+ - @ref glfwGetMonitorContentScale
+ - @ref glfwGetMonitorUserPointer
+ - @ref glfwSetMonitorUserPointer
+ - @ref glfwWindowHintString
+ - @ref glfwGetWindowContentScale
+ - @ref glfwGetWindowOpacity
+ - @ref glfwSetWindowOpacity
+ - @ref glfwRequestWindowAttention
+ - @ref glfwSetWindowAttrib
+ - @ref glfwSetWindowMaximizeCallback
+ - @ref glfwSetWindowContentScaleCallback
+ - @ref glfwRawMouseMotionSupported
+ - @ref glfwGetKeyScancode
+ - @ref glfwGetJoystickHats
+ - @ref glfwGetJoystickGUID
+ - @ref glfwGetJoystickUserPointer
+ - @ref glfwSetJoystickUserPointer
+ - @ref glfwJoystickIsGamepad
+ - @ref glfwUpdateGamepadMappings
+ - @ref glfwGetGamepadName
+ - @ref glfwGetGamepadState
+
+
+@subsubsection types_33 New types in version 3.3
+
+ - @ref GLFWwindowmaximizefun
+ - @ref GLFWwindowcontentscalefun
+ - @ref GLFWgamepadstate
+
+
+@subsubsection constants_33 New constants in version 3.3
+
+ - @ref GLFW_NO_ERROR
+ - @ref GLFW_JOYSTICK_HAT_BUTTONS
+ - @ref GLFW_COCOA_CHDIR_RESOURCES
+ - @ref GLFW_COCOA_MENUBAR
+ - @ref GLFW_CENTER_CURSOR
+ - @ref GLFW_TRANSPARENT_FRAMEBUFFER
+ - @ref GLFW_HOVERED
+ - @ref GLFW_FOCUS_ON_SHOW
+ - @ref GLFW_SCALE_TO_MONITOR
+ - @ref GLFW_COCOA_RETINA_FRAMEBUFFER
+ - @ref GLFW_COCOA_FRAME_NAME
+ - @ref GLFW_COCOA_GRAPHICS_SWITCHING
+ - @ref GLFW_X11_CLASS_NAME
+ - @ref GLFW_X11_INSTANCE_NAME
+ - @ref GLFW_OSMESA_CONTEXT_API
+ - @ref GLFW_HAT_CENTERED
+ - @ref GLFW_HAT_UP
+ - @ref GLFW_HAT_RIGHT
+ - @ref GLFW_HAT_DOWN
+ - @ref GLFW_HAT_LEFT
+ - @ref GLFW_HAT_RIGHT_UP
+ - @ref GLFW_HAT_RIGHT_DOWN
+ - @ref GLFW_HAT_LEFT_UP
+ - @ref GLFW_HAT_LEFT_DOWN
+ - @ref GLFW_MOD_CAPS_LOCK
+ - @ref GLFW_MOD_NUM_LOCK
+ - @ref GLFW_LOCK_KEY_MODS
+ - @ref GLFW_RAW_MOUSE_MOTION
+ - @ref GLFW_GAMEPAD_BUTTON_A
+ - @ref GLFW_GAMEPAD_BUTTON_B
+ - @ref GLFW_GAMEPAD_BUTTON_X
+ - @ref GLFW_GAMEPAD_BUTTON_Y
+ - @ref GLFW_GAMEPAD_BUTTON_LEFT_BUMPER
+ - @ref GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER
+ - @ref GLFW_GAMEPAD_BUTTON_BACK
+ - @ref GLFW_GAMEPAD_BUTTON_START
+ - @ref GLFW_GAMEPAD_BUTTON_GUIDE
+ - @ref GLFW_GAMEPAD_BUTTON_LEFT_THUMB
+ - @ref GLFW_GAMEPAD_BUTTON_RIGHT_THUMB
+ - @ref GLFW_GAMEPAD_BUTTON_DPAD_UP
+ - @ref GLFW_GAMEPAD_BUTTON_DPAD_RIGHT
+ - @ref GLFW_GAMEPAD_BUTTON_DPAD_DOWN
+ - @ref GLFW_GAMEPAD_BUTTON_DPAD_LEFT
+ - @ref GLFW_GAMEPAD_BUTTON_LAST
+ - @ref GLFW_GAMEPAD_BUTTON_CROSS
+ - @ref GLFW_GAMEPAD_BUTTON_CIRCLE
+ - @ref GLFW_GAMEPAD_BUTTON_SQUARE
+ - @ref GLFW_GAMEPAD_BUTTON_TRIANGLE
+ - @ref GLFW_GAMEPAD_AXIS_LEFT_X
+ - @ref GLFW_GAMEPAD_AXIS_LEFT_Y
+ - @ref GLFW_GAMEPAD_AXIS_RIGHT_X
+ - @ref GLFW_GAMEPAD_AXIS_RIGHT_Y
+ - @ref GLFW_GAMEPAD_AXIS_LEFT_TRIGGER
+ - @ref GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER
+ - @ref GLFW_GAMEPAD_AXIS_LAST
+
+
+@section news_32 Release notes for 3.2
+
+These are the release notes for version 3.2. For a more detailed view including
+all fixed bugs see the [version history](https://www.glfw.org/changelog.html).
+
+
+@subsection features_32 New features in version 3.2
+
+@subsubsection news_32_vulkan Support for Vulkan
+
+GLFW now supports basic integration with Vulkan with @ref glfwVulkanSupported,
+@ref glfwGetRequiredInstanceExtensions, @ref glfwGetInstanceProcAddress, @ref
+glfwGetPhysicalDevicePresentationSupport and @ref glfwCreateWindowSurface.
+Vulkan header inclusion can be selected with
+@ref GLFW_INCLUDE_VULKAN.
+
+
+@subsubsection news_32_setwindowmonitor Window mode switching
+
+GLFW now supports switching between windowed and full screen modes and updating
+the monitor and desired resolution and refresh rate of full screen windows with
+@ref glfwSetWindowMonitor.
+
+
+@subsubsection news_32_maximize Window maxmimization support
+
+GLFW now supports window maximization with @ref glfwMaximizeWindow and the
+@ref GLFW_MAXIMIZED window hint and attribute.
+
+
+@subsubsection news_32_focus Window input focus control
+
+GLFW now supports giving windows input focus with @ref glfwFocusWindow.
+
+
+@subsubsection news_32_sizelimits Window size limit support
+
+GLFW now supports setting both absolute and relative window size limits with
+@ref glfwSetWindowSizeLimits and @ref glfwSetWindowAspectRatio.
+
+
+@subsubsection news_32_keyname Localized key names
+
+GLFW now supports querying the localized name of printable keys with @ref
+glfwGetKeyName, either by key token or by scancode.
+
+
+@subsubsection news_32_waittimeout Wait for events with timeout
+
+GLFW now supports waiting for events for a set amount of time with @ref
+glfwWaitEventsTimeout.
+
+
+@subsubsection news_32_icon Window icon support
+
+GLFW now supports setting the icon of windows with @ref glfwSetWindowIcon.
+
+
+@subsubsection news_32_timer Raw timer access
+
+GLFW now supports raw timer values with @ref glfwGetTimerValue and @ref
+glfwGetTimerFrequency.
+
+
+@subsubsection news_32_joystick Joystick connection callback
+
+GLFW now supports notifying when a joystick has been connected or disconnected
+with @ref glfwSetJoystickCallback.
+
+
+@subsubsection news_32_noapi Context-less windows
+
+GLFW now supports creating windows without a OpenGL or OpenGL ES context by
+setting the [GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) hint to `GLFW_NO_API`.
+
+
+@subsubsection news_32_contextapi Run-time context creation API selection
+
+GLFW now supports selecting and querying the context creation API at run-time
+with the @ref GLFW_CONTEXT_CREATION_API hint and attribute.
+
+
+@subsubsection news_32_noerror Error-free context creation
+
+GLFW now supports creating and querying OpenGL and OpenGL ES contexts that do
+not emit errors with the @ref GLFW_CONTEXT_NO_ERROR hint, provided the machine
+supports the `GL_KHR_no_error` extension.
+
+
+@subsubsection news_32_cmake CMake config-file package support
+
+GLFW now supports being used as a
+[config-file package](@ref build_link_cmake_package) from other projects for
+easy linking with the library and its dependencies.
+
+
+@section news_31 Release notes for 3.1
+
+These are the release notes for version 3.1. For a more detailed view including
+all fixed bugs see the [version history](https://www.glfw.org/changelog.html).
+
+
+@subsection features_31 New features in version 3.1
+
+@subsubsection news_31_cursor Custom mouse cursor images
+
+GLFW now supports creating and setting both custom cursor images and standard
+cursor shapes. They are created with @ref glfwCreateCursor or @ref
+glfwCreateStandardCursor, set with @ref glfwSetCursor and destroyed with @ref
+glfwDestroyCursor.
+
+@see @ref cursor_object
+
+
+@subsubsection news_31_drop Path drop event
+
+GLFW now provides a callback for receiving the paths of files and directories
+dropped onto GLFW windows. The callback is set with @ref glfwSetDropCallback.
+
+@see @ref path_drop
+
+
+@subsubsection news_31_emptyevent Main thread wake-up
+
+GLFW now provides the @ref glfwPostEmptyEvent function for posting an empty
+event from another thread to the main thread event queue, causing @ref
+glfwWaitEvents to return.
+
+@see @ref events
+
+
+@subsubsection news_31_framesize Window frame size query
+
+GLFW now supports querying the size, on each side, of the frame around the
+content area of a window, with @ref glfwGetWindowFrameSize.
+
+@see [Window size](@ref window_size)
+
+
+@subsubsection news_31_autoiconify Simultaneous multi-monitor rendering
+
+GLFW now supports disabling auto-iconification of full screen windows with
+the [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_hint) window hint. This is
+intended for people building multi-monitor installations, where you need windows
+to stay in full screen despite losing input focus.
+
+
+@subsubsection news_31_floating Floating windows
+
+GLFW now supports floating windows, also called topmost or always on top, for
+easier debugging with the @ref GLFW_FLOATING window hint and attribute.
+
+
+@subsubsection news_31_focused Initially unfocused windows
+
+GLFW now supports preventing a windowed mode window from gaining input focus on
+creation, with the [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) window hint.
+
+
+@subsubsection news_31_direct Direct access for window attributes and cursor position
+
+GLFW now queries the window input focus, visibility and iconification attributes
+and the cursor position directly instead of returning cached data.
+
+
+@subsubsection news_31_charmods Character with modifiers callback
+
+GLFW now provides a callback for character events with modifier key bits. The
+callback is set with @ref glfwSetCharModsCallback. Unlike the regular character
+callback, this will report character events that will not result in a character
+being input, for example if the Control key is held down.
+
+@see @ref input_char
+
+
+@subsubsection news_31_single Single buffered framebuffers
+
+GLFW now supports the creation of single buffered windows, with the @ref
+GLFW_DOUBLEBUFFER hint.
+
+
+@subsubsection news_31_glext Macro for including extension header
+
+GLFW now includes the extension header appropriate for the chosen OpenGL or
+OpenGL ES header when @ref GLFW_INCLUDE_GLEXT is defined. GLFW does not provide
+these headers. They must be provided by your development environment or your
+OpenGL or OpenGL ES SDK.
+
+
+@subsubsection news_31_release Context release behaviors
+
+GLFW now supports controlling and querying whether the pipeline is flushed when
+a context is made non-current, with the @ref GLFW_CONTEXT_RELEASE_BEHAVIOR hint
+and attribute, provided the machine supports the `GL_KHR_context_flush_control`
+extension.
+
+
+@subsubsection news_31_wayland (Experimental) Wayland support
+
+GLFW now has an _experimental_ Wayland display protocol backend that can be
+selected on Linux with a CMake option.
+
+
+@subsubsection news_31_mir (Experimental) Mir support
+
+GLFW now has an _experimental_ Mir display server backend that can be selected
+on Linux with a CMake option.
+
+
+@section news_30 Release notes for 3.0
+
+These are the release notes for version 3.0. For a more detailed view including
+all fixed bugs see the [version history](https://www.glfw.org/changelog.html).
+
+
+@subsection features_30 New features in version 3.0
+
+@subsubsection news_30_cmake CMake build system
+
+GLFW now uses the CMake build system instead of the various makefiles and
+project files used by earlier versions. CMake is available for all platforms
+supported by GLFW, is present in most package systems and can generate
+makefiles and/or project files for most popular development environments.
+
+For more information on how to use CMake, see the
+[CMake manual](https://cmake.org/cmake/help/documentation.html).
+
+
+@subsubsection news_30_multiwnd Multi-window support
+
+GLFW now supports the creation of multiple windows, each with their own OpenGL
+or OpenGL ES context, and all window functions now take a window handle. Event
+callbacks are now per-window and are provided with the handle of the window that
+received the event. The @ref glfwMakeContextCurrent function has been added to
+select which context is current on a given thread.
+
+
+@subsubsection news_30_multimon Multi-monitor support
+
+GLFW now explicitly supports multiple monitors. They can be enumerated with
+@ref glfwGetMonitors, queried with @ref glfwGetVideoModes, @ref
+glfwGetMonitorPos, @ref glfwGetMonitorName and @ref glfwGetMonitorPhysicalSize,
+and specified at window creation to make the newly created window full screen on
+that specific monitor.
+
+
+@subsubsection news_30_unicode Unicode support
+
+All string arguments to GLFW functions and all strings returned by GLFW now use
+the UTF-8 encoding. This includes the window title, error string, clipboard
+text, monitor and joystick names as well as the extension function arguments (as
+ASCII is a subset of UTF-8).
+
+
+@subsubsection news_30_clipboard Clipboard text I/O
+
+GLFW now supports reading and writing plain text to and from the system
+clipboard, with the @ref glfwGetClipboardString and @ref glfwSetClipboardString
+functions.
+
+
+@subsubsection news_30_gamma Gamma ramp support
+
+GLFW now supports setting and reading back the gamma ramp of monitors, with the
+@ref glfwGetGammaRamp and @ref glfwSetGammaRamp functions. There is also @ref
+glfwSetGamma, which generates a ramp from a gamma value and then sets it.
+
+
+@subsubsection news_30_gles OpenGL ES support
+
+GLFW now supports the creation of OpenGL ES contexts, by setting the
+[GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) hint to `GLFW_OPENGL_ES_API`, where
+creation of such contexts are supported. Note that GLFW _does not implement_
+OpenGL ES, so your driver must provide support in a way usable by GLFW. Modern
+Nvidia and Intel drivers support creation of OpenGL ES context using the GLX and
+WGL APIs, while AMD provides an EGL implementation instead.
+
+
+@subsubsection news_30_egl (Experimental) EGL support
+
+GLFW now has an experimental EGL context creation back end that can be selected
+through CMake options.
+
+
+@subsubsection news_30_hidpi High-DPI support
+
+GLFW now supports high-DPI monitors on both Windows and macOS, giving windows
+full resolution framebuffers where other UI elements are scaled up. To achieve
+this, @ref glfwGetFramebufferSize and @ref glfwSetFramebufferSizeCallback have
+been added. These work with pixels, while the rest of the GLFW API works with
+screen coordinates. This is important as OpenGL uses pixels, not screen
+coordinates.
+
+
+@subsubsection news_30_error Error callback
+
+GLFW now has an error callback, which can provide your application with much
+more detailed diagnostics than was previously possible. The callback is passed
+an error code and a description string.
+
+
+@subsubsection news_30_wndptr Per-window user pointer
+
+Each window now has a user-defined pointer, retrieved with @ref
+glfwGetWindowUserPointer and set with @ref glfwSetWindowUserPointer, to make it
+easier to integrate GLFW into C++ code.
+
+
+@subsubsection news_30_iconifyfun Window iconification callback
+
+Each window now has a callback for iconification and restoration events,
+which is set with @ref glfwSetWindowIconifyCallback.
+
+
+@subsubsection news_30_wndposfun Window position callback
+
+Each window now has a callback for position events, which is set with @ref
+glfwSetWindowPosCallback.
+
+
+@subsubsection news_30_wndpos Window position query
+
+The position of a window can now be retrieved using @ref glfwGetWindowPos.
+
+
+@subsubsection news_30_focusfun Window focus callback
+
+Each windows now has a callback for focus events, which is set with @ref
+glfwSetWindowFocusCallback.
+
+
+@subsubsection news_30_enterleave Cursor enter/leave callback
+
+Each window now has a callback for when the mouse cursor enters or leaves its
+content area, which is set with @ref glfwSetCursorEnterCallback.
+
+
+@subsubsection news_30_wndtitle Initial window title
+
+The title of a window is now specified at creation time, as one of the arguments
+to @ref glfwCreateWindow.
+
+
+@subsubsection news_30_hidden Hidden windows
+
+Windows can now be hidden with @ref glfwHideWindow, shown using @ref
+glfwShowWindow and created initially hidden with the @ref GLFW_VISIBLE window
+hint and attribute. This allows for off-screen rendering in a way compatible
+with most drivers, as well as moving a window to a specific position before
+showing it.
+
+
+@subsubsection news_30_undecorated Undecorated windows
+
+Windowed mode windows can now be created without decorations, e.g. things like
+a frame, a title bar, with the @ref GLFW_DECORATED window hint and attribute.
+This allows for the creation of things like splash screens.
+
+
+@subsubsection news_30_keymods Modifier key bit masks
+
+[Modifier key bit mask](@ref mods) parameters have been added to the
+[mouse button](@ref GLFWmousebuttonfun) and [key](@ref GLFWkeyfun) callbacks.
+
+
+@subsubsection news_30_scancode Platform-specific scancodes
+
+A scancode parameter has been added to the [key callback](@ref GLFWkeyfun). Keys
+that don't have a [key token](@ref keys) still get passed on with the key
+parameter set to `GLFW_KEY_UNKNOWN`. These scancodes will vary between machines
+and are intended to be used for key bindings.
+
+
+@subsubsection news_30_jsname Joystick names
+
+The name of a joystick can now be retrieved using @ref glfwGetJoystickName.
+
+
+@subsubsection news_30_doxygen Doxygen documentation
+
+You are reading it.
+
+*/
diff --git a/extern/glfw/docs/quick.dox b/extern/glfw/docs/quick.dox
new file mode 100644
index 0000000000..3645fc0526
--- /dev/null
+++ b/extern/glfw/docs/quick.dox
@@ -0,0 +1,365 @@
+/*!
+
+@page quick_guide Getting started
+
+@tableofcontents
+
+This guide takes you through writing a simple application using GLFW 3. The
+application will create a window and OpenGL context, render a rotating triangle
+and exit when the user closes the window or presses _Escape_. This guide will
+introduce a few of the most commonly used functions, but there are many more.
+
+This guide assumes no experience with earlier versions of GLFW. If you
+have used GLFW 2 in the past, read @ref moving_guide, as some functions
+behave differently in GLFW 3.
+
+
+@section quick_steps Step by step
+
+@subsection quick_include Including the GLFW header
+
+In the source files of your application where you use GLFW, you need to include
+its header file.
+
+@code
+#include
+@endcode
+
+This header provides all the constants, types and function prototypes of the
+GLFW API.
+
+By default it also includes the OpenGL header from your development environment.
+On some platforms this header only supports older versions of OpenGL. The most
+extreme case is Windows, where it typically only supports OpenGL 1.2.
+
+Most programs will instead use an
+[extension loader library](@ref context_glext_auto) and include its header.
+This example uses files generated by [glad](https://gen.glad.sh/). The GLFW
+header can detect most such headers if they are included first and will then not
+include the one from your development environment.
+
+@code
+#include
+#include
+@endcode
+
+To make sure there will be no header conflicts, you can define @ref
+GLFW_INCLUDE_NONE before the GLFW header to explicitly disable inclusion of the
+development environment header. This also allows the two headers to be included
+in any order.
+
+@code
+#define GLFW_INCLUDE_NONE
+#include
+#include
+@endcode
+
+
+@subsection quick_init_term Initializing and terminating GLFW
+
+Before you can use most GLFW functions, the library must be initialized. On
+successful initialization, `GLFW_TRUE` is returned. If an error occurred,
+`GLFW_FALSE` is returned.
+
+@code
+if (!glfwInit())
+{
+ // Initialization failed
+}
+@endcode
+
+Note that `GLFW_TRUE` and `GLFW_FALSE` are and will always be one and zero.
+
+When you are done using GLFW, typically just before the application exits, you
+need to terminate GLFW.
+
+@code
+glfwTerminate();
+@endcode
+
+This destroys any remaining windows and releases any other resources allocated by
+GLFW. After this call, you must initialize GLFW again before using any GLFW
+functions that require it.
+
+
+@subsection quick_capture_error Setting an error callback
+
+Most events are reported through callbacks, whether it's a key being pressed,
+a GLFW window being moved, or an error occurring. Callbacks are C functions (or
+C++ static methods) that are called by GLFW with arguments describing the event.
+
+In case a GLFW function fails, an error is reported to the GLFW error callback.
+You can receive these reports with an error callback. This function must have
+the signature below but may do anything permitted in other callbacks.
+
+@code
+void error_callback(int error, const char* description)
+{
+ fprintf(stderr, "Error: %s\n", description);
+}
+@endcode
+
+Callback functions must be set, so GLFW knows to call them. The function to set
+the error callback is one of the few GLFW functions that may be called before
+initialization, which lets you be notified of errors both during and after
+initialization.
+
+@code
+glfwSetErrorCallback(error_callback);
+@endcode
+
+
+@subsection quick_create_window Creating a window and context
+
+The window and its OpenGL context are created with a single call to @ref
+glfwCreateWindow, which returns a handle to the created combined window and
+context object
+
+@code
+GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
+if (!window)
+{
+ // Window or OpenGL context creation failed
+}
+@endcode
+
+This creates a 640 by 480 windowed mode window with an OpenGL context. If
+window or OpenGL context creation fails, `NULL` will be returned. You should
+always check the return value. While window creation rarely fails, context
+creation depends on properly installed drivers and may fail even on machines
+with the necessary hardware.
+
+By default, the OpenGL context GLFW creates may have any version. You can
+require a minimum OpenGL version by setting the `GLFW_CONTEXT_VERSION_MAJOR` and
+`GLFW_CONTEXT_VERSION_MINOR` hints _before_ creation. If the required minimum
+version is not supported on the machine, context (and window) creation fails.
+
+@code
+glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
+glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
+GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
+if (!window)
+{
+ // Window or context creation failed
+}
+@endcode
+
+The window handle is passed to all window related functions and is provided to
+along to all window related callbacks, so they can tell which window received
+the event.
+
+When a window and context is no longer needed, destroy it.
+
+@code
+glfwDestroyWindow(window);
+@endcode
+
+Once this function is called, no more events will be delivered for that window
+and its handle becomes invalid.
+
+
+@subsection quick_context_current Making the OpenGL context current
+
+Before you can use the OpenGL API, you must have a current OpenGL context.
+
+@code
+glfwMakeContextCurrent(window);
+@endcode
+
+The context will remain current until you make another context current or until
+the window owning the current context is destroyed.
+
+If you are using an [extension loader library](@ref context_glext_auto) to
+access modern OpenGL then this is when to initialize it, as the loader needs
+a current context to load from. This example uses
+[glad](https://github.com/Dav1dde/glad), but the same rule applies to all such
+libraries.
+
+@code
+gladLoadGL(glfwGetProcAddress);
+@endcode
+
+
+@subsection quick_window_close Checking the window close flag
+
+Each window has a flag indicating whether the window should be closed.
+
+When the user attempts to close the window, either by pressing the close widget
+in the title bar or using a key combination like Alt+F4, this flag is set to 1.
+Note that __the window isn't actually closed__, so you are expected to monitor
+this flag and either destroy the window or give some kind of feedback to the
+user.
+
+@code
+while (!glfwWindowShouldClose(window))
+{
+ // Keep running
+}
+@endcode
+
+You can be notified when the user is attempting to close the window by setting
+a close callback with @ref glfwSetWindowCloseCallback. The callback will be
+called immediately after the close flag has been set.
+
+You can also set it yourself with @ref glfwSetWindowShouldClose. This can be
+useful if you want to interpret other kinds of input as closing the window, like
+for example pressing the _Escape_ key.
+
+
+@subsection quick_key_input Receiving input events
+
+Each window has a large number of callbacks that can be set to receive all the
+various kinds of events. To receive key press and release events, create a key
+callback function.
+
+@code
+static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
+{
+ if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
+ glfwSetWindowShouldClose(window, GLFW_TRUE);
+}
+@endcode
+
+The key callback, like other window related callbacks, are set per-window.
+
+@code
+glfwSetKeyCallback(window, key_callback);
+@endcode
+
+In order for event callbacks to be called when events occur, you need to process
+events as described below.
+
+
+@subsection quick_render Rendering with OpenGL
+
+Once you have a current OpenGL context, you can use OpenGL normally. In this
+tutorial, a multi-colored rotating triangle will be rendered. The framebuffer
+size needs to be retrieved for `glViewport`.
+
+@code
+int width, height;
+glfwGetFramebufferSize(window, &width, &height);
+glViewport(0, 0, width, height);
+@endcode
+
+You can also set a framebuffer size callback using @ref
+glfwSetFramebufferSizeCallback and be notified when the size changes.
+
+The details of how to render with OpenGL is outside the scope of this tutorial,
+but there are many excellent resources for learning modern OpenGL. Here are
+a few of them:
+
+ - [Anton's OpenGL 4 Tutorials](https://antongerdelan.net/opengl/)
+ - [Learn OpenGL](https://learnopengl.com/)
+ - [Open.GL](https://open.gl/)
+
+These all happen to use GLFW, but OpenGL itself works the same whatever API you
+use to create the window and context.
+
+
+@subsection quick_timer Reading the timer
+
+To create smooth animation, a time source is needed. GLFW provides a timer that
+returns the number of seconds since initialization. The time source used is the
+most accurate on each platform and generally has micro- or nanosecond
+resolution.
+
+@code
+double time = glfwGetTime();
+@endcode
+
+
+@subsection quick_swap_buffers Swapping buffers
+
+GLFW windows by default use double buffering. That means that each window has
+two rendering buffers; a front buffer and a back buffer. The front buffer is
+the one being displayed and the back buffer the one you render to.
+
+When the entire frame has been rendered, the buffers need to be swapped with one
+another, so the back buffer becomes the front buffer and vice versa.
+
+@code
+glfwSwapBuffers(window);
+@endcode
+
+The swap interval indicates how many frames to wait until swapping the buffers,
+commonly known as _vsync_. By default, the swap interval is zero, meaning
+buffer swapping will occur immediately. On fast machines, many of those frames
+will never be seen, as the screen is still only updated typically 60-75 times
+per second, so this wastes a lot of CPU and GPU cycles.
+
+Also, because the buffers will be swapped in the middle the screen update,
+leading to [screen tearing](https://en.wikipedia.org/wiki/Screen_tearing).
+
+For these reasons, applications will typically want to set the swap interval to
+one. It can be set to higher values, but this is usually not recommended,
+because of the input latency it leads to.
+
+@code
+glfwSwapInterval(1);
+@endcode
+
+This function acts on the current context and will fail unless a context is
+current.
+
+
+@subsection quick_process_events Processing events
+
+GLFW needs to communicate regularly with the window system both in order to
+receive events and to show that the application hasn't locked up. Event
+processing must be done regularly while you have visible windows and is normally
+done each frame after buffer swapping.
+
+There are two methods for processing pending events; polling and waiting. This
+example will use event polling, which processes only those events that have
+already been received and then returns immediately.
+
+@code
+glfwPollEvents();
+@endcode
+
+This is the best choice when rendering continually, like most games do. If
+instead you only need to update your rendering once you have received new input,
+@ref glfwWaitEvents is a better choice. It waits until at least one event has
+been received, putting the thread to sleep in the meantime, and then processes
+all received events. This saves a great deal of CPU cycles and is useful for,
+for example, many kinds of editing tools.
+
+
+@section quick_example Putting it together
+
+Now that you know how to initialize GLFW, create a window and poll for
+keyboard input, it's possible to create a simple program.
+
+This program creates a 640 by 480 windowed mode window and starts a loop that
+clears the screen, renders a triangle and processes events until the user either
+presses _Escape_ or closes the window.
+
+@snippet simple.c code
+
+The program above can be found in the
+[source package](https://www.glfw.org/download.html) as `examples/simple.c`
+and is compiled along with all other examples when you build GLFW. If you
+built GLFW from the source package then you already have this as `simple.exe` on
+Windows, `simple` on Linux or `simple.app` on macOS.
+
+This tutorial used only a few of the many functions GLFW provides. There are
+guides for each of the areas covered by GLFW. Each guide will introduce all the
+functions for that category.
+
+ - @ref intro_guide
+ - @ref window_guide
+ - @ref context_guide
+ - @ref monitor_guide
+ - @ref input_guide
+
+You can access reference documentation for any GLFW function by clicking it and
+the reference for each function links to related functions and guide sections.
+
+The tutorial ends here. Once you have written a program that uses GLFW, you
+will need to compile and link it. How to do that depends on the development
+environment you are using and is best explained by the documentation for that
+environment. To learn about the details that are specific to GLFW, see
+@ref build_guide.
+
+*/
diff --git a/extern/glfw/docs/spaces.svg b/extern/glfw/docs/spaces.svg
new file mode 100644
index 0000000000..5b32646092
--- /dev/null
+++ b/extern/glfw/docs/spaces.svg
@@ -0,0 +1,877 @@
+
+
+
+
diff --git a/extern/glfw/docs/vulkan.dox b/extern/glfw/docs/vulkan.dox
new file mode 100644
index 0000000000..68e3d5feeb
--- /dev/null
+++ b/extern/glfw/docs/vulkan.dox
@@ -0,0 +1,235 @@
+/*!
+
+@page vulkan_guide Vulkan guide
+
+@tableofcontents
+
+This guide is intended to fill the gaps between the official [Vulkan
+resources](https://www.khronos.org/vulkan/) and the rest of the GLFW
+documentation and is not a replacement for either. It assumes some familiarity
+with Vulkan concepts like loaders, devices, queues and surfaces and leaves it to
+the Vulkan documentation to explain the details of Vulkan functions.
+
+To develop for Vulkan you should download the [LunarG Vulkan
+SDK](https://vulkan.lunarg.com/) for your platform. Apart from headers and link
+libraries, they also provide the validation layers necessary for development.
+
+The [Vulkan Tutorial](https://vulkan-tutorial.com/) has more information on how
+to use GLFW and Vulkan. The [Khronos Vulkan
+Samples](https://github.com/KhronosGroup/Vulkan-Samples) also use GLFW, although
+with a small framework in between.
+
+For details on a specific Vulkan support function, see the @ref vulkan. There
+are also guides for the other areas of the GLFW API.
+
+ - @ref intro_guide
+ - @ref window_guide
+ - @ref context_guide
+ - @ref monitor_guide
+ - @ref input_guide
+
+
+@section vulkan_loader Linking against the Vulkan loader
+
+By default, GLFW will look for the Vulkan loader on demand at runtime via its
+standard name (`vulkan-1.dll` on Windows, `libvulkan.so.1` on Linux and other
+Unix-like systems and `libvulkan.1.dylib` on macOS). This means that GLFW does
+not need to be linked against the loader. However, it also means that if you
+are using the static library form of the Vulkan loader GLFW will either fail to
+find it or (worse) use the wrong one.
+
+The @ref GLFW_VULKAN_STATIC CMake option makes GLFW call the Vulkan loader
+directly instead of dynamically loading it at runtime. Not linking against the
+Vulkan loader will then be a compile-time error.
+
+@macos Because the Vulkan loader and ICD are not installed globally on macOS,
+you need to set up the application bundle according to the LunarG SDK
+documentation. This is explained in more detail in the
+[SDK documentation for macOS](https://vulkan.lunarg.com/doc/sdk/latest/mac/getting_started.html).
+
+
+@section vulkan_include Including the Vulkan and GLFW header files
+
+To include the Vulkan header, define @ref GLFW_INCLUDE_VULKAN before including
+the GLFW header.
+
+@code
+#define GLFW_INCLUDE_VULKAN
+#include
+@endcode
+
+If you instead want to include the Vulkan header from a custom location or use
+your own custom Vulkan header then do this before the GLFW header.
+
+@code
+#include
+#include
+@endcode
+
+Unless a Vulkan header is included, either by the GLFW header or above it, any
+GLFW functions that take or return Vulkan types will not be declared.
+
+The `VK_USE_PLATFORM_*_KHR` macros do not need to be defined for the Vulkan part
+of GLFW to work. Define them only if you are using these extensions directly.
+
+
+@section vulkan_support Querying for Vulkan support
+
+If you are linking directly against the Vulkan loader then you can skip this
+section. The canonical desktop loader library exports all Vulkan core and
+Khronos extension functions, allowing them to be called directly.
+
+If you are loading the Vulkan loader dynamically instead of linking directly
+against it, you can check for the availability of a loader and ICD with @ref
+glfwVulkanSupported.
+
+@code
+if (glfwVulkanSupported())
+{
+ // Vulkan is available, at least for compute
+}
+@endcode
+
+This function returns `GLFW_TRUE` if the Vulkan loader and any minimally
+functional ICD was found.
+
+If one or both were not found, calling any other Vulkan related GLFW function
+will generate a @ref GLFW_API_UNAVAILABLE error.
+
+
+@subsection vulkan_proc Querying Vulkan function pointers
+
+To load any Vulkan core or extension function from the found loader, call @ref
+glfwGetInstanceProcAddress. To load functions needed for instance creation,
+pass `NULL` as the instance.
+
+@code
+PFN_vkCreateInstance pfnCreateInstance = (PFN_vkCreateInstance)
+ glfwGetInstanceProcAddress(NULL, "vkCreateInstance");
+@endcode
+
+Once you have created an instance, you can load from it all other Vulkan core
+functions and functions from any instance extensions you enabled.
+
+@code
+PFN_vkCreateDevice pfnCreateDevice = (PFN_vkCreateDevice)
+ glfwGetInstanceProcAddress(instance, "vkCreateDevice");
+@endcode
+
+This function in turn calls `vkGetInstanceProcAddr`. If that fails, the
+function falls back to a platform-specific query of the Vulkan loader (i.e.
+`dlsym` or `GetProcAddress`). If that also fails, the function returns `NULL`.
+For more information about `vkGetInstanceProcAddr`, see the Vulkan
+documentation.
+
+Vulkan also provides `vkGetDeviceProcAddr` for loading device-specific versions
+of Vulkan function. This function can be retrieved from an instance with @ref
+glfwGetInstanceProcAddress.
+
+@code
+PFN_vkGetDeviceProcAddr pfnGetDeviceProcAddr = (PFN_vkGetDeviceProcAddr)
+ glfwGetInstanceProcAddress(instance, "vkGetDeviceProcAddr");
+@endcode
+
+Device-specific functions may execute a little bit faster, due to not having to
+dispatch internally based on the device passed to them. For more information
+about `vkGetDeviceProcAddr`, see the Vulkan documentation.
+
+
+@section vulkan_ext Querying required Vulkan extensions
+
+To do anything useful with Vulkan you need to create an instance. If you want
+to use Vulkan to render to a window, you must enable the instance extensions
+GLFW requires to create Vulkan surfaces.
+
+To query the instance extensions required, call @ref
+glfwGetRequiredInstanceExtensions.
+
+@code
+uint32_t count;
+const char** extensions = glfwGetRequiredInstanceExtensions(&count);
+@endcode
+
+These extensions must all be enabled when creating instances that are going to
+be passed to @ref glfwGetPhysicalDevicePresentationSupport and @ref
+glfwCreateWindowSurface. The set of extensions will vary depending on platform
+and may also vary depending on graphics drivers and other factors.
+
+If it fails it will return `NULL` and GLFW will not be able to create Vulkan
+window surfaces. You can still use Vulkan for off-screen rendering and compute
+work.
+
+If successful the returned array will always include `VK_KHR_surface`, so if
+you don't require any additional extensions you can pass this list directly to
+the `VkInstanceCreateInfo` struct.
+
+@code
+VkInstanceCreateInfo ici;
+
+memset(&ici, 0, sizeof(ici));
+ici.enabledExtensionCount = count;
+ici.ppEnabledExtensionNames = extensions;
+...
+@endcode
+
+Additional extensions may be required by future versions of GLFW. You should
+check whether any extensions you wish to enable are already in the returned
+array, as it is an error to specify an extension more than once in the
+`VkInstanceCreateInfo` struct.
+
+
+@section vulkan_present Querying for Vulkan presentation support
+
+Not every queue family of every Vulkan device can present images to surfaces.
+To check whether a specific queue family of a physical device supports image
+presentation without first having to create a window and surface, call @ref
+glfwGetPhysicalDevicePresentationSupport.
+
+@code
+if (glfwGetPhysicalDevicePresentationSupport(instance, physical_device, queue_family_index))
+{
+ // Queue family supports image presentation
+}
+@endcode
+
+The `VK_KHR_surface` extension additionally provides the
+`vkGetPhysicalDeviceSurfaceSupportKHR` function, which performs the same test on
+an existing Vulkan surface.
+
+
+@section vulkan_window Creating the window
+
+Unless you will be using OpenGL or OpenGL ES with the same window as Vulkan,
+there is no need to create a context. You can disable context creation with the
+[GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) hint.
+
+@code
+glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
+GLFWwindow* window = glfwCreateWindow(640, 480, "Window Title", NULL, NULL);
+@endcode
+
+See @ref context_less for more information.
+
+
+@section vulkan_surface Creating a Vulkan window surface
+
+You can create a Vulkan surface (as defined by the `VK_KHR_surface` extension)
+for a GLFW window with @ref glfwCreateWindowSurface.
+
+@code
+VkSurfaceKHR surface;
+VkResult err = glfwCreateWindowSurface(instance, window, NULL, &surface);
+if (err)
+{
+ // Window surface creation failed
+}
+@endcode
+
+If an OpenGL or OpenGL ES context was created on the window, the context has
+ownership of the presentation on the window and a Vulkan surface cannot be
+created.
+
+It is your responsibility to destroy the surface. GLFW does not destroy it for
+you. Call `vkDestroySurfaceKHR` function from the same extension to destroy it.
+
+*/
diff --git a/extern/glfw/docs/window.dox b/extern/glfw/docs/window.dox
new file mode 100644
index 0000000000..2fcf11f892
--- /dev/null
+++ b/extern/glfw/docs/window.dox
@@ -0,0 +1,1412 @@
+/*!
+
+@page window_guide Window guide
+
+@tableofcontents
+
+This guide introduces the window related functions of GLFW. For details on
+a specific function in this category, see the @ref window. There are also
+guides for the other areas of GLFW.
+
+ - @ref intro_guide
+ - @ref context_guide
+ - @ref vulkan_guide
+ - @ref monitor_guide
+ - @ref input_guide
+
+
+@section window_object Window objects
+
+The @ref GLFWwindow object encapsulates both a window and a context. They are
+created with @ref glfwCreateWindow and destroyed with @ref glfwDestroyWindow, or
+@ref glfwTerminate, if any remain. As the window and context are inseparably
+linked, the object pointer is used as both a context and window handle.
+
+To see the event stream provided to the various window related callbacks, run
+the `events` test program.
+
+
+@subsection window_creation Window creation
+
+A window and its OpenGL or OpenGL ES context are created with @ref
+glfwCreateWindow, which returns a handle to the created window object. For
+example, this creates a 640 by 480 windowed mode window:
+
+@code
+GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
+@endcode
+
+If window creation fails, `NULL` will be returned, so it is necessary to check
+the return value.
+
+The window handle is passed to all window related functions and is provided to
+along with all input events, so event handlers can tell which window received
+the event.
+
+
+@subsubsection window_full_screen Full screen windows
+
+To create a full screen window, you need to specify which monitor the window
+should use. In most cases, the user's primary monitor is a good choice.
+For more information about retrieving monitors, see @ref monitor_monitors.
+
+@code
+GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", glfwGetPrimaryMonitor(), NULL);
+@endcode
+
+Full screen windows cover the entire display area of a monitor, have no border
+or decorations.
+
+Windowed mode windows can be made full screen by setting a monitor with @ref
+glfwSetWindowMonitor, and full screen ones can be made windowed by unsetting it
+with the same function.
+
+Each field of the @ref GLFWvidmode structure corresponds to a function parameter
+or window hint and combine to form the _desired video mode_ for that window.
+The supported video mode most closely matching the desired video mode will be
+set for the chosen monitor as long as the window has input focus. For more
+information about retrieving video modes, see @ref monitor_modes.
+
+Video mode field | Corresponds to
+---------------- | --------------
+GLFWvidmode.width | `width` parameter of @ref glfwCreateWindow
+GLFWvidmode.height | `height` parameter of @ref glfwCreateWindow
+GLFWvidmode.redBits | @ref GLFW_RED_BITS hint
+GLFWvidmode.greenBits | @ref GLFW_GREEN_BITS hint
+GLFWvidmode.blueBits | @ref GLFW_BLUE_BITS hint
+GLFWvidmode.refreshRate | @ref GLFW_REFRESH_RATE hint
+
+Once you have a full screen window, you can change its resolution, refresh rate
+and monitor with @ref glfwSetWindowMonitor. If you only need change its
+resolution you can also call @ref glfwSetWindowSize. In all cases, the new
+video mode will be selected the same way as the video mode chosen by @ref
+glfwCreateWindow. If the window has an OpenGL or OpenGL ES context, it will be
+unaffected.
+
+By default, the original video mode of the monitor will be restored and the
+window iconified if it loses input focus, to allow the user to switch back to
+the desktop. This behavior can be disabled with the
+[GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_hint) window hint, for example if you
+wish to simultaneously cover multiple monitors with full screen windows.
+
+If a monitor is disconnected, all windows that are full screen on that monitor
+will be switched to windowed mode. See @ref monitor_event for more information.
+
+
+@subsubsection window_windowed_full_screen "Windowed full screen" windows
+
+If the closest match for the desired video mode is the current one, the video
+mode will not be changed, making window creation faster and application
+switching much smoother. This is sometimes called _windowed full screen_ or
+_borderless full screen_ window and counts as a full screen window. To create
+such a window, request the current video mode.
+
+@code
+const GLFWvidmode* mode = glfwGetVideoMode(monitor);
+
+glfwWindowHint(GLFW_RED_BITS, mode->redBits);
+glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits);
+glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits);
+glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate);
+
+GLFWwindow* window = glfwCreateWindow(mode->width, mode->height, "My Title", monitor, NULL);
+@endcode
+
+This also works for windowed mode windows that are made full screen.
+
+@code
+const GLFWvidmode* mode = glfwGetVideoMode(monitor);
+
+glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate);
+@endcode
+
+Note that @ref glfwGetVideoMode returns the _current_ video mode of a monitor,
+so if you already have a full screen window on that monitor that you want to
+make windowed full screen, you need to have saved the desktop resolution before.
+
+
+@subsection window_destruction Window destruction
+
+When a window is no longer needed, destroy it with @ref glfwDestroyWindow.
+
+@code
+glfwDestroyWindow(window);
+@endcode
+
+Window destruction always succeeds. Before the actual destruction, all
+callbacks are removed so no further events will be delivered for the window.
+All windows remaining when @ref glfwTerminate is called are destroyed as well.
+
+When a full screen window is destroyed, the original video mode of its monitor
+is restored, but the gamma ramp is left untouched.
+
+
+@subsection window_hints Window creation hints
+
+There are a number of hints that can be set before the creation of a window and
+context. Some affect the window itself, others affect the framebuffer or
+context. These hints are set to their default values each time the library is
+initialized with @ref glfwInit. Integer value hints can be set individually
+with @ref glfwWindowHint and string value hints with @ref glfwWindowHintString.
+You can reset all at once to their defaults with @ref glfwDefaultWindowHints.
+
+Some hints are platform specific. These are always valid to set on any
+platform but they will only affect their specific platform. Other platforms
+will ignore them. Setting these hints requires no platform specific headers or
+calls.
+
+@note Window hints need to be set before the creation of the window and context
+you wish to have the specified attributes. They function as additional
+arguments to @ref glfwCreateWindow.
+
+
+@subsubsection window_hints_hard Hard and soft constraints
+
+Some window hints are hard constraints. These must match the available
+capabilities _exactly_ for window and context creation to succeed. Hints
+that are not hard constraints are matched as closely as possible, but the
+resulting context and framebuffer may differ from what these hints requested.
+
+The following hints are always hard constraints:
+- @ref GLFW_STEREO
+- @ref GLFW_DOUBLEBUFFER
+- [GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint)
+- [GLFW_CONTEXT_CREATION_API](@ref GLFW_CONTEXT_CREATION_API_hint)
+
+The following additional hints are hard constraints when requesting an OpenGL
+context, but are ignored when requesting an OpenGL ES context:
+- [GLFW_OPENGL_FORWARD_COMPAT](@ref GLFW_OPENGL_FORWARD_COMPAT_hint)
+- [GLFW_OPENGL_PROFILE](@ref GLFW_OPENGL_PROFILE_hint)
+
+
+@subsubsection window_hints_wnd Window related hints
+
+@anchor GLFW_RESIZABLE_hint
+__GLFW_RESIZABLE__ specifies whether the windowed mode window will be resizable
+_by the user_. The window will still be resizable using the @ref
+glfwSetWindowSize function. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+This hint is ignored for full screen and undecorated windows.
+
+@anchor GLFW_VISIBLE_hint
+__GLFW_VISIBLE__ specifies whether the windowed mode window will be initially
+visible. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This hint is
+ignored for full screen windows.
+
+@anchor GLFW_DECORATED_hint
+__GLFW_DECORATED__ specifies whether the windowed mode window will have window
+decorations such as a border, a close widget, etc. An undecorated window will
+not be resizable by the user but will still allow the user to generate close
+events on some platforms. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+This hint is ignored for full screen windows.
+
+@anchor GLFW_FOCUSED_hint
+__GLFW_FOCUSED__ specifies whether the windowed mode window will be given input
+focus when created. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This
+hint is ignored for full screen and initially hidden windows.
+
+@anchor GLFW_AUTO_ICONIFY_hint
+__GLFW_AUTO_ICONIFY__ specifies whether the full screen window will
+automatically iconify and restore the previous video mode on input focus loss.
+Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This hint is ignored for
+windowed mode windows.
+
+@anchor GLFW_FLOATING_hint
+__GLFW_FLOATING__ specifies whether the windowed mode window will be floating
+above other regular windows, also called topmost or always-on-top. This is
+intended primarily for debugging purposes and cannot be used to implement proper
+full screen windows. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This
+hint is ignored for full screen windows.
+
+@anchor GLFW_MAXIMIZED_hint
+__GLFW_MAXIMIZED__ specifies whether the windowed mode window will be maximized
+when created. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This hint is
+ignored for full screen windows.
+
+@anchor GLFW_CENTER_CURSOR_hint
+__GLFW_CENTER_CURSOR__ specifies whether the cursor should be centered over
+newly created full screen windows. Possible values are `GLFW_TRUE` and
+`GLFW_FALSE`. This hint is ignored for windowed mode windows.
+
+@anchor GLFW_TRANSPARENT_FRAMEBUFFER_hint
+__GLFW_TRANSPARENT_FRAMEBUFFER__ specifies whether the window framebuffer will
+be transparent. If enabled and supported by the system, the window framebuffer
+alpha channel will be used to combine the framebuffer with the background. This
+does not affect window decorations. Possible values are `GLFW_TRUE` and
+`GLFW_FALSE`.
+
+@anchor GLFW_FOCUS_ON_SHOW_hint
+__GLFW_FOCUS_ON_SHOW__ specifies whether the window will be given input
+focus when @ref glfwShowWindow is called. Possible values are `GLFW_TRUE` and
+`GLFW_FALSE`.
+
+@anchor GLFW_SCALE_TO_MONITOR
+__GLFW_SCALE_TO_MONITOR__ specified whether the window content area should be
+resized based on the [monitor content scale](@ref monitor_scale) of any monitor
+it is placed on. This includes the initial placement when the window is
+created. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+
+This hint only has an effect on platforms where screen coordinates and pixels
+always map 1:1 such as Windows and X11. On platforms like macOS the resolution
+of the framebuffer is changed independently of the window size.
+
+
+@subsubsection window_hints_fb Framebuffer related hints
+
+@anchor GLFW_RED_BITS
+@anchor GLFW_GREEN_BITS
+@anchor GLFW_BLUE_BITS
+@anchor GLFW_ALPHA_BITS
+@anchor GLFW_DEPTH_BITS
+@anchor GLFW_STENCIL_BITS
+__GLFW_RED_BITS__, __GLFW_GREEN_BITS__, __GLFW_BLUE_BITS__, __GLFW_ALPHA_BITS__,
+__GLFW_DEPTH_BITS__ and __GLFW_STENCIL_BITS__ specify the desired bit depths of
+the various components of the default framebuffer. A value of `GLFW_DONT_CARE`
+means the application has no preference.
+
+@anchor GLFW_ACCUM_RED_BITS
+@anchor GLFW_ACCUM_GREEN_BITS
+@anchor GLFW_ACCUM_BLUE_BITS
+@anchor GLFW_ACCUM_ALPHA_BITS
+__GLFW_ACCUM_RED_BITS__, __GLFW_ACCUM_GREEN_BITS__, __GLFW_ACCUM_BLUE_BITS__ and
+__GLFW_ACCUM_ALPHA_BITS__ specify the desired bit depths of the various
+components of the accumulation buffer. A value of `GLFW_DONT_CARE` means the
+application has no preference.
+
+Accumulation buffers are a legacy OpenGL feature and should not be used in new
+code.
+
+@anchor GLFW_AUX_BUFFERS
+__GLFW_AUX_BUFFERS__ specifies the desired number of auxiliary buffers. A value
+of `GLFW_DONT_CARE` means the application has no preference.
+
+Auxiliary buffers are a legacy OpenGL feature and should not be used in new
+code.
+
+@anchor GLFW_STEREO
+__GLFW_STEREO__ specifies whether to use OpenGL stereoscopic rendering.
+Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This is a hard constraint.
+
+@anchor GLFW_SAMPLES
+__GLFW_SAMPLES__ specifies the desired number of samples to use for
+multisampling. Zero disables multisampling. A value of `GLFW_DONT_CARE` means
+the application has no preference.
+
+@anchor GLFW_SRGB_CAPABLE
+__GLFW_SRGB_CAPABLE__ specifies whether the framebuffer should be sRGB capable.
+Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+
+@note __OpenGL:__ If enabled and supported by the system, the
+`GL_FRAMEBUFFER_SRGB` enable will control sRGB rendering. By default, sRGB
+rendering will be disabled.
+
+@note __OpenGL ES:__ If enabled and supported by the system, the context will
+always have sRGB rendering enabled.
+
+@anchor GLFW_DOUBLEBUFFER
+__GLFW_DOUBLEBUFFER__ specifies whether the framebuffer should be double
+buffered. You nearly always want to use double buffering. This is a hard
+constraint. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+
+
+@subsubsection window_hints_mtr Monitor related hints
+
+@anchor GLFW_REFRESH_RATE
+__GLFW_REFRESH_RATE__ specifies the desired refresh rate for full screen
+windows. A value of `GLFW_DONT_CARE` means the highest available refresh rate
+will be used. This hint is ignored for windowed mode windows.
+
+
+@subsubsection window_hints_ctx Context related hints
+
+@anchor GLFW_CLIENT_API_hint
+__GLFW_CLIENT_API__ specifies which client API to create the context for.
+Possible values are `GLFW_OPENGL_API`, `GLFW_OPENGL_ES_API` and `GLFW_NO_API`.
+This is a hard constraint.
+
+@anchor GLFW_CONTEXT_CREATION_API_hint
+__GLFW_CONTEXT_CREATION_API__ specifies which context creation API to use to
+create the context. Possible values are `GLFW_NATIVE_CONTEXT_API`,
+`GLFW_EGL_CONTEXT_API` and `GLFW_OSMESA_CONTEXT_API`. This is a hard
+constraint. If no client API is requested, this hint is ignored.
+
+An [extension loader library](@ref context_glext_auto) that assumes it knows
+which API was used to create the current context may fail if you change this
+hint. This can be resolved by having it load functions via @ref
+glfwGetProcAddress.
+
+@note @wayland The EGL API _is_ the native context creation API, so this hint
+will have no effect.
+
+@note @x11 On some Linux systems, creating contexts via both the native and EGL
+APIs in a single process will cause the application to segfault. Stick to one
+API or the other on Linux for now.
+
+@note __OSMesa:__ As its name implies, an OpenGL context created with OSMesa
+does not update the window contents when its buffers are swapped. Use OpenGL
+functions or the OSMesa native access functions @ref glfwGetOSMesaColorBuffer
+and @ref glfwGetOSMesaDepthBuffer to retrieve the framebuffer contents.
+
+@anchor GLFW_CONTEXT_VERSION_MAJOR_hint
+@anchor GLFW_CONTEXT_VERSION_MINOR_hint
+__GLFW_CONTEXT_VERSION_MAJOR__ and __GLFW_CONTEXT_VERSION_MINOR__ specify the
+client API version that the created context must be compatible with. The exact
+behavior of these hints depend on the requested client API.
+
+While there is no way to ask the driver for a context of the highest supported
+version, GLFW will attempt to provide this when you ask for a version 1.0
+context, which is the default for these hints.
+
+Do not confuse these hints with @ref GLFW_VERSION_MAJOR and @ref
+GLFW_VERSION_MINOR, which provide the API version of the GLFW header.
+
+@note __OpenGL:__ These hints are not hard constraints, but creation will fail
+if the OpenGL version of the created context is less than the one requested. It
+is therefore perfectly safe to use the default of version 1.0 for legacy code
+and you will still get backwards-compatible contexts of version 3.0 and above
+when available.
+
+@note __OpenGL ES:__ These hints are not hard constraints, but creation will
+fail if the OpenGL ES version of the created context is less than the one
+requested. Additionally, OpenGL ES 1.x cannot be returned if 2.0 or later was
+requested, and vice versa. This is because OpenGL ES 3.x is backward compatible
+with 2.0, but OpenGL ES 2.0 is not backward compatible with 1.x.
+
+@note @macos The OS only supports forward-compatible core profile contexts for
+OpenGL versions 3.2 and later. Before creating an OpenGL context of version
+3.2 or later you must set the
+[GLFW_OPENGL_FORWARD_COMPAT](@ref GLFW_OPENGL_FORWARD_COMPAT_hint) and
+[GLFW_OPENGL_PROFILE](@ref GLFW_OPENGL_PROFILE_hint) hints accordingly. OpenGL
+3.0 and 3.1 contexts are not supported at all on macOS.
+
+@anchor GLFW_OPENGL_FORWARD_COMPAT_hint
+__GLFW_OPENGL_FORWARD_COMPAT__ specifies whether the OpenGL context should be
+forward-compatible, i.e. one where all functionality deprecated in the requested
+version of OpenGL is removed. This must only be used if the requested OpenGL
+version is 3.0 or above. If OpenGL ES is requested, this hint is ignored.
+
+Forward-compatibility is described in detail in the
+[OpenGL Reference Manual](https://www.opengl.org/registry/).
+
+@anchor GLFW_OPENGL_DEBUG_CONTEXT_hint
+__GLFW_OPENGL_DEBUG_CONTEXT__ specifies whether the context should be created
+in debug mode, which may provide additional error and diagnostic reporting
+functionality. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+
+Debug contexts for OpenGL and OpenGL ES are described in detail by the
+[GL_KHR_debug](https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_debug.txt)
+extension.
+
+@anchor GLFW_OPENGL_PROFILE_hint
+__GLFW_OPENGL_PROFILE__ specifies which OpenGL profile to create the context
+for. Possible values are one of `GLFW_OPENGL_CORE_PROFILE` or
+`GLFW_OPENGL_COMPAT_PROFILE`, or `GLFW_OPENGL_ANY_PROFILE` to not request
+a specific profile. If requesting an OpenGL version below 3.2,
+`GLFW_OPENGL_ANY_PROFILE` must be used. If OpenGL ES is requested, this hint
+is ignored.
+
+OpenGL profiles are described in detail in the
+[OpenGL Reference Manual](https://www.opengl.org/registry/).
+
+@anchor GLFW_CONTEXT_ROBUSTNESS_hint
+__GLFW_CONTEXT_ROBUSTNESS__ specifies the robustness strategy to be used by the
+context. This can be one of `GLFW_NO_RESET_NOTIFICATION` or
+`GLFW_LOSE_CONTEXT_ON_RESET`, or `GLFW_NO_ROBUSTNESS` to not request
+a robustness strategy.
+
+@anchor GLFW_CONTEXT_RELEASE_BEHAVIOR_hint
+__GLFW_CONTEXT_RELEASE_BEHAVIOR__ specifies the release behavior to be
+used by the context. Possible values are one of `GLFW_ANY_RELEASE_BEHAVIOR`,
+`GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`. If the
+behavior is `GLFW_ANY_RELEASE_BEHAVIOR`, the default behavior of the context
+creation API will be used. If the behavior is `GLFW_RELEASE_BEHAVIOR_FLUSH`,
+the pipeline will be flushed whenever the context is released from being the
+current one. If the behavior is `GLFW_RELEASE_BEHAVIOR_NONE`, the pipeline will
+not be flushed on release.
+
+Context release behaviors are described in detail by the
+[GL_KHR_context_flush_control](https://www.opengl.org/registry/specs/KHR/context_flush_control.txt)
+extension.
+
+@anchor GLFW_CONTEXT_NO_ERROR_hint
+__GLFW_CONTEXT_NO_ERROR__ specifies whether errors should be generated by the
+context. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. If enabled,
+situations that would have generated errors instead cause undefined behavior.
+
+The no error mode for OpenGL and OpenGL ES is described in detail by the
+[GL_KHR_no_error](https://www.opengl.org/registry/specs/KHR/no_error.txt)
+extension.
+
+
+@subsubsection window_hints_osx macOS specific window hints
+
+@anchor GLFW_COCOA_RETINA_FRAMEBUFFER_hint
+__GLFW_COCOA_RETINA_FRAMEBUFFER__ specifies whether to use full resolution
+framebuffers on Retina displays. Possible values are `GLFW_TRUE` and
+`GLFW_FALSE`. This is ignored on other platforms.
+
+@anchor GLFW_COCOA_FRAME_NAME_hint
+__GLFW_COCOA_FRAME_NAME__ specifies the UTF-8 encoded name to use for autosaving
+the window frame, or if empty disables frame autosaving for the window. This is
+ignored on other platforms. This is set with @ref glfwWindowHintString.
+
+@anchor GLFW_COCOA_GRAPHICS_SWITCHING_hint
+__GLFW_COCOA_GRAPHICS_SWITCHING__ specifies whether to in Automatic Graphics
+Switching, i.e. to allow the system to choose the integrated GPU for the OpenGL
+context and move it between GPUs if necessary or whether to force it to always
+run on the discrete GPU. This only affects systems with both integrated and
+discrete GPUs. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This is
+ignored on other platforms.
+
+Simpler programs and tools may want to enable this to save power, while games
+and other applications performing advanced rendering will want to leave it
+disabled.
+
+A bundled application that wishes to participate in Automatic Graphics Switching
+should also declare this in its `Info.plist` by setting the
+`NSSupportsAutomaticGraphicsSwitching` key to `true`.
+
+
+@subsubsection window_hints_x11 X11 specific window hints
+
+@anchor GLFW_X11_CLASS_NAME_hint
+@anchor GLFW_X11_INSTANCE_NAME_hint
+__GLFW_X11_CLASS_NAME__ and __GLFW_X11_INSTANCE_NAME__ specifies the desired
+ASCII encoded class and instance parts of the ICCCM `WM_CLASS` window property.
+These are set with @ref glfwWindowHintString.
+
+
+@subsubsection window_hints_values Supported and default values
+
+Window hint | Default value | Supported values
+----------------------------- | --------------------------- | ----------------
+GLFW_RESIZABLE | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_VISIBLE | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_DECORATED | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_FOCUSED | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_AUTO_ICONIFY | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_FLOATING | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_MAXIMIZED | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_CENTER_CURSOR | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_TRANSPARENT_FRAMEBUFFER | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_FOCUS_ON_SHOW | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_SCALE_TO_MONITOR | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_RED_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_GREEN_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_BLUE_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_ALPHA_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_DEPTH_BITS | 24 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_STENCIL_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_ACCUM_RED_BITS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_ACCUM_GREEN_BITS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_ACCUM_BLUE_BITS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_ACCUM_ALPHA_BITS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_AUX_BUFFERS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_SAMPLES | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_REFRESH_RATE | `GLFW_DONT_CARE` | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_STEREO | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_SRGB_CAPABLE | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_DOUBLEBUFFER | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_CLIENT_API | `GLFW_OPENGL_API` | `GLFW_OPENGL_API`, `GLFW_OPENGL_ES_API` or `GLFW_NO_API`
+GLFW_CONTEXT_CREATION_API | `GLFW_NATIVE_CONTEXT_API` | `GLFW_NATIVE_CONTEXT_API`, `GLFW_EGL_CONTEXT_API` or `GLFW_OSMESA_CONTEXT_API`
+GLFW_CONTEXT_VERSION_MAJOR | 1 | Any valid major version number of the chosen client API
+GLFW_CONTEXT_VERSION_MINOR | 0 | Any valid minor version number of the chosen client API
+GLFW_CONTEXT_ROBUSTNESS | `GLFW_NO_ROBUSTNESS` | `GLFW_NO_ROBUSTNESS`, `GLFW_NO_RESET_NOTIFICATION` or `GLFW_LOSE_CONTEXT_ON_RESET`
+GLFW_CONTEXT_RELEASE_BEHAVIOR | `GLFW_ANY_RELEASE_BEHAVIOR` | `GLFW_ANY_RELEASE_BEHAVIOR`, `GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`
+GLFW_OPENGL_FORWARD_COMPAT | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_OPENGL_DEBUG_CONTEXT | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_OPENGL_PROFILE | `GLFW_OPENGL_ANY_PROFILE` | `GLFW_OPENGL_ANY_PROFILE`, `GLFW_OPENGL_COMPAT_PROFILE` or `GLFW_OPENGL_CORE_PROFILE`
+GLFW_COCOA_RETINA_FRAMEBUFFER | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_COCOA_FRAME_NAME | `""` | A UTF-8 encoded frame autosave name
+GLFW_COCOA_GRAPHICS_SWITCHING | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_X11_CLASS_NAME | `""` | An ASCII encoded `WM_CLASS` class name
+GLFW_X11_INSTANCE_NAME | `""` | An ASCII encoded `WM_CLASS` instance name
+
+
+@section window_events Window event processing
+
+See @ref events.
+
+
+@section window_properties Window properties and events
+
+@subsection window_userptr User pointer
+
+Each window has a user pointer that can be set with @ref
+glfwSetWindowUserPointer and queried with @ref glfwGetWindowUserPointer. This
+can be used for any purpose you need and will not be modified by GLFW throughout
+the life-time of the window.
+
+The initial value of the pointer is `NULL`.
+
+
+@subsection window_close Window closing and close flag
+
+When the user attempts to close the window, for example by clicking the close
+widget or using a key chord like Alt+F4, the _close flag_ of the window is set.
+The window is however not actually destroyed and, unless you watch for this
+state change, nothing further happens.
+
+The current state of the close flag is returned by @ref glfwWindowShouldClose
+and can be set or cleared directly with @ref glfwSetWindowShouldClose. A common
+pattern is to use the close flag as a main loop condition.
+
+@code
+while (!glfwWindowShouldClose(window))
+{
+ render(window);
+
+ glfwSwapBuffers(window);
+ glfwPollEvents();
+}
+@endcode
+
+If you wish to be notified when the user attempts to close a window, set a close
+callback.
+
+@code
+glfwSetWindowCloseCallback(window, window_close_callback);
+@endcode
+
+The callback function is called directly _after_ the close flag has been set.
+It can be used for example to filter close requests and clear the close flag
+again unless certain conditions are met.
+
+@code
+void window_close_callback(GLFWwindow* window)
+{
+ if (!time_to_close)
+ glfwSetWindowShouldClose(window, GLFW_FALSE);
+}
+@endcode
+
+
+@subsection window_size Window size
+
+The size of a window can be changed with @ref glfwSetWindowSize. For windowed
+mode windows, this sets the size, in
+[screen coordinates](@ref coordinate_systems) of the _content area_ or _content
+area_ of the window. The window system may impose limits on window size.
+
+@code
+glfwSetWindowSize(window, 640, 480);
+@endcode
+
+For full screen windows, the specified size becomes the new resolution of the
+window's desired video mode. The video mode most closely matching the new
+desired video mode is set immediately. The window is resized to fit the
+resolution of the set video mode.
+
+If you wish to be notified when a window is resized, whether by the user, the
+system or your own code, set a size callback.
+
+@code
+glfwSetWindowSizeCallback(window, window_size_callback);
+@endcode
+
+The callback function receives the new size, in screen coordinates, of the
+content area of the window when the window is resized.
+
+@code
+void window_size_callback(GLFWwindow* window, int width, int height)
+{
+}
+@endcode
+
+There is also @ref glfwGetWindowSize for directly retrieving the current size of
+a window.
+
+@code
+int width, height;
+glfwGetWindowSize(window, &width, &height);
+@endcode
+
+@note Do not pass the window size to `glViewport` or other pixel-based OpenGL
+calls. The window size is in screen coordinates, not pixels. Use the
+[framebuffer size](@ref window_fbsize), which is in pixels, for pixel-based
+calls.
+
+The above functions work with the size of the content area, but decorated
+windows typically have title bars and window frames around this rectangle. You
+can retrieve the extents of these with @ref glfwGetWindowFrameSize.
+
+@code
+int left, top, right, bottom;
+glfwGetWindowFrameSize(window, &left, &top, &right, &bottom);
+@endcode
+
+The returned values are the distances, in screen coordinates, from the edges of
+the content area to the corresponding edges of the full window. As they are
+distances and not coordinates, they are always zero or positive.
+
+
+@subsection window_fbsize Framebuffer size
+
+While the size of a window is measured in screen coordinates, OpenGL works with
+pixels. The size you pass into `glViewport`, for example, should be in pixels.
+On some machines screen coordinates and pixels are the same, but on others they
+will not be. There is a second set of functions to retrieve the size, in
+pixels, of the framebuffer of a window.
+
+If you wish to be notified when the framebuffer of a window is resized, whether
+by the user or the system, set a size callback.
+
+@code
+glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
+@endcode
+
+The callback function receives the new size of the framebuffer when it is
+resized, which can for example be used to update the OpenGL viewport.
+
+@code
+void framebuffer_size_callback(GLFWwindow* window, int width, int height)
+{
+ glViewport(0, 0, width, height);
+}
+@endcode
+
+There is also @ref glfwGetFramebufferSize for directly retrieving the current
+size of the framebuffer of a window.
+
+@code
+int width, height;
+glfwGetFramebufferSize(window, &width, &height);
+glViewport(0, 0, width, height);
+@endcode
+
+The size of a framebuffer may change independently of the size of a window, for
+example if the window is dragged between a regular monitor and a high-DPI one.
+
+
+@subsection window_scale Window content scale
+
+The content scale for a window can be retrieved with @ref
+glfwGetWindowContentScale.
+
+@code
+float xscale, yscale;
+glfwGetWindowContentScale(window, &xscale, &yscale);
+@endcode
+
+The content scale is the ratio between the current DPI and the platform's
+default DPI. This is especially important for text and any UI elements. If the
+pixel dimensions of your UI scaled by this look appropriate on your machine then
+it should appear at a reasonable size on other machines regardless of their DPI
+and scaling settings. This relies on the system DPI and scaling settings being
+somewhat correct.
+
+On systems where each monitors can have its own content scale, the window
+content scale will depend on which monitor the system considers the window to be
+on.
+
+If you wish to be notified when the content scale of a window changes, whether
+because of a system setting change or because it was moved to a monitor with
+a different scale, set a content scale callback.
+
+@code
+glfwSetWindowContentScaleCallback(window, window_content_scale_callback);
+@endcode
+
+The callback function receives the new content scale of the window.
+
+@code
+void window_content_scale_callback(GLFWwindow* window, float xscale, float yscale)
+{
+ set_interface_scale(xscale, yscale);
+}
+@endcode
+
+On platforms where pixels and screen coordinates always map 1:1, the window
+will need to be resized to appear the same size when it is moved to a monitor
+with a different content scale. To have this done automatically both when the
+window is created and when its content scale later changes, set the @ref
+GLFW_SCALE_TO_MONITOR window hint.
+
+
+@subsection window_sizelimits Window size limits
+
+The minimum and maximum size of the content area of a windowed mode window can
+be enforced with @ref glfwSetWindowSizeLimits. The user may resize the window
+to any size and aspect ratio within the specified limits, unless the aspect
+ratio is also set.
+
+@code
+glfwSetWindowSizeLimits(window, 200, 200, 400, 400);
+@endcode
+
+To specify only a minimum size or only a maximum one, set the other pair to
+`GLFW_DONT_CARE`.
+
+@code
+glfwSetWindowSizeLimits(window, 640, 480, GLFW_DONT_CARE, GLFW_DONT_CARE);
+@endcode
+
+To disable size limits for a window, set them all to `GLFW_DONT_CARE`.
+
+The aspect ratio of the content area of a windowed mode window can be enforced
+with @ref glfwSetWindowAspectRatio. The user may resize the window freely
+unless size limits are also set, but the size will be constrained to maintain
+the aspect ratio.
+
+@code
+glfwSetWindowAspectRatio(window, 16, 9);
+@endcode
+
+The aspect ratio is specified as a numerator and denominator, corresponding to
+the width and height, respectively. If you want a window to maintain its
+current aspect ratio, use its current size as the ratio.
+
+@code
+int width, height;
+glfwGetWindowSize(window, &width, &height);
+glfwSetWindowAspectRatio(window, width, height);
+@endcode
+
+To disable the aspect ratio limit for a window, set both terms to
+`GLFW_DONT_CARE`.
+
+You can have both size limits and aspect ratio set for a window, but the results
+are undefined if they conflict.
+
+
+@subsection window_pos Window position
+
+The position of a windowed-mode window can be changed with @ref
+glfwSetWindowPos. This moves the window so that the upper-left corner of its
+content area has the specified [screen coordinates](@ref coordinate_systems).
+The window system may put limitations on window placement.
+
+@code
+glfwSetWindowPos(window, 100, 100);
+@endcode
+
+If you wish to be notified when a window is moved, whether by the user, the
+system or your own code, set a position callback.
+
+@code
+glfwSetWindowPosCallback(window, window_pos_callback);
+@endcode
+
+The callback function receives the new position, in screen coordinates, of the
+upper-left corner of the content area when the window is moved.
+
+@code
+void window_pos_callback(GLFWwindow* window, int xpos, int ypos)
+{
+}
+@endcode
+
+There is also @ref glfwGetWindowPos for directly retrieving the current position
+of the content area of the window.
+
+@code
+int xpos, ypos;
+glfwGetWindowPos(window, &xpos, &ypos);
+@endcode
+
+
+@subsection window_title Window title
+
+All GLFW windows have a title, although undecorated or full screen windows may
+not display it or only display it in a task bar or similar interface. You can
+set a UTF-8 encoded window title with @ref glfwSetWindowTitle.
+
+@code
+glfwSetWindowTitle(window, "My Window");
+@endcode
+
+The specified string is copied before the function returns, so there is no need
+to keep it around.
+
+As long as your source file is encoded as UTF-8, you can use any Unicode
+characters directly in the source.
+
+@code
+glfwSetWindowTitle(window, "ラストエグザイル");
+@endcode
+
+If you are using C++11 or C11, you can use a UTF-8 string literal.
+
+@code
+glfwSetWindowTitle(window, u8"This is always a UTF-8 string");
+@endcode
+
+
+@subsection window_icon Window icon
+
+Decorated windows have icons on some platforms. You can set this icon by
+specifying a list of candidate images with @ref glfwSetWindowIcon.
+
+@code
+GLFWimage images[2];
+images[0] = load_icon("my_icon.png");
+images[1] = load_icon("my_icon_small.png");
+
+glfwSetWindowIcon(window, 2, images);
+@endcode
+
+The image data is 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits
+per channel with the red channel first. The pixels are arranged canonically as
+sequential rows, starting from the top-left corner.
+
+To revert to the default window icon, pass in an empty image array.
+
+@code
+glfwSetWindowIcon(window, 0, NULL);
+@endcode
+
+
+@subsection window_monitor Window monitor
+
+Full screen windows are associated with a specific monitor. You can get the
+handle for this monitor with @ref glfwGetWindowMonitor.
+
+@code
+GLFWmonitor* monitor = glfwGetWindowMonitor(window);
+@endcode
+
+This monitor handle is one of those returned by @ref glfwGetMonitors.
+
+For windowed mode windows, this function returns `NULL`. This is how to tell
+full screen windows from windowed mode windows.
+
+You can move windows between monitors or between full screen and windowed mode
+with @ref glfwSetWindowMonitor. When making a window full screen on the same or
+on a different monitor, specify the desired monitor, resolution and refresh
+rate. The position arguments are ignored.
+
+@code
+const GLFWvidmode* mode = glfwGetVideoMode(monitor);
+
+glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate);
+@endcode
+
+When making the window windowed, specify the desired position and size. The
+refresh rate argument is ignored.
+
+@code
+glfwSetWindowMonitor(window, NULL, xpos, ypos, width, height, 0);
+@endcode
+
+This restores any previous window settings such as whether it is decorated,
+floating, resizable, has size or aspect ratio limits, etc.. To restore a window
+that was originally windowed to its original size and position, save these
+before making it full screen and then pass them in as above.
+
+
+@subsection window_iconify Window iconification
+
+Windows can be iconified (i.e. minimized) with @ref glfwIconifyWindow.
+
+@code
+glfwIconifyWindow(window);
+@endcode
+
+When a full screen window is iconified, the original video mode of its monitor
+is restored until the user or application restores the window.
+
+Iconified windows can be restored with @ref glfwRestoreWindow. This function
+also restores windows from maximization.
+
+@code
+glfwRestoreWindow(window);
+@endcode
+
+When a full screen window is restored, the desired video mode is restored to its
+monitor as well.
+
+If you wish to be notified when a window is iconified or restored, whether by
+the user, system or your own code, set an iconify callback.
+
+@code
+glfwSetWindowIconifyCallback(window, window_iconify_callback);
+@endcode
+
+The callback function receives changes in the iconification state of the window.
+
+@code
+void window_iconify_callback(GLFWwindow* window, int iconified)
+{
+ if (iconified)
+ {
+ // The window was iconified
+ }
+ else
+ {
+ // The window was restored
+ }
+}
+@endcode
+
+You can also get the current iconification state with @ref glfwGetWindowAttrib.
+
+@code
+int iconified = glfwGetWindowAttrib(window, GLFW_ICONIFIED);
+@endcode
+
+
+@subsection window_maximize Window maximization
+
+Windows can be maximized (i.e. zoomed) with @ref glfwMaximizeWindow.
+
+@code
+glfwMaximizeWindow(window);
+@endcode
+
+Full screen windows cannot be maximized and passing a full screen window to this
+function does nothing.
+
+Maximized windows can be restored with @ref glfwRestoreWindow. This function
+also restores windows from iconification.
+
+@code
+glfwRestoreWindow(window);
+@endcode
+
+If you wish to be notified when a window is maximized or restored, whether by
+the user, system or your own code, set a maximize callback.
+
+@code
+glfwSetWindowMaximizeCallback(window, window_maximize_callback);
+@endcode
+
+The callback function receives changes in the maximization state of the window.
+
+@code
+void window_maximize_callback(GLFWwindow* window, int maximized)
+{
+ if (maximized)
+ {
+ // The window was maximized
+ }
+ else
+ {
+ // The window was restored
+ }
+}
+@endcode
+
+You can also get the current maximization state with @ref glfwGetWindowAttrib.
+
+@code
+int maximized = glfwGetWindowAttrib(window, GLFW_MAXIMIZED);
+@endcode
+
+By default, newly created windows are not maximized. You can change this
+behavior by setting the [GLFW_MAXIMIZED](@ref GLFW_MAXIMIZED_hint) window hint
+before creating the window.
+
+@code
+glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE);
+@endcode
+
+
+@subsection window_hide Window visibility
+
+Windowed mode windows can be hidden with @ref glfwHideWindow.
+
+@code
+glfwHideWindow(window);
+@endcode
+
+This makes the window completely invisible to the user, including removing it
+from the task bar, dock or window list. Full screen windows cannot be hidden
+and calling @ref glfwHideWindow on a full screen window does nothing.
+
+Hidden windows can be shown with @ref glfwShowWindow.
+
+@code
+glfwShowWindow(window);
+@endcode
+
+By default, this function will also set the input focus to that window. Set
+the [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint to change
+this behavior for all newly created windows, or change the behavior for an
+existing window with @ref glfwSetWindowAttrib.
+
+You can also get the current visibility state with @ref glfwGetWindowAttrib.
+
+@code
+int visible = glfwGetWindowAttrib(window, GLFW_VISIBLE);
+@endcode
+
+By default, newly created windows are visible. You can change this behavior by
+setting the [GLFW_VISIBLE](@ref GLFW_VISIBLE_hint) window hint before creating
+the window.
+
+@code
+glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
+@endcode
+
+Windows created hidden are completely invisible to the user until shown. This
+can be useful if you need to set up your window further before showing it, for
+example moving it to a specific location.
+
+
+@subsection window_focus Window input focus
+
+Windows can be given input focus and brought to the front with @ref
+glfwFocusWindow.
+
+@code
+glfwFocusWindow(window);
+@endcode
+
+Keep in mind that it can be very disruptive to the user when a window is forced
+to the top. For a less disruptive way of getting the user's attention, see
+[attention requests](@ref window_attention).
+
+If you wish to be notified when a window gains or loses input focus, whether by
+the user, system or your own code, set a focus callback.
+
+@code
+glfwSetWindowFocusCallback(window, window_focus_callback);
+@endcode
+
+The callback function receives changes in the input focus state of the window.
+
+@code
+void window_focus_callback(GLFWwindow* window, int focused)
+{
+ if (focused)
+ {
+ // The window gained input focus
+ }
+ else
+ {
+ // The window lost input focus
+ }
+}
+@endcode
+
+You can also get the current input focus state with @ref glfwGetWindowAttrib.
+
+@code
+int focused = glfwGetWindowAttrib(window, GLFW_FOCUSED);
+@endcode
+
+By default, newly created windows are given input focus. You can change this
+behavior by setting the [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) window hint
+before creating the window.
+
+@code
+glfwWindowHint(GLFW_FOCUSED, GLFW_FALSE);
+@endcode
+
+
+@subsection window_attention Window attention request
+
+If you wish to notify the user of an event without interrupting, you can request
+attention with @ref glfwRequestWindowAttention.
+
+@code
+glfwRequestWindowAttention(window);
+@endcode
+
+The system will highlight the specified window, or on platforms where this is
+not supported, the application as a whole. Once the user has given it
+attention, the system will automatically end the request.
+
+
+@subsection window_refresh Window damage and refresh
+
+If you wish to be notified when the contents of a window is damaged and needs
+to be refreshed, set a window refresh callback.
+
+@code
+glfwSetWindowRefreshCallback(m_handle, window_refresh_callback);
+@endcode
+
+The callback function is called when the contents of the window needs to be
+refreshed.
+
+@code
+void window_refresh_callback(GLFWwindow* window)
+{
+ draw_editor_ui(window);
+ glfwSwapBuffers(window);
+}
+@endcode
+
+@note On compositing window systems such as Aero, Compiz or Aqua, where the
+window contents are saved off-screen, this callback might only be called when
+the window or framebuffer is resized.
+
+
+@subsection window_transparency Window transparency
+
+GLFW supports two kinds of transparency for windows; framebuffer transparency
+and whole window transparency. A single window may not use both methods. The
+results of doing this are undefined.
+
+Both methods require the platform to support it and not every version of every
+platform GLFW supports does this, so there are mechanisms to check whether the
+window really is transparent.
+
+Window framebuffers can be made transparent on a per-pixel per-frame basis with
+the [GLFW_TRANSPARENT_FRAMEBUFFER](@ref GLFW_TRANSPARENT_FRAMEBUFFER_hint)
+window hint.
+
+@code
+glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);
+@endcode
+
+If supported by the system, the window content area will be composited with the
+background using the framebuffer per-pixel alpha channel. This requires desktop
+compositing to be enabled on the system. It does not affect window decorations.
+
+You can check whether the window framebuffer was successfully made transparent
+with the
+[GLFW_TRANSPARENT_FRAMEBUFFER](@ref GLFW_TRANSPARENT_FRAMEBUFFER_attrib)
+window attribute.
+
+@code
+if (glfwGetWindowAttrib(window, GLFW_TRANSPARENT_FRAMEBUFFER))
+{
+ // window framebuffer is currently transparent
+}
+@endcode
+
+GLFW comes with an example that enabled framebuffer transparency called `gears`.
+
+The opacity of the whole window, including any decorations, can be set with @ref
+glfwSetWindowOpacity.
+
+@code
+glfwSetWindowOpacity(window, 0.5f);
+@endcode
+
+The opacity (or alpha) value is a positive finite number between zero and one,
+where 0 (zero) is fully transparent and 1 (one) is fully opaque. The initial
+opacity value for newly created windows is 1.
+
+The current opacity of a window can be queried with @ref glfwGetWindowOpacity.
+
+@code
+float opacity = glfwGetWindowOpacity(window);
+@endcode
+
+If the system does not support whole window transparency, this function always
+returns one.
+
+GLFW comes with a test program that lets you control whole window transparency
+at run-time called `opacity`.
+
+
+@subsection window_attribs Window attributes
+
+Windows have a number of attributes that can be returned using @ref
+glfwGetWindowAttrib. Some reflect state that may change as a result of user
+interaction, (e.g. whether it has input focus), while others reflect inherent
+properties of the window (e.g. what kind of border it has). Some are related to
+the window and others to its OpenGL or OpenGL ES context.
+
+@code
+if (glfwGetWindowAttrib(window, GLFW_FOCUSED))
+{
+ // window has input focus
+}
+@endcode
+
+The [GLFW_DECORATED](@ref GLFW_DECORATED_attrib),
+[GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib),
+[GLFW_FLOATING](@ref GLFW_FLOATING_attrib),
+[GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib) and
+[GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib) window attributes can be
+changed with @ref glfwSetWindowAttrib.
+
+@code
+glfwSetWindowAttrib(window, GLFW_RESIZABLE, GLFW_FALSE);
+@endcode
+
+
+
+@subsubsection window_attribs_wnd Window related attributes
+
+@anchor GLFW_FOCUSED_attrib
+__GLFW_FOCUSED__ indicates whether the specified window has input focus. See
+@ref window_focus for details.
+
+@anchor GLFW_ICONIFIED_attrib
+__GLFW_ICONIFIED__ indicates whether the specified window is iconified.
+See @ref window_iconify for details.
+
+@anchor GLFW_MAXIMIZED_attrib
+__GLFW_MAXIMIZED__ indicates whether the specified window is maximized. See
+@ref window_maximize for details.
+
+@anchor GLFW_HOVERED_attrib
+__GLFW_HOVERED__ indicates whether the cursor is currently directly over the
+content area of the window, with no other windows between. See @ref
+cursor_enter for details.
+
+@anchor GLFW_VISIBLE_attrib
+__GLFW_VISIBLE__ indicates whether the specified window is visible. See @ref
+window_hide for details.
+
+@anchor GLFW_RESIZABLE_attrib
+__GLFW_RESIZABLE__ indicates whether the specified window is resizable _by the
+user_. This can be set before creation with the
+[GLFW_RESIZABLE](@ref GLFW_RESIZABLE_hint) window hint or after with @ref
+glfwSetWindowAttrib.
+
+@anchor GLFW_DECORATED_attrib
+__GLFW_DECORATED__ indicates whether the specified window has decorations such
+as a border, a close widget, etc. This can be set before creation with the
+[GLFW_DECORATED](@ref GLFW_DECORATED_hint) window hint or after with @ref
+glfwSetWindowAttrib.
+
+@anchor GLFW_AUTO_ICONIFY_attrib
+__GLFW_AUTO_ICONIFY__ indicates whether the specified full screen window is
+iconified on focus loss, a close widget, etc. This can be set before creation
+with the [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_hint) window hint or after
+with @ref glfwSetWindowAttrib.
+
+@anchor GLFW_FLOATING_attrib
+__GLFW_FLOATING__ indicates whether the specified window is floating, also
+called topmost or always-on-top. This can be set before creation with the
+[GLFW_FLOATING](@ref GLFW_FLOATING_hint) window hint or after with @ref
+glfwSetWindowAttrib.
+
+@anchor GLFW_TRANSPARENT_FRAMEBUFFER_attrib
+__GLFW_TRANSPARENT_FRAMEBUFFER__ indicates whether the specified window has
+a transparent framebuffer, i.e. the window contents is composited with the
+background using the window framebuffer alpha channel. See @ref
+window_transparency for details.
+
+@anchor GLFW_FOCUS_ON_SHOW_attrib
+__GLFW_FOCUS_ON_SHOW__ specifies whether the window will be given input
+focus when @ref glfwShowWindow is called. This can be set before creation
+with the [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint or
+after with @ref glfwSetWindowAttrib.
+
+@subsubsection window_attribs_ctx Context related attributes
+
+@anchor GLFW_CLIENT_API_attrib
+__GLFW_CLIENT_API__ indicates the client API provided by the window's context;
+either `GLFW_OPENGL_API`, `GLFW_OPENGL_ES_API` or `GLFW_NO_API`.
+
+@anchor GLFW_CONTEXT_CREATION_API_attrib
+__GLFW_CONTEXT_CREATION_API__ indicates the context creation API used to create
+the window's context; either `GLFW_NATIVE_CONTEXT_API`, `GLFW_EGL_CONTEXT_API`
+or `GLFW_OSMESA_CONTEXT_API`.
+
+@anchor GLFW_CONTEXT_VERSION_MAJOR_attrib
+@anchor GLFW_CONTEXT_VERSION_MINOR_attrib
+@anchor GLFW_CONTEXT_REVISION_attrib
+__GLFW_CONTEXT_VERSION_MAJOR__, __GLFW_CONTEXT_VERSION_MINOR__ and
+__GLFW_CONTEXT_REVISION__ indicate the client API version of the window's
+context.
+
+@note Do not confuse these attributes with `GLFW_VERSION_MAJOR`,
+`GLFW_VERSION_MINOR` and `GLFW_VERSION_REVISION` which provide the API version
+of the GLFW header.
+
+@anchor GLFW_OPENGL_FORWARD_COMPAT_attrib
+__GLFW_OPENGL_FORWARD_COMPAT__ is `GLFW_TRUE` if the window's context is an
+OpenGL forward-compatible one, or `GLFW_FALSE` otherwise.
+
+@anchor GLFW_OPENGL_DEBUG_CONTEXT_attrib
+__GLFW_OPENGL_DEBUG_CONTEXT__ is `GLFW_TRUE` if the window's context is in debug
+mode, or `GLFW_FALSE` otherwise.
+
+@anchor GLFW_OPENGL_PROFILE_attrib
+__GLFW_OPENGL_PROFILE__ indicates the OpenGL profile used by the context. This
+is `GLFW_OPENGL_CORE_PROFILE` or `GLFW_OPENGL_COMPAT_PROFILE` if the context
+uses a known profile, or `GLFW_OPENGL_ANY_PROFILE` if the OpenGL profile is
+unknown or the context is an OpenGL ES context. Note that the returned profile
+may not match the profile bits of the context flags, as GLFW will try other
+means of detecting the profile when no bits are set.
+
+@anchor GLFW_CONTEXT_RELEASE_BEHAVIOR_attrib
+__GLFW_CONTEXT_RELEASE_BEHAVIOR__ indicates the release used by the context.
+Possible values are one of `GLFW_ANY_RELEASE_BEHAVIOR`,
+`GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`. If the
+behavior is `GLFW_ANY_RELEASE_BEHAVIOR`, the default behavior of the context
+creation API will be used. If the behavior is `GLFW_RELEASE_BEHAVIOR_FLUSH`,
+the pipeline will be flushed whenever the context is released from being the
+current one. If the behavior is `GLFW_RELEASE_BEHAVIOR_NONE`, the pipeline will
+not be flushed on release.
+
+@anchor GLFW_CONTEXT_NO_ERROR_attrib
+__GLFW_CONTEXT_NO_ERROR__ indicates whether errors are generated by the context.
+Possible values are `GLFW_TRUE` and `GLFW_FALSE`. If enabled, situations that
+would have generated errors instead cause undefined behavior.
+
+@anchor GLFW_CONTEXT_ROBUSTNESS_attrib
+__GLFW_CONTEXT_ROBUSTNESS__ indicates the robustness strategy used by the
+context. This is `GLFW_LOSE_CONTEXT_ON_RESET` or `GLFW_NO_RESET_NOTIFICATION`
+if the window's context supports robustness, or `GLFW_NO_ROBUSTNESS` otherwise.
+
+
+@subsubsection window_attribs_fb Framebuffer related attributes
+
+GLFW does not expose attributes of the default framebuffer (i.e. the framebuffer
+attached to the window) as these can be queried directly with either OpenGL,
+OpenGL ES or Vulkan.
+
+If you are using version 3.0 or later of OpenGL or OpenGL ES, the
+`glGetFramebufferAttachmentParameteriv` function can be used to retrieve the
+number of bits for the red, green, blue, alpha, depth and stencil buffer
+channels. Otherwise, the `glGetIntegerv` function can be used.
+
+The number of MSAA samples are always retrieved with `glGetIntegerv`. For
+contexts supporting framebuffer objects, the number of samples of the currently
+bound framebuffer is returned.
+
+Attribute | glGetIntegerv | glGetFramebufferAttachmentParameteriv
+------------ | ----------------- | -------------------------------------
+Red bits | `GL_RED_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE`
+Green bits | `GL_GREEN_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE`
+Blue bits | `GL_BLUE_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE`
+Alpha bits | `GL_ALPHA_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE`
+Depth bits | `GL_DEPTH_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE`
+Stencil bits | `GL_STENCIL_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE`
+MSAA samples | `GL_SAMPLES` | _Not provided by this function_
+
+When calling `glGetFramebufferAttachmentParameteriv`, the red, green, blue and
+alpha sizes are queried from the `GL_BACK_LEFT`, while the depth and stencil
+sizes are queried from the `GL_DEPTH` and `GL_STENCIL` attachments,
+respectively.
+
+
+@section buffer_swap Buffer swapping
+
+GLFW windows are by default double buffered. That means that you have two
+rendering buffers; a front buffer and a back buffer. The front buffer is
+the one being displayed and the back buffer the one you render to.
+
+When the entire frame has been rendered, it is time to swap the back and the
+front buffers in order to display what has been rendered and begin rendering
+a new frame. This is done with @ref glfwSwapBuffers.
+
+@code
+glfwSwapBuffers(window);
+@endcode
+
+Sometimes it can be useful to select when the buffer swap will occur. With the
+function @ref glfwSwapInterval it is possible to select the minimum number of
+monitor refreshes the driver should wait from the time @ref glfwSwapBuffers was
+called before swapping the buffers:
+
+@code
+glfwSwapInterval(1);
+@endcode
+
+If the interval is zero, the swap will take place immediately when @ref
+glfwSwapBuffers is called without waiting for a refresh. Otherwise at least
+interval retraces will pass between each buffer swap. Using a swap interval of
+zero can be useful for benchmarking purposes, when it is not desirable to
+measure the time it takes to wait for the vertical retrace. However, a swap
+interval of one lets you avoid tearing.
+
+Note that this may not work on all machines, as some drivers have
+user-controlled settings that override any swap interval the application
+requests.
+
+A context that supports either the `WGL_EXT_swap_control_tear` or the
+`GLX_EXT_swap_control_tear` extension also accepts _negative_ swap intervals,
+which allows the driver to swap immediately even if a frame arrives a little bit
+late. This trades the risk of visible tears for greater framerate stability.
+You can check for these extensions with @ref glfwExtensionSupported.
+
+*/
diff --git a/extern/glfw/examples/CMakeLists.txt b/extern/glfw/examples/CMakeLists.txt
new file mode 100644
index 0000000000..0eba4e65a2
--- /dev/null
+++ b/extern/glfw/examples/CMakeLists.txt
@@ -0,0 +1,93 @@
+
+link_libraries(glfw)
+
+include_directories("${GLFW_SOURCE_DIR}/deps")
+
+if (MATH_LIBRARY)
+ link_libraries("${MATH_LIBRARY}")
+endif()
+
+# Workaround for the MS CRT deprecating parts of the standard library
+if (MSVC OR CMAKE_C_SIMULATE_ID STREQUAL "MSVC")
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+endif()
+
+if (WIN32)
+ set(ICON glfw.rc)
+elseif (APPLE)
+ set(ICON glfw.icns)
+endif()
+
+if (${CMAKE_VERSION} VERSION_EQUAL "3.1.0" OR
+ ${CMAKE_VERSION} VERSION_GREATER "3.1.0")
+ set(CMAKE_C_STANDARD 99)
+else()
+ # Remove this fallback when removing support for CMake version less than 3.1
+ add_compile_options("$<$:-std=c99>"
+ "$<$:-std=c99>"
+ "$<$:-std=c99>")
+
+endif()
+
+set(GLAD_GL "${GLFW_SOURCE_DIR}/deps/glad/gl.h"
+ "${GLFW_SOURCE_DIR}/deps/glad_gl.c")
+set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h"
+ "${GLFW_SOURCE_DIR}/deps/getopt.c")
+set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h"
+ "${GLFW_SOURCE_DIR}/deps/tinycthread.c")
+
+add_executable(boing WIN32 MACOSX_BUNDLE boing.c ${ICON} ${GLAD_GL})
+add_executable(gears WIN32 MACOSX_BUNDLE gears.c ${ICON} ${GLAD_GL})
+add_executable(heightmap WIN32 MACOSX_BUNDLE heightmap.c ${ICON} ${GLAD_GL})
+add_executable(offscreen offscreen.c ${ICON} ${GLAD_GL})
+add_executable(particles WIN32 MACOSX_BUNDLE particles.c ${ICON} ${TINYCTHREAD} ${GETOPT} ${GLAD_GL})
+add_executable(sharing WIN32 MACOSX_BUNDLE sharing.c ${ICON} ${GLAD_GL})
+add_executable(simple WIN32 MACOSX_BUNDLE simple.c ${ICON} ${GLAD_GL})
+add_executable(splitview WIN32 MACOSX_BUNDLE splitview.c ${ICON} ${GLAD_GL})
+add_executable(wave WIN32 MACOSX_BUNDLE wave.c ${ICON} ${GLAD_GL})
+
+target_link_libraries(particles "${CMAKE_THREAD_LIBS_INIT}")
+if (RT_LIBRARY)
+ target_link_libraries(particles "${RT_LIBRARY}")
+endif()
+
+set(GUI_ONLY_BINARIES boing gears heightmap particles sharing simple splitview
+ wave)
+set(CONSOLE_BINARIES offscreen)
+
+set_target_properties(${GUI_ONLY_BINARIES} ${CONSOLE_BINARIES} PROPERTIES
+ FOLDER "GLFW3/Examples")
+
+if (GLFW_USE_OSMESA)
+ target_compile_definitions(offscreen PRIVATE USE_NATIVE_OSMESA)
+endif()
+
+if (MSVC)
+ # Tell MSVC to use main instead of WinMain
+ set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES
+ LINK_FLAGS "/ENTRY:mainCRTStartup")
+elseif (CMAKE_C_SIMULATE_ID STREQUAL "MSVC")
+ # Tell Clang using MS CRT to use main instead of WinMain
+ set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES
+ LINK_FLAGS "-Wl,/entry:mainCRTStartup")
+endif()
+
+if (APPLE)
+ set_target_properties(boing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Boing")
+ set_target_properties(gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears")
+ set_target_properties(heightmap PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Heightmap")
+ set_target_properties(particles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Particles")
+ set_target_properties(sharing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Sharing")
+ set_target_properties(simple PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Simple")
+ set_target_properties(splitview PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "SplitView")
+ set_target_properties(wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave")
+
+ set_source_files_properties(glfw.icns PROPERTIES
+ MACOSX_PACKAGE_LOCATION "Resources")
+ set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES
+ MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION}
+ MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION}
+ MACOSX_BUNDLE_ICON_FILE glfw.icns
+ MACOSX_BUNDLE_INFO_PLIST "${GLFW_SOURCE_DIR}/CMake/MacOSXBundleInfo.plist.in")
+endif()
+
diff --git a/extern/glfw/examples/boing.c b/extern/glfw/examples/boing.c
new file mode 100644
index 0000000000..ca389086a1
--- /dev/null
+++ b/extern/glfw/examples/boing.c
@@ -0,0 +1,679 @@
+/*****************************************************************************
+ * Title: GLBoing
+ * Desc: Tribute to Amiga Boing.
+ * Author: Jim Brooks
+ * Original Amiga authors were R.J. Mical and Dale Luck.
+ * GLFW conversion by Marcus Geelnard
+ * Notes: - 360' = 2*PI [radian]
+ *
+ * - Distances between objects are created by doing a relative
+ * Z translations.
+ *
+ * - Although OpenGL enticingly supports alpha-blending,
+ * the shadow of the original Boing didn't affect the color
+ * of the grid.
+ *
+ * - [Marcus] Changed timing scheme from interval driven to frame-
+ * time based animation steps (which results in much smoother
+ * movement)
+ *
+ * History of Amiga Boing:
+ *
+ * Boing was demonstrated on the prototype Amiga (codenamed "Lorraine") in
+ * 1985. According to legend, it was written ad-hoc in one night by
+ * R. J. Mical and Dale Luck. Because the bouncing ball animation was so fast
+ * and smooth, attendees did not believe the Amiga prototype was really doing
+ * the rendering. Suspecting a trick, they began looking around the booth for
+ * a hidden computer or VCR.
+ *****************************************************************************/
+
+#if defined(_MSC_VER)
+ // Make MS math.h define M_PI
+ #define _USE_MATH_DEFINES
+#endif
+
+#include
+#include
+#include
+
+#include
+#define GLFW_INCLUDE_NONE
+#include
+
+#include
+
+
+/*****************************************************************************
+ * Various declarations and macros
+ *****************************************************************************/
+
+/* Prototypes */
+void init( void );
+void display( void );
+void reshape( GLFWwindow* window, int w, int h );
+void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods );
+void mouse_button_callback( GLFWwindow* window, int button, int action, int mods );
+void cursor_position_callback( GLFWwindow* window, double x, double y );
+void DrawBoingBall( void );
+void BounceBall( double dt );
+void DrawBoingBallBand( GLfloat long_lo, GLfloat long_hi );
+void DrawGrid( void );
+
+#define RADIUS 70.f
+#define STEP_LONGITUDE 22.5f /* 22.5 makes 8 bands like original Boing */
+#define STEP_LATITUDE 22.5f
+
+#define DIST_BALL (RADIUS * 2.f + RADIUS * 0.1f)
+
+#define VIEW_SCENE_DIST (DIST_BALL * 3.f + 200.f)/* distance from viewer to middle of boing area */
+#define GRID_SIZE (RADIUS * 4.5f) /* length (width) of grid */
+#define BOUNCE_HEIGHT (RADIUS * 2.1f)
+#define BOUNCE_WIDTH (RADIUS * 2.1f)
+
+#define SHADOW_OFFSET_X -20.f
+#define SHADOW_OFFSET_Y 10.f
+#define SHADOW_OFFSET_Z 0.f
+
+#define WALL_L_OFFSET 0.f
+#define WALL_R_OFFSET 5.f
+
+/* Animation speed (50.0 mimics the original GLUT demo speed) */
+#define ANIMATION_SPEED 50.f
+
+/* Maximum allowed delta time per physics iteration */
+#define MAX_DELTA_T 0.02f
+
+/* Draw ball, or its shadow */
+typedef enum { DRAW_BALL, DRAW_BALL_SHADOW } DRAW_BALL_ENUM;
+
+/* Vertex type */
+typedef struct {float x; float y; float z;} vertex_t;
+
+/* Global vars */
+int windowed_xpos, windowed_ypos, windowed_width, windowed_height;
+int width, height;
+GLfloat deg_rot_y = 0.f;
+GLfloat deg_rot_y_inc = 2.f;
+int override_pos = GLFW_FALSE;
+GLfloat cursor_x = 0.f;
+GLfloat cursor_y = 0.f;
+GLfloat ball_x = -RADIUS;
+GLfloat ball_y = -RADIUS;
+GLfloat ball_x_inc = 1.f;
+GLfloat ball_y_inc = 2.f;
+DRAW_BALL_ENUM drawBallHow;
+double t;
+double t_old = 0.f;
+double dt;
+
+/* Random number generator */
+#ifndef RAND_MAX
+ #define RAND_MAX 4095
+#endif
+
+
+/*****************************************************************************
+ * Truncate a degree.
+ *****************************************************************************/
+GLfloat TruncateDeg( GLfloat deg )
+{
+ if ( deg >= 360.f )
+ return (deg - 360.f);
+ else
+ return deg;
+}
+
+/*****************************************************************************
+ * Convert a degree (360-based) into a radian.
+ * 360' = 2 * PI
+ *****************************************************************************/
+double deg2rad( double deg )
+{
+ return deg / 360 * (2 * M_PI);
+}
+
+/*****************************************************************************
+ * 360' sin().
+ *****************************************************************************/
+double sin_deg( double deg )
+{
+ return sin( deg2rad( deg ) );
+}
+
+/*****************************************************************************
+ * 360' cos().
+ *****************************************************************************/
+double cos_deg( double deg )
+{
+ return cos( deg2rad( deg ) );
+}
+
+/*****************************************************************************
+ * Compute a cross product (for a normal vector).
+ *
+ * c = a x b
+ *****************************************************************************/
+void CrossProduct( vertex_t a, vertex_t b, vertex_t c, vertex_t *n )
+{
+ GLfloat u1, u2, u3;
+ GLfloat v1, v2, v3;
+
+ u1 = b.x - a.x;
+ u2 = b.y - a.y;
+ u3 = b.y - a.z;
+
+ v1 = c.x - a.x;
+ v2 = c.y - a.y;
+ v3 = c.z - a.z;
+
+ n->x = u2 * v3 - v2 * u3;
+ n->y = u3 * v1 - v3 * u1;
+ n->z = u1 * v2 - v1 * u2;
+}
+
+
+#define BOING_DEBUG 0
+
+
+/*****************************************************************************
+ * init()
+ *****************************************************************************/
+void init( void )
+{
+ /*
+ * Clear background.
+ */
+ glClearColor( 0.55f, 0.55f, 0.55f, 0.f );
+
+ glShadeModel( GL_FLAT );
+}
+
+
+/*****************************************************************************
+ * display()
+ *****************************************************************************/
+void display(void)
+{
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+ glPushMatrix();
+
+ drawBallHow = DRAW_BALL_SHADOW;
+ DrawBoingBall();
+
+ DrawGrid();
+
+ drawBallHow = DRAW_BALL;
+ DrawBoingBall();
+
+ glPopMatrix();
+ glFlush();
+}
+
+
+/*****************************************************************************
+ * reshape()
+ *****************************************************************************/
+void reshape( GLFWwindow* window, int w, int h )
+{
+ mat4x4 projection, view;
+
+ glViewport( 0, 0, (GLsizei)w, (GLsizei)h );
+
+ glMatrixMode( GL_PROJECTION );
+ mat4x4_perspective( projection,
+ 2.f * (float) atan2( RADIUS, 200.f ),
+ (float)w / (float)h,
+ 1.f, VIEW_SCENE_DIST );
+ glLoadMatrixf((const GLfloat*) projection);
+
+ glMatrixMode( GL_MODELVIEW );
+ {
+ vec3 eye = { 0.f, 0.f, VIEW_SCENE_DIST };
+ vec3 center = { 0.f, 0.f, 0.f };
+ vec3 up = { 0.f, -1.f, 0.f };
+ mat4x4_look_at( view, eye, center, up );
+ }
+ glLoadMatrixf((const GLfloat*) view);
+}
+
+void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods )
+{
+ if (action != GLFW_PRESS)
+ return;
+
+ if (key == GLFW_KEY_ESCAPE && mods == 0)
+ glfwSetWindowShouldClose(window, GLFW_TRUE);
+ if ((key == GLFW_KEY_ENTER && mods == GLFW_MOD_ALT) ||
+ (key == GLFW_KEY_F11 && mods == GLFW_MOD_ALT))
+ {
+ if (glfwGetWindowMonitor(window))
+ {
+ glfwSetWindowMonitor(window, NULL,
+ windowed_xpos, windowed_ypos,
+ windowed_width, windowed_height, 0);
+ }
+ else
+ {
+ GLFWmonitor* monitor = glfwGetPrimaryMonitor();
+ if (monitor)
+ {
+ const GLFWvidmode* mode = glfwGetVideoMode(monitor);
+ glfwGetWindowPos(window, &windowed_xpos, &windowed_ypos);
+ glfwGetWindowSize(window, &windowed_width, &windowed_height);
+ glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate);
+ }
+ }
+ }
+}
+
+static void set_ball_pos ( GLfloat x, GLfloat y )
+{
+ ball_x = (width / 2) - x;
+ ball_y = y - (height / 2);
+}
+
+void mouse_button_callback( GLFWwindow* window, int button, int action, int mods )
+{
+ if (button != GLFW_MOUSE_BUTTON_LEFT)
+ return;
+
+ if (action == GLFW_PRESS)
+ {
+ override_pos = GLFW_TRUE;
+ set_ball_pos(cursor_x, cursor_y);
+ }
+ else
+ {
+ override_pos = GLFW_FALSE;
+ }
+}
+
+void cursor_position_callback( GLFWwindow* window, double x, double y )
+{
+ cursor_x = (float) x;
+ cursor_y = (float) y;
+
+ if ( override_pos )
+ set_ball_pos(cursor_x, cursor_y);
+}
+
+/*****************************************************************************
+ * Draw the Boing ball.
+ *
+ * The Boing ball is sphere in which each facet is a rectangle.
+ * Facet colors alternate between red and white.
+ * The ball is built by stacking latitudinal circles. Each circle is composed
+ * of a widely-separated set of points, so that each facet is noticeably large.
+ *****************************************************************************/
+void DrawBoingBall( void )
+{
+ GLfloat lon_deg; /* degree of longitude */
+ double dt_total, dt2;
+
+ glPushMatrix();
+ glMatrixMode( GL_MODELVIEW );
+
+ /*
+ * Another relative Z translation to separate objects.
+ */
+ glTranslatef( 0.0, 0.0, DIST_BALL );
+
+ /* Update ball position and rotation (iterate if necessary) */
+ dt_total = dt;
+ while( dt_total > 0.0 )
+ {
+ dt2 = dt_total > MAX_DELTA_T ? MAX_DELTA_T : dt_total;
+ dt_total -= dt2;
+ BounceBall( dt2 );
+ deg_rot_y = TruncateDeg( deg_rot_y + deg_rot_y_inc*((float)dt2*ANIMATION_SPEED) );
+ }
+
+ /* Set ball position */
+ glTranslatef( ball_x, ball_y, 0.0 );
+
+ /*
+ * Offset the shadow.
+ */
+ if ( drawBallHow == DRAW_BALL_SHADOW )
+ {
+ glTranslatef( SHADOW_OFFSET_X,
+ SHADOW_OFFSET_Y,
+ SHADOW_OFFSET_Z );
+ }
+
+ /*
+ * Tilt the ball.
+ */
+ glRotatef( -20.0, 0.0, 0.0, 1.0 );
+
+ /*
+ * Continually rotate ball around Y axis.
+ */
+ glRotatef( deg_rot_y, 0.0, 1.0, 0.0 );
+
+ /*
+ * Set OpenGL state for Boing ball.
+ */
+ glCullFace( GL_FRONT );
+ glEnable( GL_CULL_FACE );
+ glEnable( GL_NORMALIZE );
+
+ /*
+ * Build a faceted latitude slice of the Boing ball,
+ * stepping same-sized vertical bands of the sphere.
+ */
+ for ( lon_deg = 0;
+ lon_deg < 180;
+ lon_deg += STEP_LONGITUDE )
+ {
+ /*
+ * Draw a latitude circle at this longitude.
+ */
+ DrawBoingBallBand( lon_deg,
+ lon_deg + STEP_LONGITUDE );
+ }
+
+ glPopMatrix();
+
+ return;
+}
+
+
+/*****************************************************************************
+ * Bounce the ball.
+ *****************************************************************************/
+void BounceBall( double delta_t )
+{
+ GLfloat sign;
+ GLfloat deg;
+
+ if ( override_pos )
+ return;
+
+ /* Bounce on walls */
+ if ( ball_x > (BOUNCE_WIDTH/2 + WALL_R_OFFSET ) )
+ {
+ ball_x_inc = -0.5f - 0.75f * (GLfloat)rand() / (GLfloat)RAND_MAX;
+ deg_rot_y_inc = -deg_rot_y_inc;
+ }
+ if ( ball_x < -(BOUNCE_HEIGHT/2 + WALL_L_OFFSET) )
+ {
+ ball_x_inc = 0.5f + 0.75f * (GLfloat)rand() / (GLfloat)RAND_MAX;
+ deg_rot_y_inc = -deg_rot_y_inc;
+ }
+
+ /* Bounce on floor / roof */
+ if ( ball_y > BOUNCE_HEIGHT/2 )
+ {
+ ball_y_inc = -0.75f - 1.f * (GLfloat)rand() / (GLfloat)RAND_MAX;
+ }
+ if ( ball_y < -BOUNCE_HEIGHT/2*0.85 )
+ {
+ ball_y_inc = 0.75f + 1.f * (GLfloat)rand() / (GLfloat)RAND_MAX;
+ }
+
+ /* Update ball position */
+ ball_x += ball_x_inc * ((float)delta_t*ANIMATION_SPEED);
+ ball_y += ball_y_inc * ((float)delta_t*ANIMATION_SPEED);
+
+ /*
+ * Simulate the effects of gravity on Y movement.
+ */
+ if ( ball_y_inc < 0 ) sign = -1.0; else sign = 1.0;
+
+ deg = (ball_y + BOUNCE_HEIGHT/2) * 90 / BOUNCE_HEIGHT;
+ if ( deg > 80 ) deg = 80;
+ if ( deg < 10 ) deg = 10;
+
+ ball_y_inc = sign * 4.f * (float) sin_deg( deg );
+}
+
+
+/*****************************************************************************
+ * Draw a faceted latitude band of the Boing ball.
+ *
+ * Parms: long_lo, long_hi
+ * Low and high longitudes of slice, resp.
+ *****************************************************************************/
+void DrawBoingBallBand( GLfloat long_lo,
+ GLfloat long_hi )
+{
+ vertex_t vert_ne; /* "ne" means south-east, so on */
+ vertex_t vert_nw;
+ vertex_t vert_sw;
+ vertex_t vert_se;
+ vertex_t vert_norm;
+ GLfloat lat_deg;
+ static int colorToggle = 0;
+
+ /*
+ * Iterate through the points of a latitude circle.
+ * A latitude circle is a 2D set of X,Z points.
+ */
+ for ( lat_deg = 0;
+ lat_deg <= (360 - STEP_LATITUDE);
+ lat_deg += STEP_LATITUDE )
+ {
+ /*
+ * Color this polygon with red or white.
+ */
+ if ( colorToggle )
+ glColor3f( 0.8f, 0.1f, 0.1f );
+ else
+ glColor3f( 0.95f, 0.95f, 0.95f );
+#if 0
+ if ( lat_deg >= 180 )
+ if ( colorToggle )
+ glColor3f( 0.1f, 0.8f, 0.1f );
+ else
+ glColor3f( 0.5f, 0.5f, 0.95f );
+#endif
+ colorToggle = ! colorToggle;
+
+ /*
+ * Change color if drawing shadow.
+ */
+ if ( drawBallHow == DRAW_BALL_SHADOW )
+ glColor3f( 0.35f, 0.35f, 0.35f );
+
+ /*
+ * Assign each Y.
+ */
+ vert_ne.y = vert_nw.y = (float) cos_deg(long_hi) * RADIUS;
+ vert_sw.y = vert_se.y = (float) cos_deg(long_lo) * RADIUS;
+
+ /*
+ * Assign each X,Z with sin,cos values scaled by latitude radius indexed by longitude.
+ * Eg, long=0 and long=180 are at the poles, so zero scale is sin(longitude),
+ * while long=90 (sin(90)=1) is at equator.
+ */
+ vert_ne.x = (float) cos_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE ));
+ vert_se.x = (float) cos_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo ));
+ vert_nw.x = (float) cos_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE ));
+ vert_sw.x = (float) cos_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo ));
+
+ vert_ne.z = (float) sin_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE ));
+ vert_se.z = (float) sin_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo ));
+ vert_nw.z = (float) sin_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE ));
+ vert_sw.z = (float) sin_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo ));
+
+ /*
+ * Draw the facet.
+ */
+ glBegin( GL_POLYGON );
+
+ CrossProduct( vert_ne, vert_nw, vert_sw, &vert_norm );
+ glNormal3f( vert_norm.x, vert_norm.y, vert_norm.z );
+
+ glVertex3f( vert_ne.x, vert_ne.y, vert_ne.z );
+ glVertex3f( vert_nw.x, vert_nw.y, vert_nw.z );
+ glVertex3f( vert_sw.x, vert_sw.y, vert_sw.z );
+ glVertex3f( vert_se.x, vert_se.y, vert_se.z );
+
+ glEnd();
+
+#if BOING_DEBUG
+ printf( "----------------------------------------------------------- \n" );
+ printf( "lat = %f long_lo = %f long_hi = %f \n", lat_deg, long_lo, long_hi );
+ printf( "vert_ne x = %.8f y = %.8f z = %.8f \n", vert_ne.x, vert_ne.y, vert_ne.z );
+ printf( "vert_nw x = %.8f y = %.8f z = %.8f \n", vert_nw.x, vert_nw.y, vert_nw.z );
+ printf( "vert_se x = %.8f y = %.8f z = %.8f \n", vert_se.x, vert_se.y, vert_se.z );
+ printf( "vert_sw x = %.8f y = %.8f z = %.8f \n", vert_sw.x, vert_sw.y, vert_sw.z );
+#endif
+
+ }
+
+ /*
+ * Toggle color so that next band will opposite red/white colors than this one.
+ */
+ colorToggle = ! colorToggle;
+
+ /*
+ * This circular band is done.
+ */
+ return;
+}
+
+
+/*****************************************************************************
+ * Draw the purple grid of lines, behind the Boing ball.
+ * When the Workbench is dropped to the bottom, Boing shows 12 rows.
+ *****************************************************************************/
+void DrawGrid( void )
+{
+ int row, col;
+ const int rowTotal = 12; /* must be divisible by 2 */
+ const int colTotal = rowTotal; /* must be same as rowTotal */
+ const GLfloat widthLine = 2.0; /* should be divisible by 2 */
+ const GLfloat sizeCell = GRID_SIZE / rowTotal;
+ const GLfloat z_offset = -40.0;
+ GLfloat xl, xr;
+ GLfloat yt, yb;
+
+ glPushMatrix();
+ glDisable( GL_CULL_FACE );
+
+ /*
+ * Another relative Z translation to separate objects.
+ */
+ glTranslatef( 0.0, 0.0, DIST_BALL );
+
+ /*
+ * Draw vertical lines (as skinny 3D rectangles).
+ */
+ for ( col = 0; col <= colTotal; col++ )
+ {
+ /*
+ * Compute co-ords of line.
+ */
+ xl = -GRID_SIZE / 2 + col * sizeCell;
+ xr = xl + widthLine;
+
+ yt = GRID_SIZE / 2;
+ yb = -GRID_SIZE / 2 - widthLine;
+
+ glBegin( GL_POLYGON );
+
+ glColor3f( 0.6f, 0.1f, 0.6f ); /* purple */
+
+ glVertex3f( xr, yt, z_offset ); /* NE */
+ glVertex3f( xl, yt, z_offset ); /* NW */
+ glVertex3f( xl, yb, z_offset ); /* SW */
+ glVertex3f( xr, yb, z_offset ); /* SE */
+
+ glEnd();
+ }
+
+ /*
+ * Draw horizontal lines (as skinny 3D rectangles).
+ */
+ for ( row = 0; row <= rowTotal; row++ )
+ {
+ /*
+ * Compute co-ords of line.
+ */
+ yt = GRID_SIZE / 2 - row * sizeCell;
+ yb = yt - widthLine;
+
+ xl = -GRID_SIZE / 2;
+ xr = GRID_SIZE / 2 + widthLine;
+
+ glBegin( GL_POLYGON );
+
+ glColor3f( 0.6f, 0.1f, 0.6f ); /* purple */
+
+ glVertex3f( xr, yt, z_offset ); /* NE */
+ glVertex3f( xl, yt, z_offset ); /* NW */
+ glVertex3f( xl, yb, z_offset ); /* SW */
+ glVertex3f( xr, yb, z_offset ); /* SE */
+
+ glEnd();
+ }
+
+ glPopMatrix();
+
+ return;
+}
+
+
+/*======================================================================*
+ * main()
+ *======================================================================*/
+
+int main( void )
+{
+ GLFWwindow* window;
+
+ /* Init GLFW */
+ if( !glfwInit() )
+ exit( EXIT_FAILURE );
+
+ window = glfwCreateWindow( 400, 400, "Boing (classic Amiga demo)", NULL, NULL );
+ if (!window)
+ {
+ glfwTerminate();
+ exit( EXIT_FAILURE );
+ }
+
+ glfwSetWindowAspectRatio(window, 1, 1);
+
+ glfwSetFramebufferSizeCallback(window, reshape);
+ glfwSetKeyCallback(window, key_callback);
+ glfwSetMouseButtonCallback(window, mouse_button_callback);
+ glfwSetCursorPosCallback(window, cursor_position_callback);
+
+ glfwMakeContextCurrent(window);
+ gladLoadGL(glfwGetProcAddress);
+ glfwSwapInterval( 1 );
+
+ glfwGetFramebufferSize(window, &width, &height);
+ reshape(window, width, height);
+
+ glfwSetTime( 0.0 );
+
+ init();
+
+ /* Main loop */
+ for (;;)
+ {
+ /* Timing */
+ t = glfwGetTime();
+ dt = t - t_old;
+ t_old = t;
+
+ /* Draw one frame */
+ display();
+
+ /* Swap buffers */
+ glfwSwapBuffers(window);
+ glfwPollEvents();
+
+ /* Check if we are still running */
+ if (glfwWindowShouldClose(window))
+ break;
+ }
+
+ glfwTerminate();
+ exit( EXIT_SUCCESS );
+}
+
diff --git a/extern/glfw/examples/gears.c b/extern/glfw/examples/gears.c
new file mode 100644
index 0000000000..292f44b591
--- /dev/null
+++ b/extern/glfw/examples/gears.c
@@ -0,0 +1,360 @@
+/*
+ * 3-D gear wheels. This program is in the public domain.
+ *
+ * Command line options:
+ * -info print GL implementation information
+ * -exit automatically exit after 30 seconds
+ *
+ *
+ * Brian Paul
+ *
+ *
+ * Marcus Geelnard:
+ * - Conversion to GLFW
+ * - Time based rendering (frame rate independent)
+ * - Slightly modified camera that should work better for stereo viewing
+ *
+ *
+ * Camilla Löwy:
+ * - Removed FPS counter (this is not a benchmark)
+ * - Added a few comments
+ * - Enabled vsync
+ */
+
+#if defined(_MSC_VER)
+ // Make MS math.h define M_PI
+ #define _USE_MATH_DEFINES
+#endif
+
+#include
+#include
+#include