medfall

A super great game engine
Log | Files | Refs

glfw3.h (188781B)


      1 /*************************************************************************
      2  * GLFW 3.3 - www.glfw.org
      3  * A library for OpenGL, window and input
      4  *------------------------------------------------------------------------
      5  * Copyright (c) 2002-2006 Marcus Geelnard
      6  * Copyright (c) 2006-2016 Camilla Löwy <elmindreda@glfw.org>
      7  *
      8  * This software is provided 'as-is', without any express or implied
      9  * warranty. In no event will the authors be held liable for any damages
     10  * arising from the use of this software.
     11  *
     12  * Permission is granted to anyone to use this software for any purpose,
     13  * including commercial applications, and to alter it and redistribute it
     14  * freely, subject to the following restrictions:
     15  *
     16  * 1. The origin of this software must not be misrepresented; you must not
     17  *    claim that you wrote the original software. If you use this software
     18  *    in a product, an acknowledgment in the product documentation would
     19  *    be appreciated but is not required.
     20  *
     21  * 2. Altered source versions must be plainly marked as such, and must not
     22  *    be misrepresented as being the original software.
     23  *
     24  * 3. This notice may not be removed or altered from any source
     25  *    distribution.
     26  *
     27  *************************************************************************/
     28 
     29 #ifndef _glfw3_h_
     30 #define _glfw3_h_
     31 
     32 #ifdef __cplusplus
     33 extern "C" {
     34 #endif
     35 
     36 
     37 /*************************************************************************
     38  * Doxygen documentation
     39  *************************************************************************/
     40 
     41 /*! @file glfw3.h
     42  *  @brief The header of the GLFW 3 API.
     43  *
     44  *  This is the header file of the GLFW 3 API.  It defines all its types and
     45  *  declares all its functions.
     46  *
     47  *  For more information about how to use this file, see @ref build_include.
     48  */
     49 /*! @defgroup context Context reference
     50  *  @brief Functions and types related to OpenGL and OpenGL ES contexts.
     51  *
     52  *  This is the reference documentation for OpenGL and OpenGL ES context related
     53  *  functions.  For more task-oriented information, see the @ref context_guide.
     54  */
     55 /*! @defgroup vulkan Vulkan reference
     56  *  @brief Functions and types related to Vulkan.
     57  *
     58  *  This is the reference documentation for Vulkan related functions and types.
     59  *  For more task-oriented information, see the @ref vulkan_guide.
     60  */
     61 /*! @defgroup init Initialization, version and error reference
     62  *  @brief Functions and types related to initialization and error handling.
     63  *
     64  *  This is the reference documentation for initialization and termination of
     65  *  the library, version management and error handling.  For more task-oriented
     66  *  information, see the @ref intro_guide.
     67  */
     68 /*! @defgroup input Input reference
     69  *  @brief Functions and types related to input handling.
     70  *
     71  *  This is the reference documentation for input related functions and types.
     72  *  For more task-oriented information, see the @ref input_guide.
     73  */
     74 /*! @defgroup monitor Monitor reference
     75  *  @brief Functions and types related to monitors.
     76  *
     77  *  This is the reference documentation for monitor related functions and types.
     78  *  For more task-oriented information, see the @ref monitor_guide.
     79  */
     80 /*! @defgroup window Window reference
     81  *  @brief Functions and types related to windows.
     82  *
     83  *  This is the reference documentation for window related functions and types,
     84  *  including creation, deletion and event polling.  For more task-oriented
     85  *  information, see the @ref window_guide.
     86  */
     87 
     88 
     89 /*************************************************************************
     90  * Compiler- and platform-specific preprocessor work
     91  *************************************************************************/
     92 
     93 /* If we are we on Windows, we want a single define for it.
     94  */
     95 #if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__))
     96  #define _WIN32
     97 #endif /* _WIN32 */
     98 
     99 /* It is customary to use APIENTRY for OpenGL function pointer declarations on
    100  * all platforms.  Additionally, the Windows OpenGL header needs APIENTRY.
    101  */
    102 #ifndef APIENTRY
    103  #ifdef _WIN32
    104   #define APIENTRY __stdcall
    105  #else
    106   #define APIENTRY
    107  #endif
    108 #endif /* APIENTRY */
    109 
    110 /* Some Windows OpenGL headers need this.
    111  */
    112 #if !defined(WINGDIAPI) && defined(_WIN32)
    113  #define WINGDIAPI __declspec(dllimport)
    114  #define GLFW_WINGDIAPI_DEFINED
    115 #endif /* WINGDIAPI */
    116 
    117 /* Some Windows GLU headers need this.
    118  */
    119 #if !defined(CALLBACK) && defined(_WIN32)
    120  #define CALLBACK __stdcall
    121  #define GLFW_CALLBACK_DEFINED
    122 #endif /* CALLBACK */
    123 
    124 /* Include because most Windows GLU headers need wchar_t and
    125  * the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h.
    126  * Include it unconditionally to avoid surprising side-effects.
    127  */
    128 #include <stddef.h>
    129 
    130 /* Include because it is needed by Vulkan and related functions.
    131  * Include it unconditionally to avoid surprising side-effects.
    132  */
    133 #include <stdint.h>
    134 
    135 /* Include the chosen OpenGL or OpenGL ES headers.
    136  */
    137 #if defined(GLFW_INCLUDE_ES1)
    138 
    139  #include <GLES/gl.h>
    140  #if defined(GLFW_INCLUDE_GLEXT)
    141   #include <GLES/glext.h>
    142  #endif
    143 
    144 #elif defined(GLFW_INCLUDE_ES2)
    145 
    146  #include <GLES2/gl2.h>
    147  #if defined(GLFW_INCLUDE_GLEXT)
    148   #include <GLES2/gl2ext.h>
    149  #endif
    150 
    151 #elif defined(GLFW_INCLUDE_ES3)
    152 
    153  #include <GLES3/gl3.h>
    154  #if defined(GLFW_INCLUDE_GLEXT)
    155   #include <GLES2/gl2ext.h>
    156  #endif
    157 
    158 #elif defined(GLFW_INCLUDE_ES31)
    159 
    160  #include <GLES3/gl31.h>
    161  #if defined(GLFW_INCLUDE_GLEXT)
    162   #include <GLES2/gl2ext.h>
    163  #endif
    164 
    165 #elif defined(GLFW_INCLUDE_ES32)
    166 
    167  #include <GLES3/gl32.h>
    168  #if defined(GLFW_INCLUDE_GLEXT)
    169   #include <GLES2/gl2ext.h>
    170  #endif
    171 
    172 #elif defined(GLFW_INCLUDE_GLCOREARB)
    173 
    174  #if defined(__APPLE__)
    175 
    176   #include <OpenGL/gl3.h>
    177   #if defined(GLFW_INCLUDE_GLEXT)
    178    #include <OpenGL/gl3ext.h>
    179   #endif /*GLFW_INCLUDE_GLEXT*/
    180 
    181  #else /*__APPLE__*/
    182 
    183   #include <GL/glcorearb.h>
    184 
    185  #endif /*__APPLE__*/
    186 
    187 #elif !defined(GLFW_INCLUDE_NONE)
    188 
    189  #if defined(__APPLE__)
    190 
    191   #if !defined(GLFW_INCLUDE_GLEXT)
    192    #define GL_GLEXT_LEGACY
    193   #endif
    194   #include <OpenGL/gl.h>
    195   #if defined(GLFW_INCLUDE_GLU)
    196    #include <OpenGL/glu.h>
    197   #endif
    198 
    199  #else /*__APPLE__*/
    200 
    201   #include <GL/gl.h>
    202   #if defined(GLFW_INCLUDE_GLEXT)
    203    #include <GL/glext.h>
    204   #endif
    205   #if defined(GLFW_INCLUDE_GLU)
    206    #include <GL/glu.h>
    207   #endif
    208 
    209  #endif /*__APPLE__*/
    210 
    211 #endif /* OpenGL and OpenGL ES headers */
    212 
    213 #if defined(GLFW_INCLUDE_VULKAN)
    214   #include <vulkan/vulkan.h>
    215 #endif /* Vulkan header */
    216 
    217 #if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL)
    218  /* GLFW_DLL must be defined by applications that are linking against the DLL
    219   * version of the GLFW library.  _GLFW_BUILD_DLL is defined by the GLFW
    220   * configuration header when compiling the DLL version of the library.
    221   */
    222  #error "You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined"
    223 #endif
    224 
    225 /* GLFWAPI is used to declare public API functions for export
    226  * from the DLL / shared library / dynamic library.
    227  */
    228 #if defined(_WIN32) && defined(_GLFW_BUILD_DLL)
    229  /* We are building GLFW as a Win32 DLL */
    230  #define GLFWAPI __declspec(dllexport)
    231 #elif defined(_WIN32) && defined(GLFW_DLL)
    232  /* We are calling GLFW as a Win32 DLL */
    233  #define GLFWAPI __declspec(dllimport)
    234 #elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL)
    235  /* We are building GLFW as a shared / dynamic library */
    236  #define GLFWAPI __attribute__((visibility("default")))
    237 #else
    238  /* We are building or calling GLFW as a static library */
    239  #define GLFWAPI
    240 #endif
    241 
    242 
    243 /*************************************************************************
    244  * GLFW API tokens
    245  *************************************************************************/
    246 
    247 /*! @name GLFW version macros
    248  *  @{ */
    249 /*! @brief The major version number of the GLFW library.
    250  *
    251  *  This is incremented when the API is changed in non-compatible ways.
    252  *  @ingroup init
    253  */
    254 #define GLFW_VERSION_MAJOR          3
    255 /*! @brief The minor version number of the GLFW library.
    256  *
    257  *  This is incremented when features are added to the API but it remains
    258  *  backward-compatible.
    259  *  @ingroup init
    260  */
    261 #define GLFW_VERSION_MINOR          3
    262 /*! @brief The revision number of the GLFW library.
    263  *
    264  *  This is incremented when a bug fix release is made that does not contain any
    265  *  API changes.
    266  *  @ingroup init
    267  */
    268 #define GLFW_VERSION_REVISION       0
    269 /*! @} */
    270 
    271 /*! @name Boolean values
    272  *  @{ */
    273 /*! @brief One.
    274  *
    275  *  One.  Seriously.  You don't _need_ to use this symbol in your code.  It's
    276  *  just semantic sugar for the number 1.  You can use `1` or `true` or `_True`
    277  *  or `GL_TRUE` or whatever you want.
    278  */
    279 #define GLFW_TRUE                   1
    280 /*! @brief Zero.
    281  *
    282  *  Zero.  Seriously.  You don't _need_ to use this symbol in your code.  It's
    283  *  just just semantic sugar for the number 0.  You can use `0` or `false` or
    284  *  `_False` or `GL_FALSE` or whatever you want.
    285  */
    286 #define GLFW_FALSE                  0
    287 /*! @} */
    288 
    289 /*! @name Key and button actions
    290  *  @{ */
    291 /*! @brief The key or mouse button was released.
    292  *
    293  *  The key or mouse button was released.
    294  *
    295  *  @ingroup input
    296  */
    297 #define GLFW_RELEASE                0
    298 /*! @brief The key or mouse button was pressed.
    299  *
    300  *  The key or mouse button was pressed.
    301  *
    302  *  @ingroup input
    303  */
    304 #define GLFW_PRESS                  1
    305 /*! @brief The key was held down until it repeated.
    306  *
    307  *  The key was held down until it repeated.
    308  *
    309  *  @ingroup input
    310  */
    311 #define GLFW_REPEAT                 2
    312 /*! @} */
    313 
    314 /*! @defgroup hat_state Joystick hat states
    315  *
    316  *  See [joystick hat input](@ref joystick_hat) for how these are used.
    317  *
    318  *  @ingroup input
    319  *  @{ */
    320 #define GLFW_HAT_CENTERED           0
    321 #define GLFW_HAT_UP                 1
    322 #define GLFW_HAT_RIGHT              2
    323 #define GLFW_HAT_DOWN               4
    324 #define GLFW_HAT_LEFT               8
    325 #define GLFW_HAT_RIGHT_UP           (GLFW_HAT_RIGHT | GLFW_HAT_UP)
    326 #define GLFW_HAT_RIGHT_DOWN         (GLFW_HAT_RIGHT | GLFW_HAT_DOWN)
    327 #define GLFW_HAT_LEFT_UP            (GLFW_HAT_LEFT  | GLFW_HAT_UP)
    328 #define GLFW_HAT_LEFT_DOWN          (GLFW_HAT_LEFT  | GLFW_HAT_DOWN)
    329 /*! @} */
    330 
    331 /*! @defgroup keys Keyboard keys
    332  *  @brief Keyboard key IDs.
    333  *
    334  *  See [key input](@ref input_key) for how these are used.
    335  *
    336  *  These key codes are inspired by the _USB HID Usage Tables v1.12_ (p. 53-60),
    337  *  but re-arranged to map to 7-bit ASCII for printable keys (function keys are
    338  *  put in the 256+ range).
    339  *
    340  *  The naming of the key codes follow these rules:
    341  *   - The US keyboard layout is used
    342  *   - Names of printable alpha-numeric characters are used (e.g. "A", "R",
    343  *     "3", etc.)
    344  *   - For non-alphanumeric characters, Unicode:ish names are used (e.g.
    345  *     "COMMA", "LEFT_SQUARE_BRACKET", etc.). Note that some names do not
    346  *     correspond to the Unicode standard (usually for brevity)
    347  *   - Keys that lack a clear US mapping are named "WORLD_x"
    348  *   - For non-printable keys, custom names are used (e.g. "F4",
    349  *     "BACKSPACE", etc.)
    350  *
    351  *  @ingroup input
    352  *  @{
    353  */
    354 
    355 /* The unknown key */
    356 #define GLFW_KEY_UNKNOWN            -1
    357 
    358 /* Printable keys */
    359 #define GLFW_KEY_SPACE              32
    360 #define GLFW_KEY_APOSTROPHE         39  /* ' */
    361 #define GLFW_KEY_COMMA              44  /* , */
    362 #define GLFW_KEY_MINUS              45  /* - */
    363 #define GLFW_KEY_PERIOD             46  /* . */
    364 #define GLFW_KEY_SLASH              47  /* / */
    365 #define GLFW_KEY_0                  48
    366 #define GLFW_KEY_1                  49
    367 #define GLFW_KEY_2                  50
    368 #define GLFW_KEY_3                  51
    369 #define GLFW_KEY_4                  52
    370 #define GLFW_KEY_5                  53
    371 #define GLFW_KEY_6                  54
    372 #define GLFW_KEY_7                  55
    373 #define GLFW_KEY_8                  56
    374 #define GLFW_KEY_9                  57
    375 #define GLFW_KEY_SEMICOLON          59  /* ; */
    376 #define GLFW_KEY_EQUAL              61  /* = */
    377 #define GLFW_KEY_A                  65
    378 #define GLFW_KEY_B                  66
    379 #define GLFW_KEY_C                  67
    380 #define GLFW_KEY_D                  68
    381 #define GLFW_KEY_E                  69
    382 #define GLFW_KEY_F                  70
    383 #define GLFW_KEY_G                  71
    384 #define GLFW_KEY_H                  72
    385 #define GLFW_KEY_I                  73
    386 #define GLFW_KEY_J                  74
    387 #define GLFW_KEY_K                  75
    388 #define GLFW_KEY_L                  76
    389 #define GLFW_KEY_M                  77
    390 #define GLFW_KEY_N                  78
    391 #define GLFW_KEY_O                  79
    392 #define GLFW_KEY_P                  80
    393 #define GLFW_KEY_Q                  81
    394 #define GLFW_KEY_R                  82
    395 #define GLFW_KEY_S                  83
    396 #define GLFW_KEY_T                  84
    397 #define GLFW_KEY_U                  85
    398 #define GLFW_KEY_V                  86
    399 #define GLFW_KEY_W                  87
    400 #define GLFW_KEY_X                  88
    401 #define GLFW_KEY_Y                  89
    402 #define GLFW_KEY_Z                  90
    403 #define GLFW_KEY_LEFT_BRACKET       91  /* [ */
    404 #define GLFW_KEY_BACKSLASH          92  /* \ */
    405 #define GLFW_KEY_RIGHT_BRACKET      93  /* ] */
    406 #define GLFW_KEY_GRAVE_ACCENT       96  /* ` */
    407 #define GLFW_KEY_WORLD_1            161 /* non-US #1 */
    408 #define GLFW_KEY_WORLD_2            162 /* non-US #2 */
    409 
    410 /* Function keys */
    411 #define GLFW_KEY_ESCAPE             256
    412 #define GLFW_KEY_ENTER              257
    413 #define GLFW_KEY_TAB                258
    414 #define GLFW_KEY_BACKSPACE          259
    415 #define GLFW_KEY_INSERT             260
    416 #define GLFW_KEY_DELETE             261
    417 #define GLFW_KEY_RIGHT              262
    418 #define GLFW_KEY_LEFT               263
    419 #define GLFW_KEY_DOWN               264
    420 #define GLFW_KEY_UP                 265
    421 #define GLFW_KEY_PAGE_UP            266
    422 #define GLFW_KEY_PAGE_DOWN          267
    423 #define GLFW_KEY_HOME               268
    424 #define GLFW_KEY_END                269
    425 #define GLFW_KEY_CAPS_LOCK          280
    426 #define GLFW_KEY_SCROLL_LOCK        281
    427 #define GLFW_KEY_NUM_LOCK           282
    428 #define GLFW_KEY_PRINT_SCREEN       283
    429 #define GLFW_KEY_PAUSE              284
    430 #define GLFW_KEY_F1                 290
    431 #define GLFW_KEY_F2                 291
    432 #define GLFW_KEY_F3                 292
    433 #define GLFW_KEY_F4                 293
    434 #define GLFW_KEY_F5                 294
    435 #define GLFW_KEY_F6                 295
    436 #define GLFW_KEY_F7                 296
    437 #define GLFW_KEY_F8                 297
    438 #define GLFW_KEY_F9                 298
    439 #define GLFW_KEY_F10                299
    440 #define GLFW_KEY_F11                300
    441 #define GLFW_KEY_F12                301
    442 #define GLFW_KEY_F13                302
    443 #define GLFW_KEY_F14                303
    444 #define GLFW_KEY_F15                304
    445 #define GLFW_KEY_F16                305
    446 #define GLFW_KEY_F17                306
    447 #define GLFW_KEY_F18                307
    448 #define GLFW_KEY_F19                308
    449 #define GLFW_KEY_F20                309
    450 #define GLFW_KEY_F21                310
    451 #define GLFW_KEY_F22                311
    452 #define GLFW_KEY_F23                312
    453 #define GLFW_KEY_F24                313
    454 #define GLFW_KEY_F25                314
    455 #define GLFW_KEY_KP_0               320
    456 #define GLFW_KEY_KP_1               321
    457 #define GLFW_KEY_KP_2               322
    458 #define GLFW_KEY_KP_3               323
    459 #define GLFW_KEY_KP_4               324
    460 #define GLFW_KEY_KP_5               325
    461 #define GLFW_KEY_KP_6               326
    462 #define GLFW_KEY_KP_7               327
    463 #define GLFW_KEY_KP_8               328
    464 #define GLFW_KEY_KP_9               329
    465 #define GLFW_KEY_KP_DECIMAL         330
    466 #define GLFW_KEY_KP_DIVIDE          331
    467 #define GLFW_KEY_KP_MULTIPLY        332
    468 #define GLFW_KEY_KP_SUBTRACT        333
    469 #define GLFW_KEY_KP_ADD             334
    470 #define GLFW_KEY_KP_ENTER           335
    471 #define GLFW_KEY_KP_EQUAL           336
    472 #define GLFW_KEY_LEFT_SHIFT         340
    473 #define GLFW_KEY_LEFT_CONTROL       341
    474 #define GLFW_KEY_LEFT_ALT           342
    475 #define GLFW_KEY_LEFT_SUPER         343
    476 #define GLFW_KEY_RIGHT_SHIFT        344
    477 #define GLFW_KEY_RIGHT_CONTROL      345
    478 #define GLFW_KEY_RIGHT_ALT          346
    479 #define GLFW_KEY_RIGHT_SUPER        347
    480 #define GLFW_KEY_MENU               348
    481 
    482 #define GLFW_KEY_LAST               GLFW_KEY_MENU
    483 
    484 /*! @} */
    485 
    486 /*! @defgroup mods Modifier key flags
    487  *  @brief Modifier key flags.
    488  *
    489  *  See [key input](@ref input_key) for how these are used.
    490  *
    491  *  @ingroup input
    492  *  @{ */
    493 
    494 /*! @brief If this bit is set one or more Shift keys were held down.
    495  */
    496 #define GLFW_MOD_SHIFT           0x0001
    497 /*! @brief If this bit is set one or more Control keys were held down.
    498  */
    499 #define GLFW_MOD_CONTROL         0x0002
    500 /*! @brief If this bit is set one or more Alt keys were held down.
    501  */
    502 #define GLFW_MOD_ALT             0x0004
    503 /*! @brief If this bit is set one or more Super keys were held down.
    504  */
    505 #define GLFW_MOD_SUPER           0x0008
    506 
    507 /*! @} */
    508 
    509 /*! @defgroup buttons Mouse buttons
    510  *  @brief Mouse button IDs.
    511  *
    512  *  See [mouse button input](@ref input_mouse_button) for how these are used.
    513  *
    514  *  @ingroup input
    515  *  @{ */
    516 #define GLFW_MOUSE_BUTTON_1         0
    517 #define GLFW_MOUSE_BUTTON_2         1
    518 #define GLFW_MOUSE_BUTTON_3         2
    519 #define GLFW_MOUSE_BUTTON_4         3
    520 #define GLFW_MOUSE_BUTTON_5         4
    521 #define GLFW_MOUSE_BUTTON_6         5
    522 #define GLFW_MOUSE_BUTTON_7         6
    523 #define GLFW_MOUSE_BUTTON_8         7
    524 #define GLFW_MOUSE_BUTTON_LAST      GLFW_MOUSE_BUTTON_8
    525 #define GLFW_MOUSE_BUTTON_LEFT      GLFW_MOUSE_BUTTON_1
    526 #define GLFW_MOUSE_BUTTON_RIGHT     GLFW_MOUSE_BUTTON_2
    527 #define GLFW_MOUSE_BUTTON_MIDDLE    GLFW_MOUSE_BUTTON_3
    528 /*! @} */
    529 
    530 /*! @defgroup joysticks Joysticks
    531  *  @brief Joystick IDs.
    532  *
    533  *  See [joystick input](@ref joystick) for how these are used.
    534  *
    535  *  @ingroup input
    536  *  @{ */
    537 #define GLFW_JOYSTICK_1             0
    538 #define GLFW_JOYSTICK_2             1
    539 #define GLFW_JOYSTICK_3             2
    540 #define GLFW_JOYSTICK_4             3
    541 #define GLFW_JOYSTICK_5             4
    542 #define GLFW_JOYSTICK_6             5
    543 #define GLFW_JOYSTICK_7             6
    544 #define GLFW_JOYSTICK_8             7
    545 #define GLFW_JOYSTICK_9             8
    546 #define GLFW_JOYSTICK_10            9
    547 #define GLFW_JOYSTICK_11            10
    548 #define GLFW_JOYSTICK_12            11
    549 #define GLFW_JOYSTICK_13            12
    550 #define GLFW_JOYSTICK_14            13
    551 #define GLFW_JOYSTICK_15            14
    552 #define GLFW_JOYSTICK_16            15
    553 #define GLFW_JOYSTICK_LAST          GLFW_JOYSTICK_16
    554 /*! @} */
    555 
    556 /*! @defgroup gamepad_buttons Gamepad buttons
    557  *  @brief Gamepad buttons.
    558  *
    559  *  See @ref gamepad for how these are used.
    560  *
    561  *  @ingroup input
    562  *  @{ */
    563 #define GLFW_GAMEPAD_BUTTON_A               0
    564 #define GLFW_GAMEPAD_BUTTON_B               1
    565 #define GLFW_GAMEPAD_BUTTON_X               2
    566 #define GLFW_GAMEPAD_BUTTON_Y               3
    567 #define GLFW_GAMEPAD_BUTTON_LEFT_BUMPER     4
    568 #define GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER    5
    569 #define GLFW_GAMEPAD_BUTTON_BACK            6
    570 #define GLFW_GAMEPAD_BUTTON_START           7
    571 #define GLFW_GAMEPAD_BUTTON_GUIDE           8
    572 #define GLFW_GAMEPAD_BUTTON_LEFT_THUMB      9
    573 #define GLFW_GAMEPAD_BUTTON_RIGHT_THUMB     10
    574 #define GLFW_GAMEPAD_BUTTON_DPAD_UP         11
    575 #define GLFW_GAMEPAD_BUTTON_DPAD_RIGHT      12
    576 #define GLFW_GAMEPAD_BUTTON_DPAD_DOWN       13
    577 #define GLFW_GAMEPAD_BUTTON_DPAD_LEFT       14
    578 #define GLFW_GAMEPAD_BUTTON_LAST            GLFW_GAMEPAD_BUTTON_DPAD_LEFT
    579 
    580 #define GLFW_GAMEPAD_BUTTON_CROSS       GLFW_GAMEPAD_BUTTON_A
    581 #define GLFW_GAMEPAD_BUTTON_CIRCLE      GLFW_GAMEPAD_BUTTON_B
    582 #define GLFW_GAMEPAD_BUTTON_SQUARE      GLFW_GAMEPAD_BUTTON_X
    583 #define GLFW_GAMEPAD_BUTTON_TRIANGLE    GLFW_GAMEPAD_BUTTON_Y
    584 /*! @} */
    585 
    586 /*! @defgroup gamepad_axes Gamepad axes
    587  *  @brief Gamepad axes.
    588  *
    589  *  See @ref gamepad for how these are used.
    590  *
    591  *  @ingroup input
    592  *  @{ */
    593 #define GLFW_GAMEPAD_AXIS_LEFT_X        0
    594 #define GLFW_GAMEPAD_AXIS_LEFT_Y        1
    595 #define GLFW_GAMEPAD_AXIS_RIGHT_X       2
    596 #define GLFW_GAMEPAD_AXIS_RIGHT_Y       3
    597 #define GLFW_GAMEPAD_AXIS_LEFT_TRIGGER  4
    598 #define GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER 5
    599 #define GLFW_GAMEPAD_AXIS_LAST          GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER
    600 /*! @} */
    601 
    602 /*! @defgroup errors Error codes
    603  *  @brief Error codes.
    604  *
    605  *  See [error handling](@ref error_handling) for how these are used.
    606  *
    607  *  @ingroup init
    608  *  @{ */
    609 /*! @brief No error has occurred.
    610  *
    611  *  No error has occurred.
    612  *
    613  *  @analysis Yay.
    614  */
    615 #define GLFW_NO_ERROR               0
    616 /*! @brief GLFW has not been initialized.
    617  *
    618  *  This occurs if a GLFW function was called that must not be called unless the
    619  *  library is [initialized](@ref intro_init).
    620  *
    621  *  @analysis Application programmer error.  Initialize GLFW before calling any
    622  *  function that requires initialization.
    623  */
    624 #define GLFW_NOT_INITIALIZED        0x00010001
    625 /*! @brief No context is current for this thread.
    626  *
    627  *  This occurs if a GLFW function was called that needs and operates on the
    628  *  current OpenGL or OpenGL ES context but no context is current on the calling
    629  *  thread.  One such function is @ref glfwSwapInterval.
    630  *
    631  *  @analysis Application programmer error.  Ensure a context is current before
    632  *  calling functions that require a current context.
    633  */
    634 #define GLFW_NO_CURRENT_CONTEXT     0x00010002
    635 /*! @brief One of the arguments to the function was an invalid enum value.
    636  *
    637  *  One of the arguments to the function was an invalid enum value, for example
    638  *  requesting @ref GLFW_RED_BITS with @ref glfwGetWindowAttrib.
    639  *
    640  *  @analysis Application programmer error.  Fix the offending call.
    641  */
    642 #define GLFW_INVALID_ENUM           0x00010003
    643 /*! @brief One of the arguments to the function was an invalid value.
    644  *
    645  *  One of the arguments to the function was an invalid value, for example
    646  *  requesting a non-existent OpenGL or OpenGL ES version like 2.7.
    647  *
    648  *  Requesting a valid but unavailable OpenGL or OpenGL ES version will instead
    649  *  result in a @ref GLFW_VERSION_UNAVAILABLE error.
    650  *
    651  *  @analysis Application programmer error.  Fix the offending call.
    652  */
    653 #define GLFW_INVALID_VALUE          0x00010004
    654 /*! @brief A memory allocation failed.
    655  *
    656  *  A memory allocation failed.
    657  *
    658  *  @analysis A bug in GLFW or the underlying operating system.  Report the bug
    659  *  to our [issue tracker](https://github.com/glfw/glfw/issues).
    660  */
    661 #define GLFW_OUT_OF_MEMORY          0x00010005
    662 /*! @brief GLFW could not find support for the requested API on the system.
    663  *
    664  *  GLFW could not find support for the requested API on the system.
    665  *
    666  *  @analysis The installed graphics driver does not support the requested
    667  *  API, or does not support it via the chosen context creation backend.
    668  *  Below are a few examples.
    669  *
    670  *  @par
    671  *  Some pre-installed Windows graphics drivers do not support OpenGL.  AMD only
    672  *  supports OpenGL ES via EGL, while Nvidia and Intel only support it via
    673  *  a WGL or GLX extension.  macOS does not provide OpenGL ES at all.  The Mesa
    674  *  EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary
    675  *  driver.  Older graphics drivers do not support Vulkan.
    676  */
    677 #define GLFW_API_UNAVAILABLE        0x00010006
    678 /*! @brief The requested OpenGL or OpenGL ES version is not available.
    679  *
    680  *  The requested OpenGL or OpenGL ES version (including any requested context
    681  *  or framebuffer hints) is not available on this machine.
    682  *
    683  *  @analysis The machine does not support your requirements.  If your
    684  *  application is sufficiently flexible, downgrade your requirements and try
    685  *  again.  Otherwise, inform the user that their machine does not match your
    686  *  requirements.
    687  *
    688  *  @par
    689  *  Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0
    690  *  comes out before the 4.x series gets that far, also fail with this error and
    691  *  not @ref GLFW_INVALID_VALUE, because GLFW cannot know what future versions
    692  *  will exist.
    693  */
    694 #define GLFW_VERSION_UNAVAILABLE    0x00010007
    695 /*! @brief A platform-specific error occurred that does not match any of the
    696  *  more specific categories.
    697  *
    698  *  A platform-specific error occurred that does not match any of the more
    699  *  specific categories.
    700  *
    701  *  @analysis A bug or configuration error in GLFW, the underlying operating
    702  *  system or its drivers, or a lack of required resources.  Report the issue to
    703  *  our [issue tracker](https://github.com/glfw/glfw/issues).
    704  */
    705 #define GLFW_PLATFORM_ERROR         0x00010008
    706 /*! @brief The requested format is not supported or available.
    707  *
    708  *  If emitted during window creation, the requested pixel format is not
    709  *  supported.
    710  *
    711  *  If emitted when querying the clipboard, the contents of the clipboard could
    712  *  not be converted to the requested format.
    713  *
    714  *  @analysis If emitted during window creation, one or more
    715  *  [hard constraints](@ref window_hints_hard) did not match any of the
    716  *  available pixel formats.  If your application is sufficiently flexible,
    717  *  downgrade your requirements and try again.  Otherwise, inform the user that
    718  *  their machine does not match your requirements.
    719  *
    720  *  @par
    721  *  If emitted when querying the clipboard, ignore the error or report it to
    722  *  the user, as appropriate.
    723  */
    724 #define GLFW_FORMAT_UNAVAILABLE     0x00010009
    725 /*! @brief The specified window does not have an OpenGL or OpenGL ES context.
    726  *
    727  *  A window that does not have an OpenGL or OpenGL ES context was passed to
    728  *  a function that requires it to have one.
    729  *
    730  *  @analysis Application programmer error.  Fix the offending call.
    731  */
    732 #define GLFW_NO_WINDOW_CONTEXT      0x0001000A
    733 /*! @} */
    734 
    735 /*! @addtogroup window
    736  *  @{ */
    737 /*! @brief Input focus window hint and attribute
    738  *
    739  *  Input focus [window hint](@ref GLFW_FOCUSED_hint) or
    740  *  [window attribute](@ref GLFW_FOCUSED_attrib).
    741  */
    742 #define GLFW_FOCUSED                0x00020001
    743 /*! @brief Window iconification window attribute
    744  *
    745  *  Window iconification [window attribute](@ref GLFW_ICONIFIED_attrib).
    746  */
    747 #define GLFW_ICONIFIED              0x00020002
    748 /*! @brief Window resize-ability window hint and attribute
    749  *
    750  *  Window resize-ability [window hint](@ref GLFW_RESIZABLE_hint) and
    751  *  [window attribute](@ref GLFW_RESIZABLE_attrib).
    752  */
    753 #define GLFW_RESIZABLE              0x00020003
    754 /*! @brief Window visibility window hint and attribute
    755  *
    756  *  Window visibility [window hint](@ref GLFW_VISIBLE_hint) and
    757  *  [window attribute](@ref GLFW_VISIBLE_attrib).
    758  */
    759 #define GLFW_VISIBLE                0x00020004
    760 /*! @brief Window decoration window hint and attribute
    761  *
    762  *  Window decoration [window hint](@ref GLFW_DECORATED_hint) and
    763  *  [window attribute](@ref GLFW_DECORATED_attrib).
    764  */
    765 #define GLFW_DECORATED              0x00020005
    766 /*! @brief Window auto-iconification window hint and attribute
    767  *
    768  *  Window auto-iconification [window hint](@ref GLFW_AUTO_ICONIFY_hint) and
    769  *  [window attribute](@ref GLFW_AUTO_ICONIFY_attrib).
    770  */
    771 #define GLFW_AUTO_ICONIFY           0x00020006
    772 /*! @brief Window decoration window hint and attribute
    773  *
    774  *  Window decoration [window hint](@ref GLFW_FLOATING_hint) and
    775  *  [window attribute](@ref GLFW_FLOATING_attrib).
    776  */
    777 #define GLFW_FLOATING               0x00020007
    778 /*! @brief Window maximization window hint and attribute
    779  *
    780  *  Window maximization [window hint](@ref GLFW_MAXIMIZED_hint) and
    781  *  [window attribute](@ref GLFW_MAXIMIZED_attrib).
    782  */
    783 #define GLFW_MAXIMIZED              0x00020008
    784 /*! @brief Cursor centering window hint
    785  *
    786  *  Cursor centering [window hint](@ref GLFW_CENTER_CURSOR_hint).
    787  */
    788 #define GLFW_CENTER_CURSOR          0x00020009
    789 
    790 /*! @brief Framebuffer bit depth hint.
    791  *
    792  *  Framebuffer bit depth [hint](@ref GLFW_RED_BITS).
    793  */
    794 #define GLFW_RED_BITS               0x00021001
    795 /*! @brief Framebuffer bit depth hint.
    796  *
    797  *  Framebuffer bit depth [hint](@ref GLFW_GREEN_BITS).
    798  */
    799 #define GLFW_GREEN_BITS             0x00021002
    800 /*! @brief Framebuffer bit depth hint.
    801  *
    802  *  Framebuffer bit depth [hint](@ref GLFW_BLUE_BITS).
    803  */
    804 #define GLFW_BLUE_BITS              0x00021003
    805 /*! @brief Framebuffer bit depth hint.
    806  *
    807  *  Framebuffer bit depth [hint](@ref GLFW_ALPHA_BITS).
    808  */
    809 #define GLFW_ALPHA_BITS             0x00021004
    810 /*! @brief Framebuffer bit depth hint.
    811  *
    812  *  Framebuffer bit depth [hint](@ref GLFW_DEPTH_BITS).
    813  */
    814 #define GLFW_DEPTH_BITS             0x00021005
    815 /*! @brief Framebuffer bit depth hint.
    816  *
    817  *  Framebuffer bit depth [hint](@ref GLFW_STENCIL_BITS).
    818  */
    819 #define GLFW_STENCIL_BITS           0x00021006
    820 /*! @brief Framebuffer bit depth hint.
    821  *
    822  *  Framebuffer bit depth [hint](@ref GLFW_ACCUM_RED_BITS).
    823  */
    824 #define GLFW_ACCUM_RED_BITS         0x00021007
    825 /*! @brief Framebuffer bit depth hint.
    826  *
    827  *  Framebuffer bit depth [hint](@ref GLFW_ACCUM_GREEN_BITS).
    828  */
    829 #define GLFW_ACCUM_GREEN_BITS       0x00021008
    830 /*! @brief Framebuffer bit depth hint.
    831  *
    832  *  Framebuffer bit depth [hint](@ref GLFW_ACCUM_BLUE_BITS).
    833  */
    834 #define GLFW_ACCUM_BLUE_BITS        0x00021009
    835 /*! @brief Framebuffer bit depth hint.
    836  *
    837  *  Framebuffer bit depth [hint](@ref GLFW_ACCUM_ALPHA_BITS).
    838  */
    839 #define GLFW_ACCUM_ALPHA_BITS       0x0002100A
    840 /*! @brief Framebuffer auxiliary buffer hint.
    841  *
    842  *  Framebuffer auxiliary buffer [hint](@ref GLFW_AUX_BUFFERS).
    843  */
    844 #define GLFW_AUX_BUFFERS            0x0002100B
    845 /*! @brief OpenGL stereoscopic rendering hint.
    846  *
    847  *  OpenGL stereoscopic rendering [hint](@ref GLFW_STEREO).
    848  */
    849 #define GLFW_STEREO                 0x0002100C
    850 /*! @brief Framebuffer MSAA samples hint.
    851  *
    852  *  Framebuffer MSAA samples [hint](@ref GLFW_SAMPLES).
    853  */
    854 #define GLFW_SAMPLES                0x0002100D
    855 /*! @brief Framebuffer sRGB hint.
    856  *
    857  *  Framebuffer sRGB [hint](@ref GLFW_SRGB_CAPABLE).
    858  */
    859 #define GLFW_SRGB_CAPABLE           0x0002100E
    860 /*! @brief Monitor refresh rate hint.
    861  *
    862  *  Monitor refresh rate [hint](@ref GLFW_REFRESH_RATE).
    863  */
    864 #define GLFW_REFRESH_RATE           0x0002100F
    865 /*! @brief Framebuffer double buffering hint.
    866  *
    867  *  Framebuffer double buffering [hint](@ref GLFW_DOUBLEBUFFER).
    868  */
    869 #define GLFW_DOUBLEBUFFER           0x00021010
    870 /*! @brief Context client API hint and attribute.
    871  *
    872  *  Context client API [hint](@ref GLFW_CLIENT_API_hint) and
    873  *  [attribute](@ref GLFW_CLIENT_API_attrib).
    874  */
    875 #define GLFW_CLIENT_API             0x00022001
    876 /*! @brief Context client API major version hint and attribute.
    877  *
    878  *  Context client API major version [hint](@ref GLFW_CLIENT_API_hint) and
    879  *  [attribute](@ref GLFW_CLIENT_API_attrib).
    880  */
    881 #define GLFW_CONTEXT_VERSION_MAJOR  0x00022002
    882 /*! @brief Context client API minor version hint and attribute.
    883  *
    884  *  Context client API minor version [hint](@ref GLFW_CLIENT_API_hint) and
    885  *  [attribute](@ref GLFW_CLIENT_API_attrib).
    886  */
    887 #define GLFW_CONTEXT_VERSION_MINOR  0x00022003
    888 /*! @brief Context client API revision number hint and attribute.
    889  *
    890  *  Context client API revision number [hint](@ref GLFW_CLIENT_API_hint) and
    891  *  [attribute](@ref GLFW_CLIENT_API_attrib).
    892  */
    893 #define GLFW_CONTEXT_REVISION       0x00022004
    894 /*! @brief Context robustness hint and attribute.
    895  *
    896  *  Context client API revision number [hint](@ref GLFW_CLIENT_API_hint) and
    897  *  [attribute](@ref GLFW_CLIENT_API_attrib).
    898  */
    899 #define GLFW_CONTEXT_ROBUSTNESS     0x00022005
    900 /*! @brief OpenGL forward-compatibility hint and attribute.
    901  *
    902  *  OpenGL forward-compatibility [hint](@ref GLFW_CLIENT_API_hint) and
    903  *  [attribute](@ref GLFW_CLIENT_API_attrib).
    904  */
    905 #define GLFW_OPENGL_FORWARD_COMPAT  0x00022006
    906 /*! @brief OpenGL debug context hint and attribute.
    907  *
    908  *  OpenGL debug context [hint](@ref GLFW_CLIENT_API_hint) and
    909  *  [attribute](@ref GLFW_CLIENT_API_attrib).
    910  */
    911 #define GLFW_OPENGL_DEBUG_CONTEXT   0x00022007
    912 /*! @brief OpenGL profile hint and attribute.
    913  *
    914  *  OpenGL profile [hint](@ref GLFW_CLIENT_API_hint) and
    915  *  [attribute](@ref GLFW_CLIENT_API_attrib).
    916  */
    917 #define GLFW_OPENGL_PROFILE         0x00022008
    918 /*! @brief Context flush-on-release hint and attribute.
    919  *
    920  *  Context flush-on-release [hint](@ref GLFW_CLIENT_API_hint) and
    921  *  [attribute](@ref GLFW_CLIENT_API_attrib).
    922  */
    923 #define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009
    924 /*! @brief Context error suppression hint and attribute.
    925  *
    926  *  Context error suppression [hint](@ref GLFW_CLIENT_API_hint) and
    927  *  [attribute](@ref GLFW_CLIENT_API_attrib).
    928  */
    929 #define GLFW_CONTEXT_NO_ERROR       0x0002200A
    930 /*! @brief Context creation API hint and attribute.
    931  *
    932  *  Context creation API [hint](@ref GLFW_CLIENT_API_hint) and
    933  *  [attribute](@ref GLFW_CLIENT_API_attrib).
    934  */
    935 #define GLFW_CONTEXT_CREATION_API   0x0002200B
    936 
    937 #define GLFW_COCOA_RETINA_FRAMEBUFFER 0x00023001
    938 #define GLFW_COCOA_FRAME_AUTOSAVE     0x00023002
    939 #define GLFW_COCOA_GRAPHICS_SWITCHING 0x00023003
    940 /*! @} */
    941 
    942 #define GLFW_NO_API                          0
    943 #define GLFW_OPENGL_API             0x00030001
    944 #define GLFW_OPENGL_ES_API          0x00030002
    945 
    946 #define GLFW_NO_ROBUSTNESS                   0
    947 #define GLFW_NO_RESET_NOTIFICATION  0x00031001
    948 #define GLFW_LOSE_CONTEXT_ON_RESET  0x00031002
    949 
    950 #define GLFW_OPENGL_ANY_PROFILE              0
    951 #define GLFW_OPENGL_CORE_PROFILE    0x00032001
    952 #define GLFW_OPENGL_COMPAT_PROFILE  0x00032002
    953 
    954 #define GLFW_CURSOR                 0x00033001
    955 #define GLFW_STICKY_KEYS            0x00033002
    956 #define GLFW_STICKY_MOUSE_BUTTONS   0x00033003
    957 
    958 #define GLFW_CURSOR_NORMAL          0x00034001
    959 #define GLFW_CURSOR_HIDDEN          0x00034002
    960 #define GLFW_CURSOR_DISABLED        0x00034003
    961 
    962 #define GLFW_ANY_RELEASE_BEHAVIOR            0
    963 #define GLFW_RELEASE_BEHAVIOR_FLUSH 0x00035001
    964 #define GLFW_RELEASE_BEHAVIOR_NONE  0x00035002
    965 
    966 #define GLFW_NATIVE_CONTEXT_API     0x00036001
    967 #define GLFW_EGL_CONTEXT_API        0x00036002
    968 #define GLFW_OSMESA_CONTEXT_API     0x00036003
    969 
    970 /*! @defgroup shapes Standard cursor shapes
    971  *  @brief Standard system cursor shapes.
    972  *
    973  *  See [standard cursor creation](@ref cursor_standard) for how these are used.
    974  *
    975  *  @ingroup input
    976  *  @{ */
    977 
    978 /*! @brief The regular arrow cursor shape.
    979  *
    980  *  The regular arrow cursor.
    981  */
    982 #define GLFW_ARROW_CURSOR           0x00036001
    983 /*! @brief The text input I-beam cursor shape.
    984  *
    985  *  The text input I-beam cursor shape.
    986  */
    987 #define GLFW_IBEAM_CURSOR           0x00036002
    988 /*! @brief The crosshair shape.
    989  *
    990  *  The crosshair shape.
    991  */
    992 #define GLFW_CROSSHAIR_CURSOR       0x00036003
    993 /*! @brief The hand shape.
    994  *
    995  *  The hand shape.
    996  */
    997 #define GLFW_HAND_CURSOR            0x00036004
    998 /*! @brief The horizontal resize arrow shape.
    999  *
   1000  *  The horizontal resize arrow shape.
   1001  */
   1002 #define GLFW_HRESIZE_CURSOR         0x00036005
   1003 /*! @brief The vertical resize arrow shape.
   1004  *
   1005  *  The vertical resize arrow shape.
   1006  */
   1007 #define GLFW_VRESIZE_CURSOR         0x00036006
   1008 /*! @} */
   1009 
   1010 #define GLFW_CONNECTED              0x00040001
   1011 #define GLFW_DISCONNECTED           0x00040002
   1012 
   1013 /*! @addtogroup init
   1014  *  @{ */
   1015 #define GLFW_JOYSTICK_HAT_BUTTONS   0x00050001
   1016 
   1017 #define GLFW_COCOA_CHDIR_RESOURCES  0x00051001
   1018 #define GLFW_COCOA_MENUBAR          0x00051002
   1019 
   1020 #define GLFW_X11_WM_CLASS_NAME      0x00052001
   1021 #define GLFW_X11_WM_CLASS_CLASS     0x00052002
   1022 /*! @} */
   1023 
   1024 #define GLFW_DONT_CARE              -1
   1025 
   1026 
   1027 /*************************************************************************
   1028  * GLFW API types
   1029  *************************************************************************/
   1030 
   1031 /*! @brief Client API function pointer type.
   1032  *
   1033  *  Generic function pointer used for returning client API function pointers
   1034  *  without forcing a cast from a regular pointer.
   1035  *
   1036  *  @sa @ref context_glext
   1037  *  @sa @ref glfwGetProcAddress
   1038  *
   1039  *  @since Added in version 3.0.
   1040  
   1041  *  @ingroup context
   1042  */
   1043 typedef void (*GLFWglproc)(void);
   1044 
   1045 /*! @brief Vulkan API function pointer type.
   1046  *
   1047  *  Generic function pointer used for returning Vulkan API function pointers
   1048  *  without forcing a cast from a regular pointer.
   1049  *
   1050  *  @sa @ref vulkan_proc
   1051  *  @sa @ref glfwGetInstanceProcAddress
   1052  *
   1053  *  @since Added in version 3.2.
   1054  *
   1055  *  @ingroup vulkan
   1056  */
   1057 typedef void (*GLFWvkproc)(void);
   1058 
   1059 /*! @brief Opaque monitor object.
   1060  *
   1061  *  Opaque monitor object.
   1062  *
   1063  *  @see @ref monitor_object
   1064  *
   1065  *  @since Added in version 3.0.
   1066  *
   1067  *  @ingroup monitor
   1068  */
   1069 typedef struct GLFWmonitor GLFWmonitor;
   1070 
   1071 /*! @brief Opaque window object.
   1072  *
   1073  *  Opaque window object.
   1074  *
   1075  *  @see @ref window_object
   1076  *
   1077  *  @since Added in version 3.0.
   1078  *
   1079  *  @ingroup window
   1080  */
   1081 typedef struct GLFWwindow GLFWwindow;
   1082 
   1083 /*! @brief Opaque cursor object.
   1084  *
   1085  *  Opaque cursor object.
   1086  *
   1087  *  @see @ref cursor_object
   1088  *
   1089  *  @since Added in version 3.1.
   1090  *
   1091  *  @ingroup cursor
   1092  */
   1093 typedef struct GLFWcursor GLFWcursor;
   1094 
   1095 /*! @brief The function signature for error callbacks.
   1096  *
   1097  *  This is the function signature for error callback functions.
   1098  *
   1099  *  @param[in] error An [error code](@ref errors).
   1100  *  @param[in] description A UTF-8 encoded string describing the error.
   1101  *
   1102  *  @sa @ref error_handling
   1103  *  @sa @ref glfwSetErrorCallback
   1104  *
   1105  *  @since Added in version 3.0.
   1106  *
   1107  *  @ingroup init
   1108  */
   1109 typedef void (* GLFWerrorfun)(int,const char*);
   1110 
   1111 /*! @brief The function signature for window position callbacks.
   1112  *
   1113  *  This is the function signature for window position callback functions.
   1114  *
   1115  *  @param[in] window The window that was moved.
   1116  *  @param[in] xpos The new x-coordinate, in screen coordinates, of the
   1117  *  upper-left corner of the client area of the window.
   1118  *  @param[in] ypos The new y-coordinate, in screen coordinates, of the
   1119  *  upper-left corner of the client area of the window.
   1120  *
   1121  *  @sa @ref window_pos
   1122  *  @sa @ref glfwSetWindowPosCallback
   1123  *
   1124  *  @since Added in version 3.0.
   1125  *
   1126  *  @ingroup window
   1127  */
   1128 typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int);
   1129 
   1130 /*! @brief The function signature for window resize callbacks.
   1131  *
   1132  *  This is the function signature for window size callback functions.
   1133  *
   1134  *  @param[in] window The window that was resized.
   1135  *  @param[in] width The new width, in screen coordinates, of the window.
   1136  *  @param[in] height The new height, in screen coordinates, of the window.
   1137  *
   1138  *  @sa @ref window_size
   1139  *  @sa @ref glfwSetWindowSizeCallback
   1140  *
   1141  *  @since Added in version 1.0.
   1142  *  @glfw3 Added window handle parameter.
   1143  *
   1144  *  @ingroup window
   1145  */
   1146 typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int);
   1147 
   1148 /*! @brief The function signature for window close callbacks.
   1149  *
   1150  *  This is the function signature for window close callback functions.
   1151  *
   1152  *  @param[in] window The window that the user attempted to close.
   1153  *
   1154  *  @sa @ref window_close
   1155  *  @sa @ref glfwSetWindowCloseCallback
   1156  *
   1157  *  @since Added in version 2.5.
   1158  *  @glfw3 Added window handle parameter.
   1159  *
   1160  *  @ingroup window
   1161  */
   1162 typedef void (* GLFWwindowclosefun)(GLFWwindow*);
   1163 
   1164 /*! @brief The function signature for window content refresh callbacks.
   1165  *
   1166  *  This is the function signature for window refresh callback functions.
   1167  *
   1168  *  @param[in] window The window whose content needs to be refreshed.
   1169  *
   1170  *  @sa @ref window_refresh
   1171  *  @sa @ref glfwSetWindowRefreshCallback
   1172  *
   1173  *  @since Added in version 2.5.
   1174  *  @glfw3 Added window handle parameter.
   1175  *
   1176  *  @ingroup window
   1177  */
   1178 typedef void (* GLFWwindowrefreshfun)(GLFWwindow*);
   1179 
   1180 /*! @brief The function signature for window focus/defocus callbacks.
   1181  *
   1182  *  This is the function signature for window focus callback functions.
   1183  *
   1184  *  @param[in] window The window that gained or lost input focus.
   1185  *  @param[in] focused `GLFW_TRUE` if the window was given input focus, or
   1186  *  `GLFW_FALSE` if it lost it.
   1187  *
   1188  *  @sa @ref window_focus
   1189  *  @sa @ref glfwSetWindowFocusCallback
   1190  *
   1191  *  @since Added in version 3.0.
   1192  *
   1193  *  @ingroup window
   1194  */
   1195 typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int);
   1196 
   1197 /*! @brief The function signature for window iconify/restore callbacks.
   1198  *
   1199  *  This is the function signature for window iconify/restore callback
   1200  *  functions.
   1201  *
   1202  *  @param[in] window The window that was iconified or restored.
   1203  *  @param[in] iconified `GLFW_TRUE` if the window was iconified, or
   1204  *  `GLFW_FALSE` if it was restored.
   1205  *
   1206  *  @sa @ref window_iconify
   1207  *  @sa @ref glfwSetWindowIconifyCallback
   1208  *
   1209  *  @since Added in version 3.0.
   1210  *
   1211  *  @ingroup window
   1212  */
   1213 typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int);
   1214 
   1215 /*! @brief The function signature for window maximize/restore callbacks.
   1216  *
   1217  *  This is the function signature for window maximize/restore callback
   1218  *  functions.
   1219  *
   1220  *  @param[in] window The window that was maximized or restored.
   1221  *  @param[in] iconified `GLFW_TRUE` if the window was maximized, or
   1222  *  `GLFW_FALSE` if it was restored.
   1223  *
   1224  *  @sa @ref window_maximize
   1225  *  @sa glfwSetWindowMaximizeCallback
   1226  *
   1227  *  @since Added in version 3.3.
   1228  *
   1229  *  @ingroup window
   1230  */
   1231 typedef void (* GLFWwindowmaximizefun)(GLFWwindow*,int);
   1232 
   1233 /*! @brief The function signature for framebuffer resize callbacks.
   1234  *
   1235  *  This is the function signature for framebuffer resize callback
   1236  *  functions.
   1237  *
   1238  *  @param[in] window The window whose framebuffer was resized.
   1239  *  @param[in] width The new width, in pixels, of the framebuffer.
   1240  *  @param[in] height The new height, in pixels, of the framebuffer.
   1241  *
   1242  *  @sa @ref window_fbsize
   1243  *  @sa @ref glfwSetFramebufferSizeCallback
   1244  *
   1245  *  @since Added in version 3.0.
   1246  *
   1247  *  @ingroup window
   1248  */
   1249 typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int);
   1250 
   1251 /*! @brief The function signature for mouse button callbacks.
   1252  *
   1253  *  This is the function signature for mouse button callback functions.
   1254  *
   1255  *  @param[in] window The window that received the event.
   1256  *  @param[in] button The [mouse button](@ref buttons) that was pressed or
   1257  *  released.
   1258  *  @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`.
   1259  *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were
   1260  *  held down.
   1261  *
   1262  *  @sa @ref input_mouse_button
   1263  *  @sa @ref glfwSetMouseButtonCallback
   1264  *
   1265  *  @since Added in version 1.0.
   1266  *  @glfw3 Added window handle and modifier mask parameters.
   1267  *
   1268  *  @ingroup input
   1269  */
   1270 typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int);
   1271 
   1272 /*! @brief The function signature for cursor position callbacks.
   1273  *
   1274  *  This is the function signature for cursor position callback functions.
   1275  *
   1276  *  @param[in] window The window that received the event.
   1277  *  @param[in] xpos The new cursor x-coordinate, relative to the left edge of
   1278  *  the client area.
   1279  *  @param[in] ypos The new cursor y-coordinate, relative to the top edge of the
   1280  *  client area.
   1281  *
   1282  *  @sa @ref cursor_pos
   1283  *  @sa @ref glfwSetCursorPosCallback
   1284  *
   1285  *  @since Added in version 3.0.  Replaces `GLFWmouseposfun`.
   1286  *
   1287  *  @ingroup input
   1288  */
   1289 typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double);
   1290 
   1291 /*! @brief The function signature for cursor enter/leave callbacks.
   1292  *
   1293  *  This is the function signature for cursor enter/leave callback functions.
   1294  *
   1295  *  @param[in] window The window that received the event.
   1296  *  @param[in] entered `GLFW_TRUE` if the cursor entered the window's client
   1297  *  area, or `GLFW_FALSE` if it left it.
   1298  *
   1299  *  @sa @ref cursor_enter
   1300  *  @sa @ref glfwSetCursorEnterCallback
   1301  *
   1302  *  @since Added in version 3.0.
   1303  *
   1304  *  @ingroup input
   1305  */
   1306 typedef void (* GLFWcursorenterfun)(GLFWwindow*,int);
   1307 
   1308 /*! @brief The function signature for scroll callbacks.
   1309  *
   1310  *  This is the function signature for scroll callback functions.
   1311  *
   1312  *  @param[in] window The window that received the event.
   1313  *  @param[in] xoffset The scroll offset along the x-axis.
   1314  *  @param[in] yoffset The scroll offset along the y-axis.
   1315  *
   1316  *  @sa @ref scrolling
   1317  *  @sa @ref glfwSetScrollCallback
   1318  *
   1319  *  @since Added in version 3.0.  Replaces `GLFWmousewheelfun`.
   1320  *
   1321  *  @ingroup input
   1322  */
   1323 typedef void (* GLFWscrollfun)(GLFWwindow*,double,double);
   1324 
   1325 /*! @brief The function signature for keyboard key callbacks.
   1326  *
   1327  *  This is the function signature for keyboard key callback functions.
   1328  *
   1329  *  @param[in] window The window that received the event.
   1330  *  @param[in] key The [keyboard key](@ref keys) that was pressed or released.
   1331  *  @param[in] scancode The system-specific scancode of the key.
   1332  *  @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`.
   1333  *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were
   1334  *  held down.
   1335  *
   1336  *  @sa @ref input_key
   1337  *  @sa @ref glfwSetKeyCallback
   1338  *
   1339  *  @since Added in version 1.0.
   1340  *  @glfw3 Added window handle, scancode and modifier mask parameters.
   1341  *
   1342  *  @ingroup input
   1343  */
   1344 typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int);
   1345 
   1346 /*! @brief The function signature for Unicode character callbacks.
   1347  *
   1348  *  This is the function signature for Unicode character callback functions.
   1349  *
   1350  *  @param[in] window The window that received the event.
   1351  *  @param[in] codepoint The Unicode code point of the character.
   1352  *
   1353  *  @sa @ref input_char
   1354  *  @sa @ref glfwSetCharCallback
   1355  *
   1356  *  @since Added in version 2.4.
   1357  *  @glfw3 Added window handle parameter.
   1358  *
   1359  *  @ingroup input
   1360  */
   1361 typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int);
   1362 
   1363 /*! @brief The function signature for Unicode character with modifiers
   1364  *  callbacks.
   1365  *
   1366  *  This is the function signature for Unicode character with modifiers callback
   1367  *  functions.  It is called for each input character, regardless of what
   1368  *  modifier keys are held down.
   1369  *
   1370  *  @param[in] window The window that received the event.
   1371  *  @param[in] codepoint The Unicode code point of the character.
   1372  *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were
   1373  *  held down.
   1374  *
   1375  *  @sa @ref input_char
   1376  *  @sa @ref glfwSetCharModsCallback
   1377  *
   1378  *  @since Added in version 3.1.
   1379  *
   1380  *  @ingroup input
   1381  */
   1382 typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int);
   1383 
   1384 /*! @brief The function signature for file drop callbacks.
   1385  *
   1386  *  This is the function signature for file drop callbacks.
   1387  *
   1388  *  @param[in] window The window that received the event.
   1389  *  @param[in] count The number of dropped files.
   1390  *  @param[in] paths The UTF-8 encoded file and/or directory path names.
   1391  *
   1392  *  @sa @ref path_drop
   1393  *  @sa @ref glfwSetDropCallback
   1394  *
   1395  *  @since Added in version 3.1.
   1396  *
   1397  *  @ingroup input
   1398  */
   1399 typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**);
   1400 
   1401 /*! @brief The function signature for monitor configuration callbacks.
   1402  *
   1403  *  This is the function signature for monitor configuration callback functions.
   1404  *
   1405  *  @param[in] monitor The monitor that was connected or disconnected.
   1406  *  @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.
   1407  *
   1408  *  @sa @ref monitor_event
   1409  *  @sa @ref glfwSetMonitorCallback
   1410  *
   1411  *  @since Added in version 3.0.
   1412  *
   1413  *  @ingroup monitor
   1414  */
   1415 typedef void (* GLFWmonitorfun)(GLFWmonitor*,int);
   1416 
   1417 /*! @brief The function signature for joystick configuration callbacks.
   1418  *
   1419  *  This is the function signature for joystick configuration callback
   1420  *  functions.
   1421  *
   1422  *  @param[in] jid The joystick that was connected or disconnected.
   1423  *  @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.
   1424  *
   1425  *  @sa @ref joystick_event
   1426  *  @sa @ref glfwSetJoystickCallback
   1427  *
   1428  *  @since Added in version 3.2.
   1429  *
   1430  *  @ingroup input
   1431  */
   1432 typedef void (* GLFWjoystickfun)(int,int);
   1433 
   1434 /*! @brief Video mode type.
   1435  *
   1436  *  This describes a single video mode.
   1437  *
   1438  *  @sa @ref monitor_modes
   1439  *  @sa @ref glfwGetVideoMode
   1440  *  @sa @ref glfwGetVideoModes
   1441  *
   1442  *  @since Added in version 1.0.
   1443  *  @glfw3 Added refresh rate member.
   1444  *
   1445  *  @ingroup monitor
   1446  */
   1447 typedef struct GLFWvidmode
   1448 {
   1449     /*! The width, in screen coordinates, of the video mode.
   1450      */
   1451     int width;
   1452     /*! The height, in screen coordinates, of the video mode.
   1453      */
   1454     int height;
   1455     /*! The bit depth of the red channel of the video mode.
   1456      */
   1457     int redBits;
   1458     /*! The bit depth of the green channel of the video mode.
   1459      */
   1460     int greenBits;
   1461     /*! The bit depth of the blue channel of the video mode.
   1462      */
   1463     int blueBits;
   1464     /*! The refresh rate, in Hz, of the video mode.
   1465      */
   1466     int refreshRate;
   1467 } GLFWvidmode;
   1468 
   1469 /*! @brief Gamma ramp.
   1470  *
   1471  *  This describes the gamma ramp for a monitor.
   1472  *
   1473  *  @sa @ref monitor_gamma
   1474  *  @sa @ref glfwGetGammaRamp
   1475  *  @sa @ref glfwSetGammaRamp
   1476  *
   1477  *  @since Added in version 3.0.
   1478  *
   1479  *  @ingroup monitor
   1480  */
   1481 typedef struct GLFWgammaramp
   1482 {
   1483     /*! An array of value describing the response of the red channel.
   1484      */
   1485     unsigned short* red;
   1486     /*! An array of value describing the response of the green channel.
   1487      */
   1488     unsigned short* green;
   1489     /*! An array of value describing the response of the blue channel.
   1490      */
   1491     unsigned short* blue;
   1492     /*! The number of elements in each array.
   1493      */
   1494     unsigned int size;
   1495 } GLFWgammaramp;
   1496 
   1497 /*! @brief Image data.
   1498  *
   1499  *  This describes a single 2D image.  See the documentation for each related
   1500  *  function what the expected pixel format is.
   1501  *
   1502  *  @sa @ref cursor_custom
   1503  *  @sa @ref window_icon
   1504  *
   1505  *  @since Added in version 2.1.
   1506  *  @glfw3 Removed format and bytes-per-pixel members.
   1507  */
   1508 typedef struct GLFWimage
   1509 {
   1510     /*! The width, in pixels, of this image.
   1511      */
   1512     int width;
   1513     /*! The height, in pixels, of this image.
   1514      */
   1515     int height;
   1516     /*! The pixel data of this image, arranged left-to-right, top-to-bottom.
   1517      */
   1518     unsigned char* pixels;
   1519 } GLFWimage;
   1520 
   1521 /*! @brief Gamepad input state
   1522  *
   1523  *  This describes the input state of a gamepad.
   1524  *
   1525  *  @sa @ref gamepad
   1526  *  @sa @ref glfwGetGamepadState
   1527  *
   1528  *  @since Added in version 3.3.
   1529  */
   1530 typedef struct GLFWgamepadstate
   1531 {
   1532     /*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS`
   1533      *  or `GLFW_RELEASE`.
   1534      */
   1535     unsigned char buttons[15];
   1536     /*! The states of each [gamepad axis](@ref gamepad_axes), in the range -1.0
   1537      *  to 1.0 inclusive.
   1538      */
   1539     float axes[6];
   1540 } GLFWgamepadstate;
   1541 
   1542 
   1543 /*************************************************************************
   1544  * GLFW API functions
   1545  *************************************************************************/
   1546 
   1547 /*! @brief Initializes the GLFW library.
   1548  *
   1549  *  This function initializes the GLFW library.  Before most GLFW functions can
   1550  *  be used, GLFW must be initialized, and before an application terminates GLFW
   1551  *  should be terminated in order to free any resources allocated during or
   1552  *  after initialization.
   1553  *
   1554  *  If this function fails, it calls @ref glfwTerminate before returning.  If it
   1555  *  succeeds, you should call @ref glfwTerminate before the application exits.
   1556  *
   1557  *  Additional calls to this function after successful initialization but before
   1558  *  termination will return `GLFW_TRUE` immediately.
   1559  *
   1560  *  @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
   1561  *  [error](@ref error_handling) occurred.
   1562  *
   1563  *  @errors Possible errors include @ref GLFW_PLATFORM_ERROR.
   1564  *
   1565  *  @remark @macos This function will change the current directory of the
   1566  *  application to the `Contents/Resources` subdirectory of the application's
   1567  *  bundle, if present.  This can be disabled with the @ref
   1568  *  GLFW_COCOA_CHDIR_RESOURCES init hint.
   1569  *
   1570  *  @thread_safety This function must only be called from the main thread.
   1571  *
   1572  *  @sa @ref intro_init
   1573  *  @sa @ref glfwTerminate
   1574  *
   1575  *  @since Added in version 1.0.
   1576  *
   1577  *  @ingroup init
   1578  */
   1579 GLFWAPI int glfwInit(void);
   1580 
   1581 /*! @brief Terminates the GLFW library.
   1582  *
   1583  *  This function destroys all remaining windows and cursors, restores any
   1584  *  modified gamma ramps and frees any other allocated resources.  Once this
   1585  *  function is called, you must again call @ref glfwInit successfully before
   1586  *  you will be able to use most GLFW functions.
   1587  *
   1588  *  If GLFW has been successfully initialized, this function should be called
   1589  *  before the application exits.  If initialization fails, there is no need to
   1590  *  call this function, as it is called by @ref glfwInit before it returns
   1591  *  failure.
   1592  *
   1593  *  @errors Possible errors include @ref GLFW_PLATFORM_ERROR.
   1594  *
   1595  *  @remark This function may be called before @ref glfwInit.
   1596  *
   1597  *  @warning The contexts of any remaining windows must not be current on any
   1598  *  other thread when this function is called.
   1599  *
   1600  *  @reentrancy This function must not be called from a callback.
   1601  *
   1602  *  @thread_safety This function must only be called from the main thread.
   1603  *
   1604  *  @sa @ref intro_init
   1605  *  @sa @ref glfwInit
   1606  *
   1607  *  @since Added in version 1.0.
   1608  *
   1609  *  @ingroup init
   1610  */
   1611 GLFWAPI void glfwTerminate(void);
   1612 
   1613 /*! @brief Sets the specified init hint to the desired value.
   1614  *
   1615  *  This function sets hints for the next initialization of GLFW.  Only integer
   1616  *  type hints can be set with this function.
   1617  *
   1618  *  The values you set hints to are never reset by GLFW, but they only take
   1619  *  effect during initialization.  Once GLFW has been initialized, any values
   1620  *  you set will be ignored until the library is terminated and initialized
   1621  *  again.
   1622  *
   1623  *  Some hints are platform specific.  These may be set on any platform but they
   1624  *  will only affect their specific platform.  Other platforms will simply
   1625  *  ignore them.  Setting these hints requires no platform specific headers or
   1626  *  functions. 
   1627  *
   1628  *  @param[in] hint The [init hint](@ref init_hints) to set.
   1629  *  @param[in] value The new value of the init hint.
   1630  *
   1631  *  @errors Possible errors include @ref GLFW_INVALID_ENUM and @ref
   1632  *  GLFW_INVALID_VALUE.
   1633  *
   1634  *  @remarks This function may be called before @ref glfwInit.
   1635  *
   1636  *  @thread_safety This function must only be called from the main thread.
   1637  *
   1638  *  @sa init_hints
   1639  *  @sa glfwInit
   1640  *  @sa glfwInitHintString
   1641  *
   1642  *  @since Added in version 3.3.
   1643  *
   1644  *  @ingroup init
   1645  */
   1646 GLFWAPI void glfwInitHint(int hint, int value);
   1647 
   1648 /*! @brief Sets the specified init hint to the desired value.
   1649  *
   1650  *  This function sets hints for the next initialization of GLFW.  Only string
   1651  *  type hints can be set with this function.
   1652  *
   1653  *  The values you set hints to are never reset by GLFW, but they only take
   1654  *  effect during initialization.  Once GLFW has been initialized, any values
   1655  *  you set will be ignored until the library is terminated and initialized
   1656  *  again.
   1657  *
   1658  *  Some hints are platform specific.  These may be set on any platform but they
   1659  *  will only affect their specific platform.  Other platforms will simply
   1660  *  ignore them.  Setting these hints requires no platform specific headers or
   1661  *  functions. 
   1662  *
   1663  *  @param[in] hint The [init hint](@ref init_hints) to set.
   1664  *  @param[in] value The new value of the init hint.
   1665  *
   1666  *  @errors Possible errors include @ref GLFW_INVALID_ENUM and @ref
   1667  *  GLFW_INVALID_VALUE.
   1668  *
   1669  *  @remarks This function may be called before @ref glfwInit.
   1670  *
   1671  *  @thread_safety This function must only be called from the main thread.
   1672  *
   1673  *  @sa init_hints
   1674  *  @sa glfwInit
   1675  *  @sa glfwInitHint
   1676  *
   1677  *  @since Added in version 3.3.
   1678  *
   1679  *  @ingroup init
   1680  */
   1681 GLFWAPI void glfwInitHintString(int hint, const char* value);
   1682 
   1683 /*! @brief Retrieves the version of the GLFW library.
   1684  *
   1685  *  This function retrieves the major, minor and revision numbers of the GLFW
   1686  *  library.  It is intended for when you are using GLFW as a shared library and
   1687  *  want to ensure that you are using the minimum required version.
   1688  *
   1689  *  Any or all of the version arguments may be `NULL`.
   1690  *
   1691  *  @param[out] major Where to store the major version number, or `NULL`.
   1692  *  @param[out] minor Where to store the minor version number, or `NULL`.
   1693  *  @param[out] rev Where to store the revision number, or `NULL`.
   1694  *
   1695  *  @errors None.
   1696  *
   1697  *  @remark This function may be called before @ref glfwInit.
   1698  *
   1699  *  @thread_safety This function may be called from any thread.
   1700  *
   1701  *  @sa @ref intro_version
   1702  *  @sa @ref glfwGetVersionString
   1703  *
   1704  *  @since Added in version 1.0.
   1705  *
   1706  *  @ingroup init
   1707  */
   1708 GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);
   1709 
   1710 /*! @brief Returns a string describing the compile-time configuration.
   1711  *
   1712  *  This function returns the compile-time generated
   1713  *  [version string](@ref intro_version_string) of the GLFW library binary.  It
   1714  *  describes the version, platform, compiler and any platform-specific
   1715  *  compile-time options.  It should not be confused with the OpenGL or OpenGL
   1716  *  ES version string, queried with `glGetString`.
   1717  *
   1718  *  __Do not use the version string__ to parse the GLFW library version.  The
   1719  *  @ref glfwGetVersion function provides the version of the running library
   1720  *  binary in numerical format.
   1721  *
   1722  *  @return The ASCII encoded GLFW version string.
   1723  *
   1724  *  @errors None.
   1725  *
   1726  *  @remark This function may be called before @ref glfwInit.
   1727  *
   1728  *  @pointer_lifetime The returned string is static and compile-time generated.
   1729  *
   1730  *  @thread_safety This function may be called from any thread.
   1731  *
   1732  *  @sa @ref intro_version
   1733  *  @sa @ref glfwGetVersion
   1734  *
   1735  *  @since Added in version 3.0.
   1736  *
   1737  *  @ingroup init
   1738  */
   1739 GLFWAPI const char* glfwGetVersionString(void);
   1740 
   1741 /*! @brief Returns and clears the last error for the calling thread.
   1742  *
   1743  *  This function returns and clears the [error code](@ref errors) of the last
   1744  *  error that occurred on the calling thread, and optionally a UTF-8 encoded
   1745  *  human-readable description of it.  If no error has occurred since the last
   1746  *  call, it returns @ref GLFW_NO_ERROR (zero) and the description pointer is
   1747  *  set to `NULL`.
   1748  *
   1749  *  @param[in] description Where to store the error description pointer, or `NULL`.
   1750  *  @return The last error code for the calling thread, or @ref GLFW_NO_ERROR
   1751  *  (zero).
   1752  *
   1753  *  @errors None.
   1754  *
   1755  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   1756  *  should not free it yourself.  It is guaranteed to be valid only until the
   1757  *  next error occurs or the library is terminated.
   1758  *
   1759  *  @remark This function may be called before @ref glfwInit.
   1760  *
   1761  *  @thread_safety This function may be called from any thread.
   1762  *
   1763  *  @sa @ref error_handling
   1764  *  @sa @ref glfwSetErrorCallback
   1765  *
   1766  *  @since Added in version 3.3.
   1767  *
   1768  *  @ingroup init
   1769  */
   1770 GLFWAPI int glfwGetError(const char** description);
   1771 
   1772 /*! @brief Sets the error callback.
   1773  *
   1774  *  This function sets the error callback, which is called with an error code
   1775  *  and a human-readable description each time a GLFW error occurs.
   1776  *
   1777  *  The error code is set before the callback is called.  Calling @ref
   1778  *  glfwGetError from the error callback will return the same value as the error
   1779  *  code argument.
   1780  *
   1781  *  The error callback is called on the thread where the error occurred.  If you
   1782  *  are using GLFW from multiple threads, your error callback needs to be
   1783  *  written accordingly.
   1784  *
   1785  *  Because the description string may have been generated specifically for that
   1786  *  error, it is not guaranteed to be valid after the callback has returned.  If
   1787  *  you wish to use it after the callback returns, you need to make a copy.
   1788  *
   1789  *  Once set, the error callback remains set even after the library has been
   1790  *  terminated.
   1791  *
   1792  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   1793  *  callback.
   1794  *  @return The previously set callback, or `NULL` if no callback was set.
   1795  *
   1796  *  @errors None.
   1797  *
   1798  *  @remark This function may be called before @ref glfwInit.
   1799  *
   1800  *  @thread_safety This function must only be called from the main thread.
   1801  *
   1802  *  @sa @ref error_handling
   1803  *  @sa @ref glfwGetError
   1804  *
   1805  *  @since Added in version 3.0.
   1806  *
   1807  *  @ingroup init
   1808  */
   1809 GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun);
   1810 
   1811 /*! @brief Returns the currently connected monitors.
   1812  *
   1813  *  This function returns an array of handles for all currently connected
   1814  *  monitors.  The primary monitor is always first in the returned array.  If no
   1815  *  monitors were found, this function returns `NULL`.
   1816  *
   1817  *  @param[out] count Where to store the number of monitors in the returned
   1818  *  array.  This is set to zero if an error occurred.
   1819  *  @return An array of monitor handles, or `NULL` if no monitors were found or
   1820  *  if an [error](@ref error_handling) occurred.
   1821  *
   1822  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   1823  *
   1824  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   1825  *  should not free it yourself.  It is guaranteed to be valid only until the
   1826  *  monitor configuration changes or the library is terminated.
   1827  *
   1828  *  @thread_safety This function must only be called from the main thread.
   1829  *
   1830  *  @sa @ref monitor_monitors
   1831  *  @sa @ref monitor_event
   1832  *  @sa @ref glfwGetPrimaryMonitor
   1833  *
   1834  *  @since Added in version 3.0.
   1835  *
   1836  *  @ingroup monitor
   1837  */
   1838 GLFWAPI GLFWmonitor** glfwGetMonitors(int* count);
   1839 
   1840 /*! @brief Returns the primary monitor.
   1841  *
   1842  *  This function returns the primary monitor.  This is usually the monitor
   1843  *  where elements like the task bar or global menu bar are located.
   1844  *
   1845  *  @return The primary monitor, or `NULL` if no monitors were found or if an
   1846  *  [error](@ref error_handling) occurred.
   1847  *
   1848  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   1849  *
   1850  *  @thread_safety This function must only be called from the main thread.
   1851  *
   1852  *  @remark The primary monitor is always first in the array returned by @ref
   1853  *  glfwGetMonitors.
   1854  *
   1855  *  @sa @ref monitor_monitors
   1856  *  @sa @ref glfwGetMonitors
   1857  *
   1858  *  @since Added in version 3.0.
   1859  *
   1860  *  @ingroup monitor
   1861  */
   1862 GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void);
   1863 
   1864 /*! @brief Returns the position of the monitor's viewport on the virtual screen.
   1865  *
   1866  *  This function returns the position, in screen coordinates, of the upper-left
   1867  *  corner of the specified monitor.
   1868  *
   1869  *  Any or all of the position arguments may be `NULL`.  If an error occurs, all
   1870  *  non-`NULL` position arguments will be set to zero.
   1871  *
   1872  *  @param[in] monitor The monitor to query.
   1873  *  @param[out] xpos Where to store the monitor x-coordinate, or `NULL`.
   1874  *  @param[out] ypos Where to store the monitor y-coordinate, or `NULL`.
   1875  *
   1876  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   1877  *  GLFW_PLATFORM_ERROR.
   1878  *
   1879  *  @thread_safety This function must only be called from the main thread.
   1880  *
   1881  *  @sa @ref monitor_properties
   1882  *
   1883  *  @since Added in version 3.0.
   1884  *
   1885  *  @ingroup monitor
   1886  */
   1887 GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);
   1888 
   1889 /*! @brief Returns the physical size of the monitor.
   1890  *
   1891  *  This function returns the size, in millimetres, of the display area of the
   1892  *  specified monitor.
   1893  *
   1894  *  Some systems do not provide accurate monitor size information, either
   1895  *  because the monitor
   1896  *  [EDID](https://en.wikipedia.org/wiki/Extended_display_identification_data)
   1897  *  data is incorrect or because the driver does not report it accurately.
   1898  *
   1899  *  Any or all of the size arguments may be `NULL`.  If an error occurs, all
   1900  *  non-`NULL` size arguments will be set to zero.
   1901  *
   1902  *  @param[in] monitor The monitor to query.
   1903  *  @param[out] widthMM Where to store the width, in millimetres, of the
   1904  *  monitor's display area, or `NULL`.
   1905  *  @param[out] heightMM Where to store the height, in millimetres, of the
   1906  *  monitor's display area, or `NULL`.
   1907  *
   1908  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   1909  *
   1910  *  @remark @win32 calculates the returned physical size from the
   1911  *  current resolution and system DPI instead of querying the monitor EDID data.
   1912  *
   1913  *  @thread_safety This function must only be called from the main thread.
   1914  *
   1915  *  @sa @ref monitor_properties
   1916  *
   1917  *  @since Added in version 3.0.
   1918  *
   1919  *  @ingroup monitor
   1920  */
   1921 GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* widthMM, int* heightMM);
   1922 
   1923 /*! @brief Returns the name of the specified monitor.
   1924  *
   1925  *  This function returns a human-readable name, encoded as UTF-8, of the
   1926  *  specified monitor.  The name typically reflects the make and model of the
   1927  *  monitor and is not guaranteed to be unique among the connected monitors.
   1928  *
   1929  *  @param[in] monitor The monitor to query.
   1930  *  @return The UTF-8 encoded name of the monitor, or `NULL` if an
   1931  *  [error](@ref error_handling) occurred.
   1932  *
   1933  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   1934  *
   1935  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   1936  *  should not free it yourself.  It is valid until the specified monitor is
   1937  *  disconnected or the library is terminated.
   1938  *
   1939  *  @thread_safety This function must only be called from the main thread.
   1940  *
   1941  *  @sa @ref monitor_properties
   1942  *
   1943  *  @since Added in version 3.0.
   1944  *
   1945  *  @ingroup monitor
   1946  */
   1947 GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor);
   1948 
   1949 /*! @brief Sets the monitor configuration callback.
   1950  *
   1951  *  This function sets the monitor configuration callback, or removes the
   1952  *  currently set callback.  This is called when a monitor is connected to or
   1953  *  disconnected from the system.
   1954  *
   1955  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   1956  *  callback.
   1957  *  @return The previously set callback, or `NULL` if no callback was set or the
   1958  *  library had not been [initialized](@ref intro_init).
   1959  *
   1960  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   1961  *
   1962  *  @thread_safety This function must only be called from the main thread.
   1963  *
   1964  *  @sa @ref monitor_event
   1965  *
   1966  *  @since Added in version 3.0.
   1967  *
   1968  *  @ingroup monitor
   1969  */
   1970 GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun);
   1971 
   1972 /*! @brief Returns the available video modes for the specified monitor.
   1973  *
   1974  *  This function returns an array of all video modes supported by the specified
   1975  *  monitor.  The returned array is sorted in ascending order, first by color
   1976  *  bit depth (the sum of all channel depths) and then by resolution area (the
   1977  *  product of width and height).
   1978  *
   1979  *  @param[in] monitor The monitor to query.
   1980  *  @param[out] count Where to store the number of video modes in the returned
   1981  *  array.  This is set to zero if an error occurred.
   1982  *  @return An array of video modes, or `NULL` if an
   1983  *  [error](@ref error_handling) occurred.
   1984  *
   1985  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   1986  *  GLFW_PLATFORM_ERROR.
   1987  *
   1988  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   1989  *  should not free it yourself.  It is valid until the specified monitor is
   1990  *  disconnected, this function is called again for that monitor or the library
   1991  *  is terminated.
   1992  *
   1993  *  @thread_safety This function must only be called from the main thread.
   1994  *
   1995  *  @sa @ref monitor_modes
   1996  *  @sa @ref glfwGetVideoMode
   1997  *
   1998  *  @since Added in version 1.0.
   1999  *  @glfw3 Changed to return an array of modes for a specific monitor.
   2000  *
   2001  *  @ingroup monitor
   2002  */
   2003 GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count);
   2004 
   2005 /*! @brief Returns the current mode of the specified monitor.
   2006  *
   2007  *  This function returns the current video mode of the specified monitor.  If
   2008  *  you have created a full screen window for that monitor, the return value
   2009  *  will depend on whether that window is iconified.
   2010  *
   2011  *  @param[in] monitor The monitor to query.
   2012  *  @return The current mode of the monitor, or `NULL` if an
   2013  *  [error](@ref error_handling) occurred.
   2014  *
   2015  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2016  *  GLFW_PLATFORM_ERROR.
   2017  *
   2018  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   2019  *  should not free it yourself.  It is valid until the specified monitor is
   2020  *  disconnected or the library is terminated.
   2021  *
   2022  *  @thread_safety This function must only be called from the main thread.
   2023  *
   2024  *  @sa @ref monitor_modes
   2025  *  @sa @ref glfwGetVideoModes
   2026  *
   2027  *  @since Added in version 3.0.  Replaces `glfwGetDesktopMode`.
   2028  *
   2029  *  @ingroup monitor
   2030  */
   2031 GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
   2032 
   2033 /*! @brief Generates a gamma ramp and sets it for the specified monitor.
   2034  *
   2035  *  This function generates a 256-element gamma ramp from the specified exponent
   2036  *  and then calls @ref glfwSetGammaRamp with it.  The value must be a finite
   2037  *  number greater than zero.
   2038  *
   2039  *  The software controlled gamma ramp is applied _in addition_ to the hardware
   2040  *  gamma correction, which today is usually an approximation of sRGB gamma.
   2041  *  This means that setting a perfectly linear ramp, or gamma 1.0, will produce
   2042  *  the default (usually sRGB-like) behavior.
   2043  *
   2044  *  For gamma correct rendering with OpenGL or OpenGL ES, see the @ref
   2045  *  GLFW_SRGB_CAPABLE hint.
   2046  *
   2047  *  @param[in] monitor The monitor whose gamma ramp to set.
   2048  *  @param[in] gamma The desired exponent.
   2049  *
   2050  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   2051  *  GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
   2052  *
   2053  *  @remark @wayland Gamma handling is currently unavailable, this function will
   2054  *  always emit @ref GLFW_PLATFORM_ERROR.
   2055  *
   2056  *  @thread_safety This function must only be called from the main thread.
   2057  *
   2058  *  @sa @ref monitor_gamma
   2059  *
   2060  *  @since Added in version 3.0.
   2061  *
   2062  *  @ingroup monitor
   2063  */
   2064 GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma);
   2065 
   2066 /*! @brief Returns the current gamma ramp for the specified monitor.
   2067  *
   2068  *  This function returns the current gamma ramp of the specified monitor.
   2069  *
   2070  *  @param[in] monitor The monitor to query.
   2071  *  @return The current gamma ramp, or `NULL` if an
   2072  *  [error](@ref error_handling) occurred.
   2073  *
   2074  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2075  *  GLFW_PLATFORM_ERROR.
   2076  *
   2077  *  @remark @wayland Gamma handling is currently unavailable, this function will
   2078  *  always return `NULL` and emit @ref GLFW_PLATFORM_ERROR.
   2079  *
   2080  *  @pointer_lifetime The returned structure and its arrays are allocated and
   2081  *  freed by GLFW.  You should not free them yourself.  They are valid until the
   2082  *  specified monitor is disconnected, this function is called again for that
   2083  *  monitor or the library is terminated.
   2084  *
   2085  *  @thread_safety This function must only be called from the main thread.
   2086  *
   2087  *  @sa @ref monitor_gamma
   2088  *
   2089  *  @since Added in version 3.0.
   2090  *
   2091  *  @ingroup monitor
   2092  */
   2093 GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor);
   2094 
   2095 /*! @brief Sets the current gamma ramp for the specified monitor.
   2096  *
   2097  *  This function sets the current gamma ramp for the specified monitor.  The
   2098  *  original gamma ramp for that monitor is saved by GLFW the first time this
   2099  *  function is called and is restored by @ref glfwTerminate.
   2100  *
   2101  *  The software controlled gamma ramp is applied _in addition_ to the hardware
   2102  *  gamma correction, which today is usually an approximation of sRGB gamma.
   2103  *  This means that setting a perfectly linear ramp, or gamma 1.0, will produce
   2104  *  the default (usually sRGB-like) behavior.
   2105  *
   2106  *  For gamma correct rendering with OpenGL or OpenGL ES, see the @ref
   2107  *  GLFW_SRGB_CAPABLE hint.
   2108  *
   2109  *  @param[in] monitor The monitor whose gamma ramp to set.
   2110  *  @param[in] ramp The gamma ramp to use.
   2111  *
   2112  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2113  *  GLFW_PLATFORM_ERROR.
   2114  *
   2115  *  @remark Gamma ramp sizes other than 256 are not supported by all platforms
   2116  *  or graphics hardware.
   2117  *
   2118  *  @remark @win32 The gamma ramp size must be 256.
   2119  *
   2120  *  @remark @wayland Gamma handling is currently unavailable, this function will
   2121  *  always emit @ref GLFW_PLATFORM_ERROR.
   2122  *
   2123  *  @pointer_lifetime The specified gamma ramp is copied before this function
   2124  *  returns.
   2125  *
   2126  *  @thread_safety This function must only be called from the main thread.
   2127  *
   2128  *  @sa @ref monitor_gamma
   2129  *
   2130  *  @since Added in version 3.0.
   2131  *
   2132  *  @ingroup monitor
   2133  */
   2134 GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp);
   2135 
   2136 /*! @brief Resets all window hints to their default values.
   2137  *
   2138  *  This function resets all window hints to their
   2139  *  [default values](@ref window_hints_values).
   2140  *
   2141  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   2142  *
   2143  *  @thread_safety This function must only be called from the main thread.
   2144  *
   2145  *  @sa @ref window_hints
   2146  *  @sa @ref glfwWindowHint
   2147  *
   2148  *  @since Added in version 3.0.
   2149  *
   2150  *  @ingroup window
   2151  */
   2152 GLFWAPI void glfwDefaultWindowHints(void);
   2153 
   2154 /*! @brief Sets the specified window hint to the desired value.
   2155  *
   2156  *  This function sets hints for the next call to @ref glfwCreateWindow.  The
   2157  *  hints, once set, retain their values until changed by a call to @ref
   2158  *  glfwWindowHint or @ref glfwDefaultWindowHints, or until the library is
   2159  *  terminated.
   2160  *
   2161  *  This function does not check whether the specified hint values are valid.
   2162  *  If you set hints to invalid values this will instead be reported by the next
   2163  *  call to @ref glfwCreateWindow.
   2164  *
   2165  *  @param[in] hint The [window hint](@ref window_hints) to set.
   2166  *  @param[in] value The new value of the window hint.
   2167  *
   2168  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2169  *  GLFW_INVALID_ENUM.
   2170  *
   2171  *  @thread_safety This function must only be called from the main thread.
   2172  *
   2173  *  @sa @ref window_hints
   2174  *  @sa @ref glfwDefaultWindowHints
   2175  *
   2176  *  @since Added in version 3.0.  Replaces `glfwOpenWindowHint`.
   2177  *
   2178  *  @ingroup window
   2179  */
   2180 GLFWAPI void glfwWindowHint(int hint, int value);
   2181 
   2182 /*! @brief Creates a window and its associated context.
   2183  *
   2184  *  This function creates a window and its associated OpenGL or OpenGL ES
   2185  *  context.  Most of the options controlling how the window and its context
   2186  *  should be created are specified with [window hints](@ref window_hints).
   2187  *
   2188  *  Successful creation does not change which context is current.  Before you
   2189  *  can use the newly created context, you need to
   2190  *  [make it current](@ref context_current).  For information about the `share`
   2191  *  parameter, see @ref context_sharing.
   2192  *
   2193  *  The created window, framebuffer and context may differ from what you
   2194  *  requested, as not all parameters and hints are
   2195  *  [hard constraints](@ref window_hints_hard).  This includes the size of the
   2196  *  window, especially for full screen windows.  To query the actual attributes
   2197  *  of the created window, framebuffer and context, see @ref
   2198  *  glfwGetWindowAttrib, @ref glfwGetWindowSize and @ref glfwGetFramebufferSize.
   2199  *
   2200  *  To create a full screen window, you need to specify the monitor the window
   2201  *  will cover.  If no monitor is specified, the window will be windowed mode.
   2202  *  Unless you have a way for the user to choose a specific monitor, it is
   2203  *  recommended that you pick the primary monitor.  For more information on how
   2204  *  to query connected monitors, see @ref monitor_monitors.
   2205  *
   2206  *  For full screen windows, the specified size becomes the resolution of the
   2207  *  window's _desired video mode_.  As long as a full screen window is not
   2208  *  iconified, the supported video mode most closely matching the desired video
   2209  *  mode is set for the specified monitor.  For more information about full
   2210  *  screen windows, including the creation of so called _windowed full screen_
   2211  *  or _borderless full screen_ windows, see @ref window_windowed_full_screen.
   2212  *
   2213  *  Once you have created the window, you can switch it between windowed and
   2214  *  full screen mode with @ref glfwSetWindowMonitor.  This will not affect its
   2215  *  OpenGL or OpenGL ES context.
   2216  *
   2217  *  By default, newly created windows use the placement recommended by the
   2218  *  window system.  To create the window at a specific position, make it
   2219  *  initially invisible using the [GLFW_VISIBLE](@ref GLFW_VISIBLE_hint) window
   2220  *  hint, set its [position](@ref window_pos) and then [show](@ref window_hide)
   2221  *  it.
   2222  *
   2223  *  As long as at least one full screen window is not iconified, the screensaver
   2224  *  is prohibited from starting.
   2225  *
   2226  *  Window systems put limits on window sizes.  Very large or very small window
   2227  *  dimensions may be overridden by the window system on creation.  Check the
   2228  *  actual [size](@ref window_size) after creation.
   2229  *
   2230  *  The [swap interval](@ref buffer_swap) is not set during window creation and
   2231  *  the initial value may vary depending on driver settings and defaults.
   2232  *
   2233  *  @param[in] width The desired width, in screen coordinates, of the window.
   2234  *  This must be greater than zero.
   2235  *  @param[in] height The desired height, in screen coordinates, of the window.
   2236  *  This must be greater than zero.
   2237  *  @param[in] title The initial, UTF-8 encoded window title.
   2238  *  @param[in] monitor The monitor to use for full screen mode, or `NULL` for
   2239  *  windowed mode.
   2240  *  @param[in] share The window whose context to share resources with, or `NULL`
   2241  *  to not share resources.
   2242  *  @return The handle of the created window, or `NULL` if an
   2243  *  [error](@ref error_handling) occurred.
   2244  *
   2245  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   2246  *  GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_API_UNAVAILABLE, @ref
   2247  *  GLFW_VERSION_UNAVAILABLE, @ref GLFW_FORMAT_UNAVAILABLE and @ref
   2248  *  GLFW_PLATFORM_ERROR.
   2249  *
   2250  *  @remark @win32 Window creation will fail if the Microsoft GDI software
   2251  *  OpenGL implementation is the only one available.
   2252  *
   2253  *  @remark @win32 If the executable has an icon resource named `GLFW_ICON,` it
   2254  *  will be set as the initial icon for the window.  If no such icon is present,
   2255  *  the `IDI_WINLOGO` icon will be used instead.  To set a different icon, see
   2256  *  @ref glfwSetWindowIcon.
   2257  *
   2258  *  @remark @win32 The context to share resources with must not be current on
   2259  *  any other thread.
   2260  *
   2261  *  @remark @macos The OS only supports forward-compatible core profile contexts
   2262  *  for OpenGL versions 3.2 and later.  Before creating an OpenGL context of
   2263  *  version 3.2 or later you must set the
   2264  *  [GLFW_OPENGL_FORWARD_COMPAT](@ref GLFW_OPENGL_FORWARD_COMPAT_hint) and
   2265  *  [GLFW_OPENGL_PROFILE](@ref GLFW_OPENGL_PROFILE_hint) hints accordingly.
   2266  *  OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.
   2267  *
   2268  *  @remark @macos The GLFW window has no icon, as it is not a document
   2269  *  window, but the dock icon will be the same as the application bundle's icon.
   2270  *  For more information on bundles, see the
   2271  *  [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/)
   2272  *  in the Mac Developer Library.
   2273  *
   2274  *  @remark @macos The first time a window is created the menu bar is created.
   2275  *  If GLFW finds a `MainMenu.nib` it is loaded and assumed to contain a menu
   2276  *  bar.  Otherwise a minimal menu bar is created manually with common commands
   2277  *  like Hide, Quit and About.  The About entry opens a minimal about dialog
   2278  *  with information from the application's bundle.  Menu bar creation can be
   2279  *  disabled entirely with the @ref GLFW_COCOA_MENUBAR init hint.
   2280  *
   2281  *  @remark @macos On OS X 10.10 and later the window frame will not be rendered
   2282  *  at full resolution on Retina displays unless the
   2283  *  [GLFW_COCOA_RETINA_FRAMEBUFFER](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint)
   2284  *  hint is `GLFW_TRUE` and the `NSHighResolutionCapable` key is enabled in the
   2285  *  application bundle's `Info.plist`.  For more information, see
   2286  *  [High Resolution Guidelines for OS X](https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html)
   2287  *  in the Mac Developer Library.  The GLFW test and example programs use
   2288  *  a custom `Info.plist` template for this, which can be found as
   2289  *  `CMake/MacOSXBundleInfo.plist.in` in the source tree.
   2290  *
   2291  *  @remark @macos When activating frame autosaving with
   2292  *  [GLFW_COCOA_FRAME_AUTOSAVE](@ref GLFW_COCOA_FRAME_AUTOSAVE_hint), the
   2293  *  specified window size may be overriden by a previously saved size and
   2294  *  position.
   2295  *
   2296  *  @remark @x11 Some window managers will not respect the placement of
   2297  *  initially hidden windows.
   2298  *
   2299  *  @remark @x11 Due to the asynchronous nature of X11, it may take a moment for
   2300  *  a window to reach its requested state.  This means you may not be able to
   2301  *  query the final size, position or other attributes directly after window
   2302  *  creation.
   2303  *
   2304  *  @remark @x11 The name and class of the `WM_CLASS` window property will by
   2305  *  default be set to the window title passed to this function.  Set the @ref
   2306  *  GLFW_X11_WM_CLASS_NAME and @ref GLFW_X11_WM_CLASS_CLASS init hints before
   2307  *  initialization to override this.
   2308  *
   2309  *  @remark @wayland The window frame is currently unimplemented, as if
   2310  *  [GLFW_DECORATED](@ref GLFW_DECORATED_hint) was always set to `GLFW_FALSE`.
   2311  *  A compositor can still emit close, resize or maximize events, using for
   2312  *  example a keybind mechanism.
   2313  *
   2314  *  @remark @wayland A full screen window will not attempt to change the mode,
   2315  *  no matter what the requested size or refresh rate.
   2316  *
   2317  *  @remark @wayland The wl_shell protocol does not support window
   2318  *  icons, the window will inherit the one defined in the application's
   2319  *  desktop file, so this function emits @ref GLFW_PLATFORM_ERROR.
   2320  *
   2321  *  @remark @wayland Screensaver inhibition is currently unimplemented.
   2322  *
   2323  *  @thread_safety This function must only be called from the main thread.
   2324  *
   2325  *  @sa @ref window_creation
   2326  *  @sa @ref glfwDestroyWindow
   2327  *
   2328  *  @since Added in version 3.0.  Replaces `glfwOpenWindow`.
   2329  *
   2330  *  @ingroup window
   2331  */
   2332 GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);
   2333 
   2334 /*! @brief Destroys the specified window and its context.
   2335  *
   2336  *  This function destroys the specified window and its context.  On calling
   2337  *  this function, no further callbacks will be called for that window.
   2338  *
   2339  *  If the context of the specified window is current on the main thread, it is
   2340  *  detached before being destroyed.
   2341  *
   2342  *  @param[in] window The window to destroy.
   2343  *
   2344  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2345  *  GLFW_PLATFORM_ERROR.
   2346  *
   2347  *  @note The context of the specified window must not be current on any other
   2348  *  thread when this function is called.
   2349  *
   2350  *  @reentrancy This function must not be called from a callback.
   2351  *
   2352  *  @thread_safety This function must only be called from the main thread.
   2353  *
   2354  *  @sa @ref window_creation
   2355  *  @sa @ref glfwCreateWindow
   2356  *
   2357  *  @since Added in version 3.0.  Replaces `glfwCloseWindow`.
   2358  *
   2359  *  @ingroup window
   2360  */
   2361 GLFWAPI void glfwDestroyWindow(GLFWwindow* window);
   2362 
   2363 /*! @brief Checks the close flag of the specified window.
   2364  *
   2365  *  This function returns the value of the close flag of the specified window.
   2366  *
   2367  *  @param[in] window The window to query.
   2368  *  @return The value of the close flag.
   2369  *
   2370  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   2371  *
   2372  *  @thread_safety This function may be called from any thread.  Access is not
   2373  *  synchronized.
   2374  *
   2375  *  @sa @ref window_close
   2376  *
   2377  *  @since Added in version 3.0.
   2378  *
   2379  *  @ingroup window
   2380  */
   2381 GLFWAPI int glfwWindowShouldClose(GLFWwindow* window);
   2382 
   2383 /*! @brief Sets the close flag of the specified window.
   2384  *
   2385  *  This function sets the value of the close flag of the specified window.
   2386  *  This can be used to override the user's attempt to close the window, or
   2387  *  to signal that it should be closed.
   2388  *
   2389  *  @param[in] window The window whose flag to change.
   2390  *  @param[in] value The new value.
   2391  *
   2392  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   2393  *
   2394  *  @thread_safety This function may be called from any thread.  Access is not
   2395  *  synchronized.
   2396  *
   2397  *  @sa @ref window_close
   2398  *
   2399  *  @since Added in version 3.0.
   2400  *
   2401  *  @ingroup window
   2402  */
   2403 GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value);
   2404 
   2405 /*! @brief Sets the title of the specified window.
   2406  *
   2407  *  This function sets the window title, encoded as UTF-8, of the specified
   2408  *  window.
   2409  *
   2410  *  @param[in] window The window whose title to change.
   2411  *  @param[in] title The UTF-8 encoded window title.
   2412  *
   2413  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2414  *  GLFW_PLATFORM_ERROR.
   2415  *
   2416  *  @remark @macos The window title will not be updated until the next time you
   2417  *  process events.
   2418  *
   2419  *  @thread_safety This function must only be called from the main thread.
   2420  *
   2421  *  @sa @ref window_title
   2422  *
   2423  *  @since Added in version 1.0.
   2424  *  @glfw3 Added window handle parameter.
   2425  *
   2426  *  @ingroup window
   2427  */
   2428 GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title);
   2429 
   2430 /*! @brief Sets the icon for the specified window.
   2431  *
   2432  *  This function sets the icon of the specified window.  If passed an array of
   2433  *  candidate images, those of or closest to the sizes desired by the system are
   2434  *  selected.  If no images are specified, the window reverts to its default
   2435  *  icon.
   2436  *
   2437  *  The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight
   2438  *  bits per channel with the red channel first.  They are arranged canonically
   2439  *  as packed sequential rows, starting from the top-left corner.
   2440  *
   2441  *  The desired image sizes varies depending on platform and system settings.
   2442  *  The selected images will be rescaled as needed.  Good sizes include 16x16,
   2443  *  32x32 and 48x48.
   2444  *
   2445  *  @param[in] window The window whose icon to set.
   2446  *  @param[in] count The number of images in the specified array, or zero to
   2447  *  revert to the default window icon.
   2448  *  @param[in] images The images to create the icon from.  This is ignored if
   2449  *  count is zero.
   2450  *
   2451  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2452  *  GLFW_PLATFORM_ERROR.
   2453  *
   2454  *  @pointer_lifetime The specified image data is copied before this function
   2455  *  returns.
   2456  *
   2457  *  @remark @macos The GLFW window has no icon, as it is not a document
   2458  *  window, so this function does nothing.  The dock icon will be the same as
   2459  *  the application bundle's icon.  For more information on bundles, see the
   2460  *  [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/)
   2461  *  in the Mac Developer Library.
   2462  *
   2463  *  @remark @wayland The wl_shell protocol does not support icons, the window
   2464  *  will inherit the one defined in the application's desktop file, so this
   2465  *  function emits @ref GLFW_PLATFORM_ERROR.
   2466  *
   2467  *  @thread_safety This function must only be called from the main thread.
   2468  *
   2469  *  @sa @ref window_icon
   2470  *
   2471  *  @since Added in version 3.2.
   2472  *
   2473  *  @ingroup window
   2474  */
   2475 GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* images);
   2476 
   2477 /*! @brief Retrieves the position of the client area of the specified window.
   2478  *
   2479  *  This function retrieves the position, in screen coordinates, of the
   2480  *  upper-left corner of the client area of the specified window.
   2481  *
   2482  *  Any or all of the position arguments may be `NULL`.  If an error occurs, all
   2483  *  non-`NULL` position arguments will be set to zero.
   2484  *
   2485  *  @param[in] window The window to query.
   2486  *  @param[out] xpos Where to store the x-coordinate of the upper-left corner of
   2487  *  the client area, or `NULL`.
   2488  *  @param[out] ypos Where to store the y-coordinate of the upper-left corner of
   2489  *  the client area, or `NULL`.
   2490  *
   2491  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2492  *  GLFW_PLATFORM_ERROR.
   2493  *
   2494  *  @remark @wayland There is no way for an application to retrieve the global
   2495  *  position of its windows, this function will always emit @ref
   2496  *  GLFW_PLATFORM_ERROR.
   2497  *
   2498  *  @thread_safety This function must only be called from the main thread.
   2499  *
   2500  *  @sa @ref window_pos
   2501  *  @sa @ref glfwSetWindowPos
   2502  *
   2503  *  @since Added in version 3.0.
   2504  *
   2505  *  @ingroup window
   2506  */
   2507 GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos);
   2508 
   2509 /*! @brief Sets the position of the client area of the specified window.
   2510  *
   2511  *  This function sets the position, in screen coordinates, of the upper-left
   2512  *  corner of the client area of the specified windowed mode window.  If the
   2513  *  window is a full screen window, this function does nothing.
   2514  *
   2515  *  __Do not use this function__ to move an already visible window unless you
   2516  *  have very good reasons for doing so, as it will confuse and annoy the user.
   2517  *
   2518  *  The window manager may put limits on what positions are allowed.  GLFW
   2519  *  cannot and should not override these limits.
   2520  *
   2521  *  @param[in] window The window to query.
   2522  *  @param[in] xpos The x-coordinate of the upper-left corner of the client area.
   2523  *  @param[in] ypos The y-coordinate of the upper-left corner of the client area.
   2524  *
   2525  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2526  *  GLFW_PLATFORM_ERROR.
   2527  *
   2528  *  @remark @wayland There is no way for an application to set the global
   2529  *  position of its windows, this function will always emit @ref
   2530  *  GLFW_PLATFORM_ERROR.
   2531  *
   2532  *  @thread_safety This function must only be called from the main thread.
   2533  *
   2534  *  @sa @ref window_pos
   2535  *  @sa @ref glfwGetWindowPos
   2536  *
   2537  *  @since Added in version 1.0.
   2538  *  @glfw3 Added window handle parameter.
   2539  *
   2540  *  @ingroup window
   2541  */
   2542 GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);
   2543 
   2544 /*! @brief Retrieves the size of the client area of the specified window.
   2545  *
   2546  *  This function retrieves the size, in screen coordinates, of the client area
   2547  *  of the specified window.  If you wish to retrieve the size of the
   2548  *  framebuffer of the window in pixels, see @ref glfwGetFramebufferSize.
   2549  *
   2550  *  Any or all of the size arguments may be `NULL`.  If an error occurs, all
   2551  *  non-`NULL` size arguments will be set to zero.
   2552  *
   2553  *  @param[in] window The window whose size to retrieve.
   2554  *  @param[out] width Where to store the width, in screen coordinates, of the
   2555  *  client area, or `NULL`.
   2556  *  @param[out] height Where to store the height, in screen coordinates, of the
   2557  *  client area, or `NULL`.
   2558  *
   2559  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2560  *  GLFW_PLATFORM_ERROR.
   2561  *
   2562  *  @thread_safety This function must only be called from the main thread.
   2563  *
   2564  *  @sa @ref window_size
   2565  *  @sa @ref glfwSetWindowSize
   2566  *
   2567  *  @since Added in version 1.0.
   2568  *  @glfw3 Added window handle parameter.
   2569  *
   2570  *  @ingroup window
   2571  */
   2572 GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height);
   2573 
   2574 /*! @brief Sets the size limits of the specified window.
   2575  *
   2576  *  This function sets the size limits of the client area of the specified
   2577  *  window.  If the window is full screen, the size limits only take effect
   2578  *  once it is made windowed.  If the window is not resizable, this function
   2579  *  does nothing.
   2580  *
   2581  *  The size limits are applied immediately to a windowed mode window and may
   2582  *  cause it to be resized.
   2583  *
   2584  *  The maximum dimensions must be greater than or equal to the minimum
   2585  *  dimensions and all must be greater than or equal to zero.
   2586  *
   2587  *  @param[in] window The window to set limits for.
   2588  *  @param[in] minwidth The minimum width, in screen coordinates, of the client
   2589  *  area, or `GLFW_DONT_CARE`.
   2590  *  @param[in] minheight The minimum height, in screen coordinates, of the
   2591  *  client area, or `GLFW_DONT_CARE`.
   2592  *  @param[in] maxwidth The maximum width, in screen coordinates, of the client
   2593  *  area, or `GLFW_DONT_CARE`.
   2594  *  @param[in] maxheight The maximum height, in screen coordinates, of the
   2595  *  client area, or `GLFW_DONT_CARE`.
   2596  *
   2597  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   2598  *  GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
   2599  *
   2600  *  @remark If you set size limits and an aspect ratio that conflict, the
   2601  *  results are undefined.
   2602  *
   2603  *  @remark @wayland The size limits will not be applied until the window is
   2604  *  actually resized, either by the user or by the compositor.
   2605  *
   2606  *  @thread_safety This function must only be called from the main thread.
   2607  *
   2608  *  @sa @ref window_sizelimits
   2609  *  @sa @ref glfwSetWindowAspectRatio
   2610  *
   2611  *  @since Added in version 3.2.
   2612  *
   2613  *  @ingroup window
   2614  */
   2615 GLFWAPI void glfwSetWindowSizeLimits(GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight);
   2616 
   2617 /*! @brief Sets the aspect ratio of the specified window.
   2618  *
   2619  *  This function sets the required aspect ratio of the client area of the
   2620  *  specified window.  If the window is full screen, the aspect ratio only takes
   2621  *  effect once it is made windowed.  If the window is not resizable, this
   2622  *  function does nothing.
   2623  *
   2624  *  The aspect ratio is specified as a numerator and a denominator and both
   2625  *  values must be greater than zero.  For example, the common 16:9 aspect ratio
   2626  *  is specified as 16 and 9, respectively.
   2627  *
   2628  *  If the numerator and denominator is set to `GLFW_DONT_CARE` then the aspect
   2629  *  ratio limit is disabled.
   2630  *
   2631  *  The aspect ratio is applied immediately to a windowed mode window and may
   2632  *  cause it to be resized.
   2633  *
   2634  *  @param[in] window The window to set limits for.
   2635  *  @param[in] numer The numerator of the desired aspect ratio, or
   2636  *  `GLFW_DONT_CARE`.
   2637  *  @param[in] denom The denominator of the desired aspect ratio, or
   2638  *  `GLFW_DONT_CARE`.
   2639  *
   2640  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   2641  *  GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
   2642  *
   2643  *  @remark If you set size limits and an aspect ratio that conflict, the
   2644  *  results are undefined.
   2645  *
   2646  *  @remark @wayland The aspect ratio will not be applied until the window is
   2647  *  actually resized, either by the user or by the compositor.
   2648  *
   2649  *  @thread_safety This function must only be called from the main thread.
   2650  *
   2651  *  @sa @ref window_sizelimits
   2652  *  @sa @ref glfwSetWindowSizeLimits
   2653  *
   2654  *  @since Added in version 3.2.
   2655  *
   2656  *  @ingroup window
   2657  */
   2658 GLFWAPI void glfwSetWindowAspectRatio(GLFWwindow* window, int numer, int denom);
   2659 
   2660 /*! @brief Sets the size of the client area of the specified window.
   2661  *
   2662  *  This function sets the size, in screen coordinates, of the client area of
   2663  *  the specified window.
   2664  *
   2665  *  For full screen windows, this function updates the resolution of its desired
   2666  *  video mode and switches to the video mode closest to it, without affecting
   2667  *  the window's context.  As the context is unaffected, the bit depths of the
   2668  *  framebuffer remain unchanged.
   2669  *
   2670  *  If you wish to update the refresh rate of the desired video mode in addition
   2671  *  to its resolution, see @ref glfwSetWindowMonitor.
   2672  *
   2673  *  The window manager may put limits on what sizes are allowed.  GLFW cannot
   2674  *  and should not override these limits.
   2675  *
   2676  *  @param[in] window The window to resize.
   2677  *  @param[in] width The desired width, in screen coordinates, of the window
   2678  *  client area.
   2679  *  @param[in] height The desired height, in screen coordinates, of the window
   2680  *  client area.
   2681  *
   2682  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2683  *  GLFW_PLATFORM_ERROR.
   2684  *
   2685  *  @remark @wayland A full screen window will not attempt to change the mode,
   2686  *  no matter what the requested size.
   2687  *
   2688  *  @thread_safety This function must only be called from the main thread.
   2689  *
   2690  *  @sa @ref window_size
   2691  *  @sa @ref glfwGetWindowSize
   2692  *  @sa @ref glfwSetWindowMonitor
   2693  *
   2694  *  @since Added in version 1.0.
   2695  *  @glfw3 Added window handle parameter.
   2696  *
   2697  *  @ingroup window
   2698  */
   2699 GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height);
   2700 
   2701 /*! @brief Retrieves the size of the framebuffer of the specified window.
   2702  *
   2703  *  This function retrieves the size, in pixels, of the framebuffer of the
   2704  *  specified window.  If you wish to retrieve the size of the window in screen
   2705  *  coordinates, see @ref glfwGetWindowSize.
   2706  *
   2707  *  Any or all of the size arguments may be `NULL`.  If an error occurs, all
   2708  *  non-`NULL` size arguments will be set to zero.
   2709  *
   2710  *  @param[in] window The window whose framebuffer to query.
   2711  *  @param[out] width Where to store the width, in pixels, of the framebuffer,
   2712  *  or `NULL`.
   2713  *  @param[out] height Where to store the height, in pixels, of the framebuffer,
   2714  *  or `NULL`.
   2715  *
   2716  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2717  *  GLFW_PLATFORM_ERROR.
   2718  *
   2719  *  @thread_safety This function must only be called from the main thread.
   2720  *
   2721  *  @sa @ref window_fbsize
   2722  *  @sa @ref glfwSetFramebufferSizeCallback
   2723  *
   2724  *  @since Added in version 3.0.
   2725  *
   2726  *  @ingroup window
   2727  */
   2728 GLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height);
   2729 
   2730 /*! @brief Retrieves the size of the frame of the window.
   2731  *
   2732  *  This function retrieves the size, in screen coordinates, of each edge of the
   2733  *  frame of the specified window.  This size includes the title bar, if the
   2734  *  window has one.  The size of the frame may vary depending on the
   2735  *  [window-related hints](@ref window_hints_wnd) used to create it.
   2736  *
   2737  *  Because this function retrieves the size of each window frame edge and not
   2738  *  the offset along a particular coordinate axis, the retrieved values will
   2739  *  always be zero or positive.
   2740  *
   2741  *  Any or all of the size arguments may be `NULL`.  If an error occurs, all
   2742  *  non-`NULL` size arguments will be set to zero.
   2743  *
   2744  *  @param[in] window The window whose frame size to query.
   2745  *  @param[out] left Where to store the size, in screen coordinates, of the left
   2746  *  edge of the window frame, or `NULL`.
   2747  *  @param[out] top Where to store the size, in screen coordinates, of the top
   2748  *  edge of the window frame, or `NULL`.
   2749  *  @param[out] right Where to store the size, in screen coordinates, of the
   2750  *  right edge of the window frame, or `NULL`.
   2751  *  @param[out] bottom Where to store the size, in screen coordinates, of the
   2752  *  bottom edge of the window frame, or `NULL`.
   2753  *
   2754  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2755  *  GLFW_PLATFORM_ERROR.
   2756  *
   2757  *  @remark @wayland The window frame is currently unimplemented, as if
   2758  *  [GLFW_DECORATED](@ref GLFW_DECORATED_hint) was always set to `GLFW_FALSE`,
   2759  *  so the returned values will always be zero.
   2760  *
   2761  *  @thread_safety This function must only be called from the main thread.
   2762  *
   2763  *  @sa @ref window_size
   2764  *
   2765  *  @since Added in version 3.1.
   2766  *
   2767  *  @ingroup window
   2768  */
   2769 GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int* right, int* bottom);
   2770 
   2771 /*! @brief Iconifies the specified window.
   2772  *
   2773  *  This function iconifies (minimizes) the specified window if it was
   2774  *  previously restored.  If the window is already iconified, this function does
   2775  *  nothing.
   2776  *
   2777  *  If the specified window is a full screen window, the original monitor
   2778  *  resolution is restored until the window is restored.
   2779  *
   2780  *  @param[in] window The window to iconify.
   2781  *
   2782  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2783  *  GLFW_PLATFORM_ERROR.
   2784  *
   2785  *  @remark @wayland There is no concept of iconification in wl_shell, this
   2786  *  function will always emit @ref GLFW_PLATFORM_ERROR.
   2787  *
   2788  *  @thread_safety This function must only be called from the main thread.
   2789  *
   2790  *  @sa @ref window_iconify
   2791  *  @sa @ref glfwRestoreWindow
   2792  *  @sa @ref glfwMaximizeWindow
   2793  *
   2794  *  @since Added in version 2.1.
   2795  *  @glfw3 Added window handle parameter.
   2796  *
   2797  *  @ingroup window
   2798  */
   2799 GLFWAPI void glfwIconifyWindow(GLFWwindow* window);
   2800 
   2801 /*! @brief Restores the specified window.
   2802  *
   2803  *  This function restores the specified window if it was previously iconified
   2804  *  (minimized) or maximized.  If the window is already restored, this function
   2805  *  does nothing.
   2806  *
   2807  *  If the specified window is a full screen window, the resolution chosen for
   2808  *  the window is restored on the selected monitor.
   2809  *
   2810  *  @param[in] window The window to restore.
   2811  *
   2812  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2813  *  GLFW_PLATFORM_ERROR.
   2814  *
   2815  *  @thread_safety This function must only be called from the main thread.
   2816  *
   2817  *  @sa @ref window_iconify
   2818  *  @sa @ref glfwIconifyWindow
   2819  *  @sa @ref glfwMaximizeWindow
   2820  *
   2821  *  @since Added in version 2.1.
   2822  *  @glfw3 Added window handle parameter.
   2823  *
   2824  *  @ingroup window
   2825  */
   2826 GLFWAPI void glfwRestoreWindow(GLFWwindow* window);
   2827 
   2828 /*! @brief Maximizes the specified window.
   2829  *
   2830  *  This function maximizes the specified window if it was previously not
   2831  *  maximized.  If the window is already maximized, this function does nothing.
   2832  *
   2833  *  If the specified window is a full screen window, this function does nothing.
   2834  *
   2835  *  @param[in] window The window to maximize.
   2836  *
   2837  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2838  *  GLFW_PLATFORM_ERROR.
   2839  *
   2840  *  @par Thread Safety
   2841  *  This function may only be called from the main thread.
   2842  *
   2843  *  @sa @ref window_iconify
   2844  *  @sa @ref glfwIconifyWindow
   2845  *  @sa @ref glfwRestoreWindow
   2846  *
   2847  *  @since Added in GLFW 3.2.
   2848  *
   2849  *  @ingroup window
   2850  */
   2851 GLFWAPI void glfwMaximizeWindow(GLFWwindow* window);
   2852 
   2853 /*! @brief Makes the specified window visible.
   2854  *
   2855  *  This function makes the specified window visible if it was previously
   2856  *  hidden.  If the window is already visible or is in full screen mode, this
   2857  *  function does nothing.
   2858  *
   2859  *  @param[in] window The window to make visible.
   2860  *
   2861  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2862  *  GLFW_PLATFORM_ERROR.
   2863  *
   2864  *  @thread_safety This function must only be called from the main thread.
   2865  *
   2866  *  @sa @ref window_hide
   2867  *  @sa @ref glfwHideWindow
   2868  *
   2869  *  @since Added in version 3.0.
   2870  *
   2871  *  @ingroup window
   2872  */
   2873 GLFWAPI void glfwShowWindow(GLFWwindow* window);
   2874 
   2875 /*! @brief Hides the specified window.
   2876  *
   2877  *  This function hides the specified window if it was previously visible.  If
   2878  *  the window is already hidden or is in full screen mode, this function does
   2879  *  nothing.
   2880  *
   2881  *  @param[in] window The window to hide.
   2882  *
   2883  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2884  *  GLFW_PLATFORM_ERROR.
   2885  *
   2886  *  @thread_safety This function must only be called from the main thread.
   2887  *
   2888  *  @sa @ref window_hide
   2889  *  @sa @ref glfwShowWindow
   2890  *
   2891  *  @since Added in version 3.0.
   2892  *
   2893  *  @ingroup window
   2894  */
   2895 GLFWAPI void glfwHideWindow(GLFWwindow* window);
   2896 
   2897 /*! @brief Brings the specified window to front and sets input focus.
   2898  *
   2899  *  This function brings the specified window to front and sets input focus.
   2900  *  The window should already be visible and not iconified.
   2901  *
   2902  *  By default, both windowed and full screen mode windows are focused when
   2903  *  initially created.  Set the [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) to
   2904  *  disable this behavior.
   2905  *
   2906  *  __Do not use this function__ to steal focus from other applications unless
   2907  *  you are certain that is what the user wants.  Focus stealing can be
   2908  *  extremely disruptive.
   2909  *
   2910  *  For a less disruptive way of getting the user's attention, see
   2911  *  [attention requests](@ref window_attention).
   2912  *
   2913  *  @param[in] window The window to give input focus.
   2914  *
   2915  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2916  *  GLFW_PLATFORM_ERROR.
   2917  *
   2918  *  @remark @wayland It is not possible for an application to bring its windows
   2919  *  to front, this function will always emit @ref GLFW_PLATFORM_ERROR.
   2920  *
   2921  *  @thread_safety This function must only be called from the main thread.
   2922  *
   2923  *  @sa @ref window_focus
   2924  *  @sa @ref window_attention
   2925  *
   2926  *  @since Added in version 3.2.
   2927  *
   2928  *  @ingroup window
   2929  */
   2930 GLFWAPI void glfwFocusWindow(GLFWwindow* window);
   2931 
   2932 /*! @brief Requests user attention to the specified window.
   2933  *
   2934  *  This function requests user attention to the specified window.  On
   2935  *  platforms where this is not supported, attention is requested to the
   2936  *  application as a whole.
   2937  *
   2938  *  Once the user has given attention, usually by focusing the window or
   2939  *  application, the system will end the request automatically.
   2940  *
   2941  *  @param[in] window The window to request attention to.
   2942  *
   2943  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2944  *  GLFW_PLATFORM_ERROR.
   2945  *
   2946  *  @remark @macos Attention is requested to the application as a whole, not the
   2947  *  specific window.
   2948  *
   2949  *  @thread_safety This function must only be called from the main thread.
   2950  *
   2951  *  @sa @ref window_attention
   2952  *
   2953  *  @since Added in version 3.3.
   2954  *
   2955  *  @ingroup window
   2956  */
   2957 GLFWAPI void glfwRequestWindowAttention(GLFWwindow* window);
   2958 
   2959 /*! @brief Returns the monitor that the window uses for full screen mode.
   2960  *
   2961  *  This function returns the handle of the monitor that the specified window is
   2962  *  in full screen on.
   2963  *
   2964  *  @param[in] window The window to query.
   2965  *  @return The monitor, or `NULL` if the window is in windowed mode or an
   2966  *  [error](@ref error_handling) occurred.
   2967  *
   2968  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   2969  *
   2970  *  @thread_safety This function must only be called from the main thread.
   2971  *
   2972  *  @sa @ref window_monitor
   2973  *  @sa @ref glfwSetWindowMonitor
   2974  *
   2975  *  @since Added in version 3.0.
   2976  *
   2977  *  @ingroup window
   2978  */
   2979 GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);
   2980 
   2981 /*! @brief Sets the mode, monitor, video mode and placement of a window.
   2982  *
   2983  *  This function sets the monitor that the window uses for full screen mode or,
   2984  *  if the monitor is `NULL`, makes it windowed mode.
   2985  *
   2986  *  When setting a monitor, this function updates the width, height and refresh
   2987  *  rate of the desired video mode and switches to the video mode closest to it.
   2988  *  The window position is ignored when setting a monitor.
   2989  *
   2990  *  When the monitor is `NULL`, the position, width and height are used to
   2991  *  place the window client area.  The refresh rate is ignored when no monitor
   2992  *  is specified.
   2993  *
   2994  *  If you only wish to update the resolution of a full screen window or the
   2995  *  size of a windowed mode window, see @ref glfwSetWindowSize.
   2996  *
   2997  *  When a window transitions from full screen to windowed mode, this function
   2998  *  restores any previous window settings such as whether it is decorated,
   2999  *  floating, resizable, has size or aspect ratio limits, etc.
   3000  *
   3001  *  @param[in] window The window whose monitor, size or video mode to set.
   3002  *  @param[in] monitor The desired monitor, or `NULL` to set windowed mode.
   3003  *  @param[in] xpos The desired x-coordinate of the upper-left corner of the
   3004  *  client area.
   3005  *  @param[in] ypos The desired y-coordinate of the upper-left corner of the
   3006  *  client area.
   3007  *  @param[in] width The desired with, in screen coordinates, of the client area
   3008  *  or video mode.
   3009  *  @param[in] height The desired height, in screen coordinates, of the client
   3010  *  area or video mode.
   3011  *  @param[in] refreshRate The desired refresh rate, in Hz, of the video mode,
   3012  *  or `GLFW_DONT_CARE`.
   3013  *
   3014  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3015  *  GLFW_PLATFORM_ERROR.
   3016  *
   3017  *  @remark The OpenGL or OpenGL ES context will not be destroyed or otherwise
   3018  *  affected by any resizing or mode switching, although you may need to update
   3019  *  your viewport if the framebuffer size has changed.
   3020  *
   3021  *  @remark @wayland The desired window position is ignored, as there is no way
   3022  *  for an application to set this property.
   3023  *
   3024  *  @remark @wayland Setting the window to full screen will not attempt to
   3025  *  change the mode, no matter what the requested size or refresh rate.
   3026  *
   3027  *  @thread_safety This function must only be called from the main thread.
   3028  *
   3029  *  @sa @ref window_monitor
   3030  *  @sa @ref window_full_screen
   3031  *  @sa @ref glfwGetWindowMonitor
   3032  *  @sa @ref glfwSetWindowSize
   3033  *
   3034  *  @since Added in version 3.2.
   3035  *
   3036  *  @ingroup window
   3037  */
   3038 GLFWAPI void glfwSetWindowMonitor(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate);
   3039 
   3040 /*! @brief Returns an attribute of the specified window.
   3041  *
   3042  *  This function returns the value of an attribute of the specified window or
   3043  *  its OpenGL or OpenGL ES context.
   3044  *
   3045  *  @param[in] window The window to query.
   3046  *  @param[in] attrib The [window attribute](@ref window_attribs) whose value to
   3047  *  return.
   3048  *  @return The value of the attribute, or zero if an
   3049  *  [error](@ref error_handling) occurred.
   3050  *
   3051  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   3052  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   3053  *
   3054  *  @remark Framebuffer related hints are not window attributes.  See @ref
   3055  *  window_attribs_fb for more information.
   3056  *
   3057  *  @remark Zero is a valid value for many window and context related
   3058  *  attributes so you cannot use a return value of zero as an indication of
   3059  *  errors.  However, this function should not fail as long as it is passed
   3060  *  valid arguments and the library has been [initialized](@ref intro_init).
   3061  *
   3062  *  @thread_safety This function must only be called from the main thread.
   3063  *
   3064  *  @sa @ref window_attribs
   3065  *  @sa @ref glfwSetWindowAttrib
   3066  *
   3067  *  @since Added in version 3.0.  Replaces `glfwGetWindowParam` and
   3068  *  `glfwGetGLVersion`.
   3069  *
   3070  *  @ingroup window
   3071  */
   3072 GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib);
   3073 
   3074 /*! @brief Sets an attribute of the specified window.
   3075  *
   3076  *  This function sets the value of an attribute of the specified window.
   3077  *
   3078  *  The supported attributes are [GLFW_DECORATED](@ref GLFW_DECORATED_attrib),
   3079  *  [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib),
   3080  *  [GLFW_FLOATING](@ref GLFW_FLOATING_attrib) and
   3081  *  [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib).   
   3082  *
   3083  *  Some of these attributes are ignored for full screen windows.  The new
   3084  *  value will take effect if the window is later made windowed.
   3085  *
   3086  *  Some of these attributes are ignored for windowed mode windows.  The new
   3087  *  value will take effect if the window is later made full screen.
   3088  *
   3089  *  @param[in] window The window to set the attribute for.
   3090  *  @param[in] attrib A supported window attribute.
   3091  *  @param[in] value `GLFW_TRUE` or `GLFW_FALSE`.
   3092  *
   3093  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   3094  *  GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
   3095  *
   3096  *  @remark Calling @ref glfwGetWindowAttrib will always return the latest
   3097  *  value, even if that value is ignored by the current mode of the window.
   3098  *
   3099  *  @thread_safety This function must only be called from the main thread.
   3100  *
   3101  *  @sa @ref window_attribs
   3102  *  @sa @ref glfwGetWindowAttrib
   3103  *
   3104  *  @since Added in version 3.3.
   3105  *
   3106  *  @ingroup window
   3107  */
   3108 GLFWAPI void glfwSetWindowAttrib(GLFWwindow* window, int attrib, int value);
   3109 
   3110 /*! @brief Sets the user pointer of the specified window.
   3111  *
   3112  *  This function sets the user-defined pointer of the specified window.  The
   3113  *  current value is retained until the window is destroyed.  The initial value
   3114  *  is `NULL`.
   3115  *
   3116  *  @param[in] window The window whose pointer to set.
   3117  *  @param[in] pointer The new value.
   3118  *
   3119  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3120  *
   3121  *  @thread_safety This function may be called from any thread.  Access is not
   3122  *  synchronized.
   3123  *
   3124  *  @sa @ref window_userptr
   3125  *  @sa @ref glfwGetWindowUserPointer
   3126  *
   3127  *  @since Added in version 3.0.
   3128  *
   3129  *  @ingroup window
   3130  */
   3131 GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer);
   3132 
   3133 /*! @brief Returns the user pointer of the specified window.
   3134  *
   3135  *  This function returns the current value of the user-defined pointer of the
   3136  *  specified window.  The initial value is `NULL`.
   3137  *
   3138  *  @param[in] window The window whose pointer to return.
   3139  *
   3140  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3141  *
   3142  *  @thread_safety This function may be called from any thread.  Access is not
   3143  *  synchronized.
   3144  *
   3145  *  @sa @ref window_userptr
   3146  *  @sa @ref glfwSetWindowUserPointer
   3147  *
   3148  *  @since Added in version 3.0.
   3149  *
   3150  *  @ingroup window
   3151  */
   3152 GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window);
   3153 
   3154 /*! @brief Sets the position callback for the specified window.
   3155  *
   3156  *  This function sets the position callback of the specified window, which is
   3157  *  called when the window is moved.  The callback is provided with the screen
   3158  *  position of the upper-left corner of the client area of the window.
   3159  *
   3160  *  @param[in] window The window whose callback to set.
   3161  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   3162  *  callback.
   3163  *  @return The previously set callback, or `NULL` if no callback was set or the
   3164  *  library had not been [initialized](@ref intro_init).
   3165  *
   3166  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3167  *
   3168  *  @remark @wayland This callback will never be called, as there is no way for
   3169  *  an application to know its global position.
   3170  *
   3171  *  @thread_safety This function must only be called from the main thread.
   3172  *
   3173  *  @sa @ref window_pos
   3174  *
   3175  *  @since Added in version 3.0.
   3176  *
   3177  *  @ingroup window
   3178  */
   3179 GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun);
   3180 
   3181 /*! @brief Sets the size callback for the specified window.
   3182  *
   3183  *  This function sets the size callback of the specified window, which is
   3184  *  called when the window is resized.  The callback is provided with the size,
   3185  *  in screen coordinates, of the client area of the window.
   3186  *
   3187  *  @param[in] window The window whose callback to set.
   3188  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   3189  *  callback.
   3190  *  @return The previously set callback, or `NULL` if no callback was set or the
   3191  *  library had not been [initialized](@ref intro_init).
   3192  *
   3193  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3194  *
   3195  *  @thread_safety This function must only be called from the main thread.
   3196  *
   3197  *  @sa @ref window_size
   3198  *
   3199  *  @since Added in version 1.0.
   3200  *  @glfw3 Added window handle parameter and return value.
   3201  *
   3202  *  @ingroup window
   3203  */
   3204 GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun);
   3205 
   3206 /*! @brief Sets the close callback for the specified window.
   3207  *
   3208  *  This function sets the close callback of the specified window, which is
   3209  *  called when the user attempts to close the window, for example by clicking
   3210  *  the close widget in the title bar.
   3211  *
   3212  *  The close flag is set before this callback is called, but you can modify it
   3213  *  at any time with @ref glfwSetWindowShouldClose.
   3214  *
   3215  *  The close callback is not triggered by @ref glfwDestroyWindow.
   3216  *
   3217  *  @param[in] window The window whose callback to set.
   3218  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   3219  *  callback.
   3220  *  @return The previously set callback, or `NULL` if no callback was set or the
   3221  *  library had not been [initialized](@ref intro_init).
   3222  *
   3223  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3224  *
   3225  *  @remark @macos Selecting Quit from the application menu will trigger the
   3226  *  close callback for all windows.
   3227  *
   3228  *  @thread_safety This function must only be called from the main thread.
   3229  *
   3230  *  @sa @ref window_close
   3231  *
   3232  *  @since Added in version 2.5.
   3233  *  @glfw3 Added window handle parameter and return value.
   3234  *
   3235  *  @ingroup window
   3236  */
   3237 GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun);
   3238 
   3239 /*! @brief Sets the refresh callback for the specified window.
   3240  *
   3241  *  This function sets the refresh callback of the specified window, which is
   3242  *  called when the client area of the window needs to be redrawn, for example
   3243  *  if the window has been exposed after having been covered by another window.
   3244  *
   3245  *  On compositing window systems such as Aero, Compiz, Aqua or Wayland, where
   3246  *  the window contents are saved off-screen, this callback may be called only
   3247  *  very infrequently or never at all.
   3248  *
   3249  *  @param[in] window The window whose callback to set.
   3250  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   3251  *  callback.
   3252  *  @return The previously set callback, or `NULL` if no callback was set or the
   3253  *  library had not been [initialized](@ref intro_init).
   3254  *
   3255  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3256  *
   3257  *  @thread_safety This function must only be called from the main thread.
   3258  *
   3259  *  @sa @ref window_refresh
   3260  *
   3261  *  @since Added in version 2.5.
   3262  *  @glfw3 Added window handle parameter and return value.
   3263  *
   3264  *  @ingroup window
   3265  */
   3266 GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun);
   3267 
   3268 /*! @brief Sets the focus callback for the specified window.
   3269  *
   3270  *  This function sets the focus callback of the specified window, which is
   3271  *  called when the window gains or loses input focus.
   3272  *
   3273  *  After the focus callback is called for a window that lost input focus,
   3274  *  synthetic key and mouse button release events will be generated for all such
   3275  *  that had been pressed.  For more information, see @ref glfwSetKeyCallback
   3276  *  and @ref glfwSetMouseButtonCallback.
   3277  *
   3278  *  @param[in] window The window whose callback to set.
   3279  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   3280  *  callback.
   3281  *  @return The previously set callback, or `NULL` if no callback was set or the
   3282  *  library had not been [initialized](@ref intro_init).
   3283  *
   3284  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3285  *
   3286  *  @thread_safety This function must only be called from the main thread.
   3287  *
   3288  *  @sa @ref window_focus
   3289  *
   3290  *  @since Added in version 3.0.
   3291  *
   3292  *  @ingroup window
   3293  */
   3294 GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun);
   3295 
   3296 /*! @brief Sets the iconify callback for the specified window.
   3297  *
   3298  *  This function sets the iconification callback of the specified window, which
   3299  *  is called when the window is iconified or restored.
   3300  *
   3301  *  @param[in] window The window whose callback to set.
   3302  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   3303  *  callback.
   3304  *  @return The previously set callback, or `NULL` if no callback was set or the
   3305  *  library had not been [initialized](@ref intro_init).
   3306  *
   3307  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3308  *
   3309  *  @remark @wayland The wl_shell protocol has no concept of iconification,
   3310  *  this callback will never be called.
   3311  *
   3312  *  @thread_safety This function must only be called from the main thread.
   3313  *
   3314  *  @sa @ref window_iconify
   3315  *
   3316  *  @since Added in version 3.0.
   3317  *
   3318  *  @ingroup window
   3319  */
   3320 GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun);
   3321 
   3322 /*! @brief Sets the maximize callback for the specified window.
   3323  *
   3324  *  This function sets the maximization callback of the specified window, which
   3325  *  is called when the window is maximized or restored.
   3326  *
   3327  *  @param[in] window The window whose callback to set.
   3328  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   3329  *  callback.
   3330  *  @return The previously set callback, or `NULL` if no callback was set or the
   3331  *  library had not been [initialized](@ref intro_init).
   3332  *
   3333  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3334  *
   3335  *  @thread_safety This function must only be called from the main thread.
   3336  *
   3337  *  @sa @ref window_maximize
   3338  *
   3339  *  @since Added in version 3.3.
   3340  *
   3341  *  @ingroup window
   3342  */
   3343 GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun cbfun);
   3344 
   3345 /*! @brief Sets the framebuffer resize callback for the specified window.
   3346  *
   3347  *  This function sets the framebuffer resize callback of the specified window,
   3348  *  which is called when the framebuffer of the specified window is resized.
   3349  *
   3350  *  @param[in] window The window whose callback to set.
   3351  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   3352  *  callback.
   3353  *  @return The previously set callback, or `NULL` if no callback was set or the
   3354  *  library had not been [initialized](@ref intro_init).
   3355  *
   3356  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3357  *
   3358  *  @thread_safety This function must only be called from the main thread.
   3359  *
   3360  *  @sa @ref window_fbsize
   3361  *
   3362  *  @since Added in version 3.0.
   3363  *
   3364  *  @ingroup window
   3365  */
   3366 GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun);
   3367 
   3368 /*! @brief Processes all pending events.
   3369  *
   3370  *  This function processes only those events that are already in the event
   3371  *  queue and then returns immediately.  Processing events will cause the window
   3372  *  and input callbacks associated with those events to be called.
   3373  *
   3374  *  On some platforms, a window move, resize or menu operation will cause event
   3375  *  processing to block.  This is due to how event processing is designed on
   3376  *  those platforms.  You can use the
   3377  *  [window refresh callback](@ref window_refresh) to redraw the contents of
   3378  *  your window when necessary during such operations.
   3379  *
   3380  *  Do not assume that callbacks you set will _only_ be called in response to
   3381  *  event processing functions like this one.  While it is necessary to poll for
   3382  *  events, window systems that require GLFW to register callbacks of its own
   3383  *  can pass events to GLFW in response to many window system function calls.
   3384  *  GLFW will pass those events on to the application callbacks before
   3385  *  returning.
   3386  *
   3387  *  Event processing is not required for joystick input to work.
   3388  *
   3389  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3390  *  GLFW_PLATFORM_ERROR.
   3391  *
   3392  *  @reentrancy This function must not be called from a callback.
   3393  *
   3394  *  @thread_safety This function must only be called from the main thread.
   3395  *
   3396  *  @sa @ref events
   3397  *  @sa @ref glfwWaitEvents
   3398  *  @sa @ref glfwWaitEventsTimeout
   3399  *
   3400  *  @since Added in version 1.0.
   3401  *
   3402  *  @ingroup window
   3403  */
   3404 GLFWAPI void glfwPollEvents(void);
   3405 
   3406 /*! @brief Waits until events are queued and processes them.
   3407  *
   3408  *  This function puts the calling thread to sleep until at least one event is
   3409  *  available in the event queue.  Once one or more events are available,
   3410  *  it behaves exactly like @ref glfwPollEvents, i.e. the events in the queue
   3411  *  are processed and the function then returns immediately.  Processing events
   3412  *  will cause the window and input callbacks associated with those events to be
   3413  *  called.
   3414  *
   3415  *  Since not all events are associated with callbacks, this function may return
   3416  *  without a callback having been called even if you are monitoring all
   3417  *  callbacks.
   3418  *
   3419  *  On some platforms, a window move, resize or menu operation will cause event
   3420  *  processing to block.  This is due to how event processing is designed on
   3421  *  those platforms.  You can use the
   3422  *  [window refresh callback](@ref window_refresh) to redraw the contents of
   3423  *  your window when necessary during such operations.
   3424  *
   3425  *  Do not assume that callbacks you set will _only_ be called in response to
   3426  *  event processing functions like this one.  While it is necessary to poll for
   3427  *  events, window systems that require GLFW to register callbacks of its own
   3428  *  can pass events to GLFW in response to many window system function calls.
   3429  *  GLFW will pass those events on to the application callbacks before
   3430  *  returning.
   3431  *
   3432  *  If no windows exist, this function returns immediately.  For synchronization
   3433  *  of threads in applications that do not create windows, use your threading
   3434  *  library of choice.
   3435  *
   3436  *  Event processing is not required for joystick input to work.
   3437  *
   3438  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3439  *  GLFW_PLATFORM_ERROR.
   3440  *
   3441  *  @reentrancy This function must not be called from a callback.
   3442  *
   3443  *  @thread_safety This function must only be called from the main thread.
   3444  *
   3445  *  @sa @ref events
   3446  *  @sa @ref glfwPollEvents
   3447  *  @sa @ref glfwWaitEventsTimeout
   3448  *
   3449  *  @since Added in version 2.5.
   3450  *
   3451  *  @ingroup window
   3452  */
   3453 GLFWAPI void glfwWaitEvents(void);
   3454 
   3455 /*! @brief Waits with timeout until events are queued and processes them.
   3456  *
   3457  *  This function puts the calling thread to sleep until at least one event is
   3458  *  available in the event queue, or until the specified timeout is reached.  If
   3459  *  one or more events are available, it behaves exactly like @ref
   3460  *  glfwPollEvents, i.e. the events in the queue are processed and the function
   3461  *  then returns immediately.  Processing events will cause the window and input
   3462  *  callbacks associated with those events to be called.
   3463  *
   3464  *  The timeout value must be a positive finite number.
   3465  *
   3466  *  Since not all events are associated with callbacks, this function may return
   3467  *  without a callback having been called even if you are monitoring all
   3468  *  callbacks.
   3469  *
   3470  *  On some platforms, a window move, resize or menu operation will cause event
   3471  *  processing to block.  This is due to how event processing is designed on
   3472  *  those platforms.  You can use the
   3473  *  [window refresh callback](@ref window_refresh) to redraw the contents of
   3474  *  your window when necessary during such operations.
   3475  *
   3476  *  Do not assume that callbacks you set will _only_ be called in response to
   3477  *  event processing functions like this one.  While it is necessary to poll for
   3478  *  events, window systems that require GLFW to register callbacks of its own
   3479  *  can pass events to GLFW in response to many window system function calls.
   3480  *  GLFW will pass those events on to the application callbacks before
   3481  *  returning.
   3482  *
   3483  *  If no windows exist, this function returns immediately.  For synchronization
   3484  *  of threads in applications that do not create windows, use your threading
   3485  *  library of choice.
   3486  *
   3487  *  Event processing is not required for joystick input to work.
   3488  *
   3489  *  @param[in] timeout The maximum amount of time, in seconds, to wait.
   3490  *
   3491  *  @reentrancy This function must not be called from a callback.
   3492  *
   3493  *  @thread_safety This function must only be called from the main thread.
   3494  *
   3495  *  @sa @ref events
   3496  *  @sa @ref glfwPollEvents
   3497  *  @sa @ref glfwWaitEvents
   3498  *
   3499  *  @since Added in version 3.2.
   3500  *
   3501  *  @ingroup window
   3502  */
   3503 GLFWAPI void glfwWaitEventsTimeout(double timeout);
   3504 
   3505 /*! @brief Posts an empty event to the event queue.
   3506  *
   3507  *  This function posts an empty event from the current thread to the event
   3508  *  queue, causing @ref glfwWaitEvents or @ref glfwWaitEventsTimeout to return.
   3509  *
   3510  *  If no windows exist, this function returns immediately.  For synchronization
   3511  *  of threads in applications that do not create windows, use your threading
   3512  *  library of choice.
   3513  *
   3514  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3515  *  GLFW_PLATFORM_ERROR.
   3516  *
   3517  *  @thread_safety This function may be called from any thread.
   3518  *
   3519  *  @sa @ref events
   3520  *  @sa @ref glfwWaitEvents
   3521  *  @sa @ref glfwWaitEventsTimeout
   3522  *
   3523  *  @since Added in version 3.1.
   3524  *
   3525  *  @ingroup window
   3526  */
   3527 GLFWAPI void glfwPostEmptyEvent(void);
   3528 
   3529 /*! @brief Returns the value of an input option for the specified window.
   3530  *
   3531  *  This function returns the value of an input option for the specified window.
   3532  *  The mode must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS or
   3533  *  @ref GLFW_STICKY_MOUSE_BUTTONS.
   3534  *
   3535  *  @param[in] window The window to query.
   3536  *  @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
   3537  *  `GLFW_STICKY_MOUSE_BUTTONS`.
   3538  *
   3539  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3540  *  GLFW_INVALID_ENUM.
   3541  *
   3542  *  @thread_safety This function must only be called from the main thread.
   3543  *
   3544  *  @sa @ref glfwSetInputMode
   3545  *
   3546  *  @since Added in version 3.0.
   3547  *
   3548  *  @ingroup input
   3549  */
   3550 GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);
   3551 
   3552 /*! @brief Sets an input option for the specified window.
   3553  *
   3554  *  This function sets an input mode option for the specified window.  The mode
   3555  *  must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS or
   3556  *  @ref GLFW_STICKY_MOUSE_BUTTONS.
   3557  *
   3558  *  If the mode is `GLFW_CURSOR`, the value must be one of the following cursor
   3559  *  modes:
   3560  *  - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally.
   3561  *  - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client
   3562  *    area of the window but does not restrict the cursor from leaving.
   3563  *  - `GLFW_CURSOR_DISABLED` hides and grabs the cursor, providing virtual
   3564  *    and unlimited cursor movement.  This is useful for implementing for
   3565  *    example 3D camera controls.
   3566  *
   3567  *  If the mode is `GLFW_STICKY_KEYS`, the value must be either `GLFW_TRUE` to
   3568  *  enable sticky keys, or `GLFW_FALSE` to disable it.  If sticky keys are
   3569  *  enabled, a key press will ensure that @ref glfwGetKey returns `GLFW_PRESS`
   3570  *  the next time it is called even if the key had been released before the
   3571  *  call.  This is useful when you are only interested in whether keys have been
   3572  *  pressed but not when or in which order.
   3573  *
   3574  *  If the mode is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either
   3575  *  `GLFW_TRUE` to enable sticky mouse buttons, or `GLFW_FALSE` to disable it.
   3576  *  If sticky mouse buttons are enabled, a mouse button press will ensure that
   3577  *  @ref glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even
   3578  *  if the mouse button had been released before the call.  This is useful when
   3579  *  you are only interested in whether mouse buttons have been pressed but not
   3580  *  when or in which order.
   3581  *
   3582  *  @param[in] window The window whose input mode to set.
   3583  *  @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
   3584  *  `GLFW_STICKY_MOUSE_BUTTONS`.
   3585  *  @param[in] value The new value of the specified input mode.
   3586  *
   3587  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   3588  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   3589  *
   3590  *  @thread_safety This function must only be called from the main thread.
   3591  *
   3592  *  @sa @ref glfwGetInputMode
   3593  *
   3594  *  @since Added in version 3.0.  Replaces `glfwEnable` and `glfwDisable`.
   3595  *
   3596  *  @ingroup input
   3597  */
   3598 GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value);
   3599 
   3600 /*! @brief Returns the layout-specific name of the specified printable key.
   3601  *
   3602  *  This function returns the name of the specified printable key, encoded as
   3603  *  UTF-8.  This is typically the character that key would produce without any
   3604  *  modifier keys, intended for displaying key bindings to the user.  For dead
   3605  *  keys, it is typically the diacritic it would add to a character.
   3606  *
   3607  *  __Do not use this function__ for [text input](@ref input_char).  You will
   3608  *  break text input for many languages even if it happens to work for yours.
   3609  *
   3610  *  If the key is `GLFW_KEY_UNKNOWN`, the scancode is used to identify the key,
   3611  *  otherwise the scancode is ignored.  If you specify a non-printable key, or
   3612  *  `GLFW_KEY_UNKNOWN` and a scancode that maps to a non-printable key, this
   3613  *  function returns `NULL` but does not emit an error.
   3614  *
   3615  *  This behavior allows you to always pass in the arguments in the
   3616  *  [key callback](@ref input_key) without modification.
   3617  *
   3618  *  The printable keys are:
   3619  *  - `GLFW_KEY_APOSTROPHE`
   3620  *  - `GLFW_KEY_COMMA`
   3621  *  - `GLFW_KEY_MINUS`
   3622  *  - `GLFW_KEY_PERIOD`
   3623  *  - `GLFW_KEY_SLASH`
   3624  *  - `GLFW_KEY_SEMICOLON`
   3625  *  - `GLFW_KEY_EQUAL`
   3626  *  - `GLFW_KEY_LEFT_BRACKET`
   3627  *  - `GLFW_KEY_RIGHT_BRACKET`
   3628  *  - `GLFW_KEY_BACKSLASH`
   3629  *  - `GLFW_KEY_WORLD_1`
   3630  *  - `GLFW_KEY_WORLD_2`
   3631  *  - `GLFW_KEY_0` to `GLFW_KEY_9`
   3632  *  - `GLFW_KEY_A` to `GLFW_KEY_Z`
   3633  *  - `GLFW_KEY_KP_0` to `GLFW_KEY_KP_9`
   3634  *  - `GLFW_KEY_KP_DECIMAL`
   3635  *  - `GLFW_KEY_KP_DIVIDE`
   3636  *  - `GLFW_KEY_KP_MULTIPLY`
   3637  *  - `GLFW_KEY_KP_SUBTRACT`
   3638  *  - `GLFW_KEY_KP_ADD`
   3639  *  - `GLFW_KEY_KP_EQUAL`
   3640  *
   3641  *  Names for printable keys depend on keyboard layout, while names for
   3642  *  non-printable keys are the same across layouts but depend on the application
   3643  *  language and should be localized along with other user interface text.
   3644  *
   3645  *  @param[in] key The key to query, or `GLFW_KEY_UNKNOWN`.
   3646  *  @param[in] scancode The scancode of the key to query.
   3647  *  @return The UTF-8 encoded, layout-specific name of the key, or `NULL`.
   3648  *
   3649  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3650  *  GLFW_PLATFORM_ERROR.
   3651  *
   3652  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   3653  *  should not free it yourself.  It is valid until the next call to @ref
   3654  *  glfwGetKeyName, or until the library is terminated.
   3655  *
   3656  *  @thread_safety This function must only be called from the main thread.
   3657  *
   3658  *  @sa @ref input_key_name
   3659  *
   3660  *  @since Added in version 3.2.
   3661  *
   3662  *  @ingroup input
   3663  */
   3664 GLFWAPI const char* glfwGetKeyName(int key, int scancode);
   3665 
   3666 /*! @brief Returns the platform-specific scancode of the specified key.
   3667  *
   3668  *  This function returns the platform-specific scancode of the specified key.
   3669  *
   3670  *  If the key is `GLFW_KEY_UNKNOWN` or does not exist on the keyboard this
   3671  *  method will return `-1`.
   3672  *
   3673  *  @param[in] key Any [named key](@ref keys).
   3674  *  @return The platform-specific scancode for the key, or `-1` if an
   3675  *  [error](@ref error_handling) occurred.
   3676  *
   3677  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   3678  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   3679  *
   3680  *  @thread_safety This function may be called from any thread.
   3681  *
   3682  *  @sa @ref input_key
   3683  *
   3684  *  @since Added in version 3.3.
   3685  *
   3686  *  @ingroup input
   3687  */
   3688 GLFWAPI int glfwGetKeyScancode(int key);
   3689 
   3690 /*! @brief Returns the last reported state of a keyboard key for the specified
   3691  *  window.
   3692  *
   3693  *  This function returns the last state reported for the specified key to the
   3694  *  specified window.  The returned state is one of `GLFW_PRESS` or
   3695  *  `GLFW_RELEASE`.  The higher-level action `GLFW_REPEAT` is only reported to
   3696  *  the key callback.
   3697  *
   3698  *  If the @ref GLFW_STICKY_KEYS input mode is enabled, this function returns
   3699  *  `GLFW_PRESS` the first time you call it for a key that was pressed, even if
   3700  *  that key has already been released.
   3701  *
   3702  *  The key functions deal with physical keys, with [key tokens](@ref keys)
   3703  *  named after their use on the standard US keyboard layout.  If you want to
   3704  *  input text, use the Unicode character callback instead.
   3705  *
   3706  *  The [modifier key bit masks](@ref mods) are not key tokens and cannot be
   3707  *  used with this function.
   3708  *
   3709  *  __Do not use this function__ to implement [text input](@ref input_char).
   3710  *
   3711  *  @param[in] window The desired window.
   3712  *  @param[in] key The desired [keyboard key](@ref keys).  `GLFW_KEY_UNKNOWN` is
   3713  *  not a valid key for this function.
   3714  *  @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
   3715  *
   3716  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3717  *  GLFW_INVALID_ENUM.
   3718  *
   3719  *  @thread_safety This function must only be called from the main thread.
   3720  *
   3721  *  @sa @ref input_key
   3722  *
   3723  *  @since Added in version 1.0.
   3724  *  @glfw3 Added window handle parameter.
   3725  *
   3726  *  @ingroup input
   3727  */
   3728 GLFWAPI int glfwGetKey(GLFWwindow* window, int key);
   3729 
   3730 /*! @brief Returns the last reported state of a mouse button for the specified
   3731  *  window.
   3732  *
   3733  *  This function returns the last state reported for the specified mouse button
   3734  *  to the specified window.  The returned state is one of `GLFW_PRESS` or
   3735  *  `GLFW_RELEASE`.
   3736  *
   3737  *  If the @ref GLFW_STICKY_MOUSE_BUTTONS input mode is enabled, this function
   3738  *  `GLFW_PRESS` the first time you call it for a mouse button that was pressed,
   3739  *  even if that mouse button has already been released.
   3740  *
   3741  *  @param[in] window The desired window.
   3742  *  @param[in] button The desired [mouse button](@ref buttons).
   3743  *  @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
   3744  *
   3745  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3746  *  GLFW_INVALID_ENUM.
   3747  *
   3748  *  @thread_safety This function must only be called from the main thread.
   3749  *
   3750  *  @sa @ref input_mouse_button
   3751  *
   3752  *  @since Added in version 1.0.
   3753  *  @glfw3 Added window handle parameter.
   3754  *
   3755  *  @ingroup input
   3756  */
   3757 GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button);
   3758 
   3759 /*! @brief Retrieves the position of the cursor relative to the client area of
   3760  *  the window.
   3761  *
   3762  *  This function returns the position of the cursor, in screen coordinates,
   3763  *  relative to the upper-left corner of the client area of the specified
   3764  *  window.
   3765  *
   3766  *  If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor
   3767  *  position is unbounded and limited only by the minimum and maximum values of
   3768  *  a `double`.
   3769  *
   3770  *  The coordinate can be converted to their integer equivalents with the
   3771  *  `floor` function.  Casting directly to an integer type works for positive
   3772  *  coordinates, but fails for negative ones.
   3773  *
   3774  *  Any or all of the position arguments may be `NULL`.  If an error occurs, all
   3775  *  non-`NULL` position arguments will be set to zero.
   3776  *
   3777  *  @param[in] window The desired window.
   3778  *  @param[out] xpos Where to store the cursor x-coordinate, relative to the
   3779  *  left edge of the client area, or `NULL`.
   3780  *  @param[out] ypos Where to store the cursor y-coordinate, relative to the to
   3781  *  top edge of the client area, or `NULL`.
   3782  *
   3783  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3784  *  GLFW_PLATFORM_ERROR.
   3785  *
   3786  *  @thread_safety This function must only be called from the main thread.
   3787  *
   3788  *  @sa @ref cursor_pos
   3789  *  @sa @ref glfwSetCursorPos
   3790  *
   3791  *  @since Added in version 3.0.  Replaces `glfwGetMousePos`.
   3792  *
   3793  *  @ingroup input
   3794  */
   3795 GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);
   3796 
   3797 /*! @brief Sets the position of the cursor, relative to the client area of the
   3798  *  window.
   3799  *
   3800  *  This function sets the position, in screen coordinates, of the cursor
   3801  *  relative to the upper-left corner of the client area of the specified
   3802  *  window.  The window must have input focus.  If the window does not have
   3803  *  input focus when this function is called, it fails silently.
   3804  *
   3805  *  __Do not use this function__ to implement things like camera controls.  GLFW
   3806  *  already provides the `GLFW_CURSOR_DISABLED` cursor mode that hides the
   3807  *  cursor, transparently re-centers it and provides unconstrained cursor
   3808  *  motion.  See @ref glfwSetInputMode for more information.
   3809  *
   3810  *  If the cursor mode is `GLFW_CURSOR_DISABLED` then the cursor position is
   3811  *  unconstrained and limited only by the minimum and maximum values of
   3812  *  a `double`.
   3813  *
   3814  *  @param[in] window The desired window.
   3815  *  @param[in] xpos The desired x-coordinate, relative to the left edge of the
   3816  *  client area.
   3817  *  @param[in] ypos The desired y-coordinate, relative to the top edge of the
   3818  *  client area.
   3819  *
   3820  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3821  *  GLFW_PLATFORM_ERROR.
   3822  *
   3823  *  @remark @wayland This function will only work when the cursor mode is
   3824  *  `GLFW_CURSOR_DISABLED`, otherwise it will do nothing.
   3825  *
   3826  *  @thread_safety This function must only be called from the main thread.
   3827  *
   3828  *  @sa @ref cursor_pos
   3829  *  @sa @ref glfwGetCursorPos
   3830  *
   3831  *  @since Added in version 3.0.  Replaces `glfwSetMousePos`.
   3832  *
   3833  *  @ingroup input
   3834  */
   3835 GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);
   3836 
   3837 /*! @brief Creates a custom cursor.
   3838  *
   3839  *  Creates a new custom cursor image that can be set for a window with @ref
   3840  *  glfwSetCursor.  The cursor can be destroyed with @ref glfwDestroyCursor.
   3841  *  Any remaining cursors are destroyed by @ref glfwTerminate.
   3842  *
   3843  *  The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight
   3844  *  bits per channel with the red channel first.  They are arranged canonically
   3845  *  as packed sequential rows, starting from the top-left corner.
   3846  *
   3847  *  The cursor hotspot is specified in pixels, relative to the upper-left corner
   3848  *  of the cursor image.  Like all other coordinate systems in GLFW, the X-axis
   3849  *  points to the right and the Y-axis points down.
   3850  *
   3851  *  @param[in] image The desired cursor image.
   3852  *  @param[in] xhot The desired x-coordinate, in pixels, of the cursor hotspot.
   3853  *  @param[in] yhot The desired y-coordinate, in pixels, of the cursor hotspot.
   3854  *  @return The handle of the created cursor, or `NULL` if an
   3855  *  [error](@ref error_handling) occurred.
   3856  *
   3857  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3858  *  GLFW_PLATFORM_ERROR.
   3859  *
   3860  *  @pointer_lifetime The specified image data is copied before this function
   3861  *  returns.
   3862  *
   3863  *  @thread_safety This function must only be called from the main thread.
   3864  *
   3865  *  @sa @ref cursor_object
   3866  *  @sa @ref glfwDestroyCursor
   3867  *  @sa @ref glfwCreateStandardCursor
   3868  *
   3869  *  @since Added in version 3.1.
   3870  *
   3871  *  @ingroup input
   3872  */
   3873 GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot);
   3874 
   3875 /*! @brief Creates a cursor with a standard shape.
   3876  *
   3877  *  Returns a cursor with a [standard shape](@ref shapes), that can be set for
   3878  *  a window with @ref glfwSetCursor.
   3879  *
   3880  *  @param[in] shape One of the [standard shapes](@ref shapes).
   3881  *  @return A new cursor ready to use or `NULL` if an
   3882  *  [error](@ref error_handling) occurred.
   3883  *
   3884  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   3885  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   3886  *
   3887  *  @thread_safety This function must only be called from the main thread.
   3888  *
   3889  *  @sa @ref cursor_object
   3890  *  @sa @ref glfwCreateCursor
   3891  *
   3892  *  @since Added in version 3.1.
   3893  *
   3894  *  @ingroup input
   3895  */
   3896 GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape);
   3897 
   3898 /*! @brief Destroys a cursor.
   3899  *
   3900  *  This function destroys a cursor previously created with @ref
   3901  *  glfwCreateCursor.  Any remaining cursors will be destroyed by @ref
   3902  *  glfwTerminate.
   3903  *
   3904  *  If the specified cursor is current for any window, that window will be
   3905  *  reverted to the default cursor.  This does not affect the cursor mode.
   3906  *
   3907  *  @param[in] cursor The cursor object to destroy.
   3908  *
   3909  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3910  *  GLFW_PLATFORM_ERROR.
   3911  *
   3912  *  @reentrancy This function must not be called from a callback.
   3913  *
   3914  *  @thread_safety This function must only be called from the main thread.
   3915  *
   3916  *  @sa @ref cursor_object
   3917  *  @sa @ref glfwCreateCursor
   3918  *
   3919  *  @since Added in version 3.1.
   3920  *
   3921  *  @ingroup input
   3922  */
   3923 GLFWAPI void glfwDestroyCursor(GLFWcursor* cursor);
   3924 
   3925 /*! @brief Sets the cursor for the window.
   3926  *
   3927  *  This function sets the cursor image to be used when the cursor is over the
   3928  *  client area of the specified window.  The set cursor will only be visible
   3929  *  when the [cursor mode](@ref cursor_mode) of the window is
   3930  *  `GLFW_CURSOR_NORMAL`.
   3931  *
   3932  *  On some platforms, the set cursor may not be visible unless the window also
   3933  *  has input focus.
   3934  *
   3935  *  @param[in] window The window to set the cursor for.
   3936  *  @param[in] cursor The cursor to set, or `NULL` to switch back to the default
   3937  *  arrow cursor.
   3938  *
   3939  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3940  *  GLFW_PLATFORM_ERROR.
   3941  *
   3942  *  @thread_safety This function must only be called from the main thread.
   3943  *
   3944  *  @sa @ref cursor_object
   3945  *
   3946  *  @since Added in version 3.1.
   3947  *
   3948  *  @ingroup input
   3949  */
   3950 GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
   3951 
   3952 /*! @brief Sets the key callback.
   3953  *
   3954  *  This function sets the key callback of the specified window, which is called
   3955  *  when a key is pressed, repeated or released.
   3956  *
   3957  *  The key functions deal with physical keys, with layout independent
   3958  *  [key tokens](@ref keys) named after their values in the standard US keyboard
   3959  *  layout.  If you want to input text, use the
   3960  *  [character callback](@ref glfwSetCharCallback) instead.
   3961  *
   3962  *  When a window loses input focus, it will generate synthetic key release
   3963  *  events for all pressed keys.  You can tell these events from user-generated
   3964  *  events by the fact that the synthetic ones are generated after the focus
   3965  *  loss event has been processed, i.e. after the
   3966  *  [window focus callback](@ref glfwSetWindowFocusCallback) has been called.
   3967  *
   3968  *  The scancode of a key is specific to that platform or sometimes even to that
   3969  *  machine.  Scancodes are intended to allow users to bind keys that don't have
   3970  *  a GLFW key token.  Such keys have `key` set to `GLFW_KEY_UNKNOWN`, their
   3971  *  state is not saved and so it cannot be queried with @ref glfwGetKey.
   3972  *
   3973  *  Sometimes GLFW needs to generate synthetic key events, in which case the
   3974  *  scancode may be zero.
   3975  *
   3976  *  @param[in] window The window whose callback to set.
   3977  *  @param[in] cbfun The new key callback, or `NULL` to remove the currently
   3978  *  set callback.
   3979  *  @return The previously set callback, or `NULL` if no callback was set or the
   3980  *  library had not been [initialized](@ref intro_init).
   3981  *
   3982  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3983  *
   3984  *  @thread_safety This function must only be called from the main thread.
   3985  *
   3986  *  @sa @ref input_key
   3987  *
   3988  *  @since Added in version 1.0.
   3989  *  @glfw3 Added window handle parameter and return value.
   3990  *
   3991  *  @ingroup input
   3992  */
   3993 GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);
   3994 
   3995 /*! @brief Sets the Unicode character callback.
   3996  *
   3997  *  This function sets the character callback of the specified window, which is
   3998  *  called when a Unicode character is input.
   3999  *
   4000  *  The character callback is intended for Unicode text input.  As it deals with
   4001  *  characters, it is keyboard layout dependent, whereas the
   4002  *  [key callback](@ref glfwSetKeyCallback) is not.  Characters do not map 1:1
   4003  *  to physical keys, as a key may produce zero, one or more characters.  If you
   4004  *  want to know whether a specific physical key was pressed or released, see
   4005  *  the key callback instead.
   4006  *
   4007  *  The character callback behaves as system text input normally does and will
   4008  *  not be called if modifier keys are held down that would prevent normal text
   4009  *  input on that platform, for example a Super (Command) key on macOS or Alt key
   4010  *  on Windows.  There is a
   4011  *  [character with modifiers callback](@ref glfwSetCharModsCallback) that
   4012  *  receives these events.
   4013  *
   4014  *  @param[in] window The window whose callback to set.
   4015  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   4016  *  callback.
   4017  *  @return The previously set callback, or `NULL` if no callback was set or the
   4018  *  library had not been [initialized](@ref intro_init).
   4019  *
   4020  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4021  *
   4022  *  @thread_safety This function must only be called from the main thread.
   4023  *
   4024  *  @sa @ref input_char
   4025  *
   4026  *  @since Added in version 2.4.
   4027  *  @glfw3 Added window handle parameter and return value.
   4028  *
   4029  *  @ingroup input
   4030  */
   4031 GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun);
   4032 
   4033 /*! @brief Sets the Unicode character with modifiers callback.
   4034  *
   4035  *  This function sets the character with modifiers callback of the specified
   4036  *  window, which is called when a Unicode character is input regardless of what
   4037  *  modifier keys are used.
   4038  *
   4039  *  The character with modifiers callback is intended for implementing custom
   4040  *  Unicode character input.  For regular Unicode text input, see the
   4041  *  [character callback](@ref glfwSetCharCallback).  Like the character
   4042  *  callback, the character with modifiers callback deals with characters and is
   4043  *  keyboard layout dependent.  Characters do not map 1:1 to physical keys, as
   4044  *  a key may produce zero, one or more characters.  If you want to know whether
   4045  *  a specific physical key was pressed or released, see the
   4046  *  [key callback](@ref glfwSetKeyCallback) instead.
   4047  *
   4048  *  @param[in] window The window whose callback to set.
   4049  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   4050  *  callback.
   4051  *  @return The previously set callback, or `NULL` if no callback was set or an
   4052  *  [error](@ref error_handling) occurred.
   4053  *
   4054  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4055  *
   4056  *  @thread_safety This function must only be called from the main thread.
   4057  *
   4058  *  @sa @ref input_char
   4059  *
   4060  *  @since Added in version 3.1.
   4061  *
   4062  *  @ingroup input
   4063  */
   4064 GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun cbfun);
   4065 
   4066 /*! @brief Sets the mouse button callback.
   4067  *
   4068  *  This function sets the mouse button callback of the specified window, which
   4069  *  is called when a mouse button is pressed or released.
   4070  *
   4071  *  When a window loses input focus, it will generate synthetic mouse button
   4072  *  release events for all pressed mouse buttons.  You can tell these events
   4073  *  from user-generated events by the fact that the synthetic ones are generated
   4074  *  after the focus loss event has been processed, i.e. after the
   4075  *  [window focus callback](@ref glfwSetWindowFocusCallback) has been called.
   4076  *
   4077  *  @param[in] window The window whose callback to set.
   4078  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   4079  *  callback.
   4080  *  @return The previously set callback, or `NULL` if no callback was set or the
   4081  *  library had not been [initialized](@ref intro_init).
   4082  *
   4083  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4084  *
   4085  *  @thread_safety This function must only be called from the main thread.
   4086  *
   4087  *  @sa @ref input_mouse_button
   4088  *
   4089  *  @since Added in version 1.0.
   4090  *  @glfw3 Added window handle parameter and return value.
   4091  *
   4092  *  @ingroup input
   4093  */
   4094 GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun);
   4095 
   4096 /*! @brief Sets the cursor position callback.
   4097  *
   4098  *  This function sets the cursor position callback of the specified window,
   4099  *  which is called when the cursor is moved.  The callback is provided with the
   4100  *  position, in screen coordinates, relative to the upper-left corner of the
   4101  *  client area of the window.
   4102  *
   4103  *  @param[in] window The window whose callback to set.
   4104  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   4105  *  callback.
   4106  *  @return The previously set callback, or `NULL` if no callback was set or the
   4107  *  library had not been [initialized](@ref intro_init).
   4108  *
   4109  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4110  *
   4111  *  @thread_safety This function must only be called from the main thread.
   4112  *
   4113  *  @sa @ref cursor_pos
   4114  *
   4115  *  @since Added in version 3.0.  Replaces `glfwSetMousePosCallback`.
   4116  *
   4117  *  @ingroup input
   4118  */
   4119 GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun);
   4120 
   4121 /*! @brief Sets the cursor enter/exit callback.
   4122  *
   4123  *  This function sets the cursor boundary crossing callback of the specified
   4124  *  window, which is called when the cursor enters or leaves the client area of
   4125  *  the window.
   4126  *
   4127  *  @param[in] window The window whose callback to set.
   4128  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   4129  *  callback.
   4130  *  @return The previously set callback, or `NULL` if no callback was set or the
   4131  *  library had not been [initialized](@ref intro_init).
   4132  *
   4133  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4134  *
   4135  *  @thread_safety This function must only be called from the main thread.
   4136  *
   4137  *  @sa @ref cursor_enter
   4138  *
   4139  *  @since Added in version 3.0.
   4140  *
   4141  *  @ingroup input
   4142  */
   4143 GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun);
   4144 
   4145 /*! @brief Sets the scroll callback.
   4146  *
   4147  *  This function sets the scroll callback of the specified window, which is
   4148  *  called when a scrolling device is used, such as a mouse wheel or scrolling
   4149  *  area of a touchpad.
   4150  *
   4151  *  The scroll callback receives all scrolling input, like that from a mouse
   4152  *  wheel or a touchpad scrolling area.
   4153  *
   4154  *  @param[in] window The window whose callback to set.
   4155  *  @param[in] cbfun The new scroll callback, or `NULL` to remove the currently
   4156  *  set callback.
   4157  *  @return The previously set callback, or `NULL` if no callback was set or the
   4158  *  library had not been [initialized](@ref intro_init).
   4159  *
   4160  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4161  *
   4162  *  @thread_safety This function must only be called from the main thread.
   4163  *
   4164  *  @sa @ref scrolling
   4165  *
   4166  *  @since Added in version 3.0.  Replaces `glfwSetMouseWheelCallback`.
   4167  *
   4168  *  @ingroup input
   4169  */
   4170 GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun);
   4171 
   4172 /*! @brief Sets the file drop callback.
   4173  *
   4174  *  This function sets the file drop callback of the specified window, which is
   4175  *  called when one or more dragged files are dropped on the window.
   4176  *
   4177  *  Because the path array and its strings may have been generated specifically
   4178  *  for that event, they are not guaranteed to be valid after the callback has
   4179  *  returned.  If you wish to use them after the callback returns, you need to
   4180  *  make a deep copy.
   4181  *
   4182  *  @param[in] window The window whose callback to set.
   4183  *  @param[in] cbfun The new file drop callback, or `NULL` to remove the
   4184  *  currently set callback.
   4185  *  @return The previously set callback, or `NULL` if no callback was set or the
   4186  *  library had not been [initialized](@ref intro_init).
   4187  *
   4188  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4189  *
   4190  *  @remark @wayland File drop is currently unimplemented.
   4191  *
   4192  *  @thread_safety This function must only be called from the main thread.
   4193  *
   4194  *  @sa @ref path_drop
   4195  *
   4196  *  @since Added in version 3.1.
   4197  *
   4198  *  @ingroup input
   4199  */
   4200 GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun);
   4201 
   4202 /*! @brief Returns whether the specified joystick is present.
   4203  *
   4204  *  This function returns whether the specified joystick is present.
   4205  *
   4206  *  There is no need to call this function before other functions that accept
   4207  *  a joystick ID, as they all check for presence before performing any other
   4208  *  work.
   4209  *
   4210  *  @param[in] jid The [joystick](@ref joysticks) to query.
   4211  *  @return `GLFW_TRUE` if the joystick is present, or `GLFW_FALSE` otherwise.
   4212  *
   4213  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4214  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   4215  *
   4216  *  @thread_safety This function must only be called from the main thread.
   4217  *
   4218  *  @sa @ref joystick
   4219  *
   4220  *  @since Added in version 3.0.  Replaces `glfwGetJoystickParam`.
   4221  *
   4222  *  @ingroup input
   4223  */
   4224 GLFWAPI int glfwJoystickPresent(int jid);
   4225 
   4226 /*! @brief Returns the values of all axes of the specified joystick.
   4227  *
   4228  *  This function returns the values of all axes of the specified joystick.
   4229  *  Each element in the array is a value between -1.0 and 1.0.
   4230  *
   4231  *  If the specified joystick is not present this function will return `NULL`
   4232  *  but will not generate an error.  This can be used instead of first calling
   4233  *  @ref glfwJoystickPresent.
   4234  *
   4235  *  @param[in] jid The [joystick](@ref joysticks) to query.
   4236  *  @param[out] count Where to store the number of axis values in the returned
   4237  *  array.  This is set to zero if the joystick is not present or an error
   4238  *  occurred.
   4239  *  @return An array of axis values, or `NULL` if the joystick is not present or
   4240  *  an [error](@ref error_handling) occurred.
   4241  *
   4242  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4243  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   4244  *
   4245  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   4246  *  should not free it yourself.  It is valid until the specified joystick is
   4247  *  disconnected or the library is terminated.
   4248  *
   4249  *  @thread_safety This function must only be called from the main thread.
   4250  *
   4251  *  @sa @ref joystick_axis
   4252  *
   4253  *  @since Added in version 3.0.  Replaces `glfwGetJoystickPos`.
   4254  *
   4255  *  @ingroup input
   4256  */
   4257 GLFWAPI const float* glfwGetJoystickAxes(int jid, int* count);
   4258 
   4259 /*! @brief Returns the state of all buttons of the specified joystick.
   4260  *
   4261  *  This function returns the state of all buttons of the specified joystick.
   4262  *  Each element in the array is either `GLFW_PRESS` or `GLFW_RELEASE`.
   4263  *
   4264  *  For backward compatibility with earlier versions that did not have @ref
   4265  *  glfwGetJoystickHats, the button array also includes all hats, each
   4266  *  represented as four buttons.  The hats are in the same order as returned by
   4267  *  __glfwGetJoystickHats__ and are in the order _up_, _right_, _down_ and
   4268  *  _left_.  To disable these extra buttons, set the @ref
   4269  *  GLFW_JOYSTICK_HAT_BUTTONS init hint before initialization.
   4270  *
   4271  *  If the specified joystick is not present this function will return `NULL`
   4272  *  but will not generate an error.  This can be used instead of first calling
   4273  *  @ref glfwJoystickPresent.
   4274  *
   4275  *  @param[in] jid The [joystick](@ref joysticks) to query.
   4276  *  @param[out] count Where to store the number of button states in the returned
   4277  *  array.  This is set to zero if the joystick is not present or an error
   4278  *  occurred.
   4279  *  @return An array of button states, or `NULL` if the joystick is not present
   4280  *  or an [error](@ref error_handling) occurred.
   4281  *
   4282  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4283  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   4284  *
   4285  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   4286  *  should not free it yourself.  It is valid until the specified joystick is
   4287  *  disconnected or the library is terminated.
   4288  *
   4289  *  @thread_safety This function must only be called from the main thread.
   4290  *
   4291  *  @sa @ref joystick_button
   4292  *
   4293  *  @since Added in version 2.2.
   4294  *  @glfw3 Changed to return a dynamic array.
   4295  *
   4296  *  @ingroup input
   4297  */
   4298 GLFWAPI const unsigned char* glfwGetJoystickButtons(int jid, int* count);
   4299 
   4300 /*! @brief Returns the state of all hats of the specified joystick.
   4301  *
   4302  *  This function returns the state of all hats of the specified joystick.
   4303  *  Each element in the array is one of the following values:
   4304  *
   4305  *  Name                  | Value
   4306  *  --------------------- | --------------------------------
   4307  *  `GLFW_HAT_CENTERED`   | 0
   4308  *  `GLFW_HAT_UP`         | 1
   4309  *  `GLFW_HAT_RIGHT`      | 2
   4310  *  `GLFW_HAT_DOWN`       | 4
   4311  *  `GLFW_HAT_LEFT`       | 8
   4312  *  `GLFW_HAT_RIGHT_UP`   | `GLFW_HAT_RIGHT` \| `GLFW_HAT_UP`
   4313  *  `GLFW_HAT_RIGHT_DOWN` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_DOWN`
   4314  *  `GLFW_HAT_LEFT_UP`    | `GLFW_HAT_LEFT` \| `GLFW_HAT_UP`
   4315  *  `GLFW_HAT_LEFT_DOWN`  | `GLFW_HAT_LEFT` \| `GLFW_HAT_DOWN`
   4316  *
   4317  *  The diagonal directions are bitwise combinations of the primary (up, right,
   4318  *  down and left) directions and you can test for these individually by ANDing
   4319  *  it with the corresponding direction.
   4320  *
   4321  *  @code
   4322  *  if (hats[2] & GLFW_HAT_RIGHT)                                
   4323  *  {                                                            
   4324  *      // State of hat 2 could be right-up, right or right-down 
   4325  *  }                                                            
   4326  *  @endcode
   4327  *
   4328  *  If the specified joystick is not present this function will return `NULL`
   4329  *  but will not generate an error.  This can be used instead of first calling
   4330  *  @ref glfwJoystickPresent.
   4331  *
   4332  *  @param[in] jid The [joystick](@ref joysticks) to query.
   4333  *  @param[out] count Where to store the number of hat states in the returned
   4334  *  array.  This is set to zero if the joystick is not present or an error
   4335  *  occurred.
   4336  *  @return An array of hat states, or `NULL` if the joystick is not present
   4337  *  or an [error](@ref error_handling) occurred.
   4338  *
   4339  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4340  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   4341  *
   4342  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   4343  *  should not free it yourself.  It is valid until the specified joystick is
   4344  *  disconnected, this function is called again for that joystick or the library
   4345  *  is terminated.
   4346  *
   4347  *  @thread_safety This function must only be called from the main thread.
   4348  *
   4349  *  @sa @ref joystick_hat
   4350  *
   4351  *  @since Added in version 3.3.
   4352  *
   4353  *  @ingroup input
   4354  */
   4355 GLFWAPI const unsigned char* glfwGetJoystickHats(int jid, int* count);
   4356 
   4357 /*! @brief Returns the name of the specified joystick.
   4358  *
   4359  *  This function returns the name, encoded as UTF-8, of the specified joystick.
   4360  *  The returned string is allocated and freed by GLFW.  You should not free it
   4361  *  yourself.
   4362  *
   4363  *  If the specified joystick is not present this function will return `NULL`
   4364  *  but will not generate an error.  This can be used instead of first calling
   4365  *  @ref glfwJoystickPresent.
   4366  *
   4367  *  @param[in] jid The [joystick](@ref joysticks) to query.
   4368  *  @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick
   4369  *  is not present or an [error](@ref error_handling) occurred.
   4370  *
   4371  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4372  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   4373  *
   4374  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   4375  *  should not free it yourself.  It is valid until the specified joystick is
   4376  *  disconnected or the library is terminated.
   4377  *
   4378  *  @thread_safety This function must only be called from the main thread.
   4379  *
   4380  *  @sa @ref joystick_name
   4381  *
   4382  *  @since Added in version 3.0.
   4383  *
   4384  *  @ingroup input
   4385  */
   4386 GLFWAPI const char* glfwGetJoystickName(int jid);
   4387 
   4388 /*! @brief Returns the SDL comaptible GUID of the specified joystick.
   4389  *
   4390  *  This function returns the SDL compatible GUID, as a UTF-8 encoded
   4391  *  hexadecimal string, of the specified joystick.  The returned string is
   4392  *  allocated and freed by GLFW.  You should not free it yourself.
   4393  *
   4394  *  The GUID is what connects a joystick to a gamepad mapping.  A connected
   4395  *  joystick will always have a GUID even if there is no gamepad mapping
   4396  *  assigned to it.
   4397  *
   4398  *  If the specified joystick is not present this function will return `NULL`
   4399  *  but will not generate an error.  This can be used instead of first calling
   4400  *  @ref glfwJoystickPresent.
   4401  *
   4402  *  The GUID uses the format introduced in SDL 2.0.5.  This GUID tries to
   4403  *  uniquely identify the make and model of a joystick but does not identify
   4404  *  a specific unit, e.g. all wired Xbox 360 controllers will have the same
   4405  *  GUID on that platform.  The GUID for a unit may vary between platforms
   4406  *  depending on what hardware information the platform specific APIs provide.
   4407  *
   4408  *  @param[in] jid The [joystick](@ref joysticks) to query.
   4409  *  @return The UTF-8 encoded GUID of the joystick, or `NULL` if the joystick
   4410  *  is not present or an [error](@ref error_handling) occurred.
   4411  *
   4412  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4413  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   4414  *
   4415  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   4416  *  should not free it yourself.  It is valid until the specified joystick is
   4417  *  disconnected or the library is terminated.
   4418  *
   4419  *  @thread_safety This function must only be called from the main thread.
   4420  *
   4421  *  @sa @ref gamepad
   4422  *
   4423  *  @since Added in version 3.3.
   4424  *
   4425  *  @ingroup input
   4426  */
   4427 GLFWAPI const char* glfwGetJoystickGUID(int jid);
   4428 
   4429 /*! @brief Returns whether the specified joystick has a gamepad mapping.
   4430  *
   4431  *  This function returns whether the specified joystick is both present and has
   4432  *  a gamepad mapping.
   4433  *
   4434  *  If the specified joystick is present but does not have a gamepad mapping
   4435  *  this function will return `GLFW_FALSE` but will not generate an error.  Call
   4436  *  @ref glfwJoystickPresent to check if a joystick is present regardless of
   4437  *  whether it has a mapping.
   4438  *
   4439  *  @param[in] jid The [joystick](@ref joysticks) to query.
   4440  *  @return `GLFW_TRUE` if a joystick is both present and has a gamepad mapping,
   4441  *  or `GLFW_FALSE` otherwise.
   4442  *
   4443  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4444  *  GLFW_INVALID_ENUM.
   4445  *
   4446  *  @thread_safety This function must only be called from the main thread.
   4447  *
   4448  *  @sa @ref gamepad
   4449  *  @sa @ref glfwGetGamepadState
   4450  *
   4451  *  @since Added in version 3.3.
   4452  *
   4453  *  @ingroup input
   4454  */
   4455 GLFWAPI int glfwJoystickIsGamepad(int jid);
   4456 
   4457 /*! @brief Sets the joystick configuration callback.
   4458  *
   4459  *  This function sets the joystick configuration callback, or removes the
   4460  *  currently set callback.  This is called when a joystick is connected to or
   4461  *  disconnected from the system.
   4462  *
   4463  *  For joystick connection and disconnection events to be delivered on all
   4464  *  platforms, you need to call one of the [event processing](@ref events)
   4465  *  functions.  Joystick disconnection may also be detected and the callback
   4466  *  called by joystick functions.  The function will then return whatever it
   4467  *  returns if the joystick is not present.
   4468  *
   4469  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
   4470  *  callback.
   4471  *  @return The previously set callback, or `NULL` if no callback was set or the
   4472  *  library had not been [initialized](@ref intro_init).
   4473  *
   4474  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4475  *
   4476  *  @thread_safety This function must only be called from the main thread.
   4477  *
   4478  *  @sa @ref joystick_event
   4479  *
   4480  *  @since Added in version 3.2.
   4481  *
   4482  *  @ingroup input
   4483  */
   4484 GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun);
   4485 
   4486 /*! @brief Adds the specified SDL_GameControllerDB gamepad mappings.
   4487  *
   4488  *  This function parses the specified ASCII encoded string and updates the
   4489  *  internal list with any gamepad mappings it finds.  This string may
   4490  *  contain either a single gamepad mapping or many mappings separated by
   4491  *  newlines.  The parser supports the full format of the `gamecontrollerdb.txt`
   4492  *  source file including empty lines and comments.
   4493  *
   4494  *  See @ref gamepad_mapping for a description of the format.
   4495  *
   4496  *  If there is already a gamepad mapping for a given GUID in the internal list,
   4497  *  it will be replaced by the one passed to this function.  If the library is
   4498  *  terminated and re-initialized the internal list will revert to the built-in
   4499  *  default.
   4500  *
   4501  *  @param[in] string The string containing the gamepad mappings.
   4502  *  @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
   4503  *  [error](@ref error_handling) occurred.
   4504  *
   4505  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4506  *  GLFW_INVALID_VALUE.
   4507  *
   4508  *  @thread_safety This function must only be called from the main thread.
   4509  *
   4510  *  @sa @ref gamepad
   4511  *  @sa @ref glfwJoystickIsGamepad
   4512  *  @sa @ref glfwGetGamepadName
   4513  *
   4514  *  @since Added in version 3.3.
   4515  *
   4516  *  @ingroup input
   4517  */
   4518 GLFWAPI int glfwUpdateGamepadMappings(const char* string);
   4519 
   4520 /*! @brief Returns the human-readable gamepad name for the specified joystick.
   4521  *
   4522  *  This function returns the human-readable name of the gamepad from the
   4523  *  gamepad mapping assigned to the specified joystick.
   4524  *
   4525  *  If the specified joystick is not present or does not have a gamepad mapping
   4526  *  this function will return `NULL` but will not generate an error.  Call
   4527  *  @ref glfwJoystickPresent to check whether it is present regardless of
   4528  *  whether it has a mapping.
   4529  *
   4530  *  @param[in] jid The [joystick](@ref joysticks) to query.
   4531  *  @return The UTF-8 encoded name of the gamepad, or `NULL` if the
   4532  *  joystick is not present, does not have a mapping or an
   4533  *  [error](@ref error_handling) occurred.
   4534  *
   4535  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   4536  *  should not free it yourself.  It is valid until the specified joystick is
   4537  *  disconnected, the gamepad mappings are updated or the library is terminated.
   4538  *
   4539  *  @thread_safety This function must only be called from the main thread.
   4540  *
   4541  *  @sa @ref gamepad
   4542  *  @sa @ref glfwJoystickIsGamepad
   4543  *
   4544  *  @since Added in version 3.3.
   4545  *
   4546  *  @ingroup input
   4547  */
   4548 GLFWAPI const char* glfwGetGamepadName(int jid);
   4549 
   4550 /*! @brief Retrieves the state of the specified joystick remapped as a gamepad.
   4551  *
   4552  *  This function retrives the state of the specified joystick remapped to
   4553  *  an Xbox-like gamepad.
   4554  *
   4555  *  If the specified joystick is not present or does not have a gamepad mapping
   4556  *  this function will return `GLFW_FALSE` but will not generate an error.  Call
   4557  *  @ref glfwJoystickPresent to check whether it is present regardless of
   4558  *  whether it has a mapping.
   4559  *
   4560  *  The Guide button may not be available for input as it is often hooked by the
   4561  *  system or the Steam client.
   4562  *
   4563  *  Not all devices have all the buttons or axes provided by @ref
   4564  *  GLFWgamepadstate.  Unavailable buttons and axes will always report
   4565  *  `GLFW_RELEASE` and 1.0 respectively.
   4566  *
   4567  *  @param[in] jid The [joystick](@ref joysticks) to query.
   4568  *  @param[out] state The gamepad input state of the joystick.
   4569  *  @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if no joystick is
   4570  *  connected, it has no gamepad mapping or an [error](@ref error_handling)
   4571  *  occurred.
   4572  *
   4573  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4574  *  GLFW_INVALID_ENUM.
   4575  *
   4576  *  @sa @ref gamepad
   4577  *  @sa @ref glfwUpdateGamepadMappings
   4578  *  @sa @ref glfwJoystickIsGamepad
   4579  *
   4580  *  @since Added in version 3.3.
   4581  *
   4582  *  @ingroup input
   4583  */
   4584 GLFWAPI int glfwGetGamepadState(int jid, GLFWgamepadstate* state);
   4585 
   4586 /*! @brief Sets the clipboard to the specified string.
   4587  *
   4588  *  This function sets the system clipboard to the specified, UTF-8 encoded
   4589  *  string.
   4590  *
   4591  *  @param[in] window The window that will own the clipboard contents.
   4592  *  @param[in] string A UTF-8 encoded string.
   4593  *
   4594  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4595  *  GLFW_PLATFORM_ERROR.
   4596  *
   4597  *  @remark @wayland Clipboard is currently unimplemented.
   4598  *
   4599  *  @pointer_lifetime The specified string is copied before this function
   4600  *  returns.
   4601  *
   4602  *  @thread_safety This function must only be called from the main thread.
   4603  *
   4604  *  @sa @ref clipboard
   4605  *  @sa @ref glfwGetClipboardString
   4606  *
   4607  *  @since Added in version 3.0.
   4608  *
   4609  *  @ingroup input
   4610  */
   4611 GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string);
   4612 
   4613 /*! @brief Returns the contents of the clipboard as a string.
   4614  *
   4615  *  This function returns the contents of the system clipboard, if it contains
   4616  *  or is convertible to a UTF-8 encoded string.  If the clipboard is empty or
   4617  *  if its contents cannot be converted, `NULL` is returned and a @ref
   4618  *  GLFW_FORMAT_UNAVAILABLE error is generated.
   4619  *
   4620  *  @param[in] window The window that will request the clipboard contents.
   4621  *  @return The contents of the clipboard as a UTF-8 encoded string, or `NULL`
   4622  *  if an [error](@ref error_handling) occurred.
   4623  *
   4624  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4625  *  GLFW_PLATFORM_ERROR.
   4626  *
   4627  *  @remark @wayland Clipboard is currently unimplemented.
   4628  *
   4629  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   4630  *  should not free it yourself.  It is valid until the next call to @ref
   4631  *  glfwGetClipboardString or @ref glfwSetClipboardString, or until the library
   4632  *  is terminated.
   4633  *
   4634  *  @thread_safety This function must only be called from the main thread.
   4635  *
   4636  *  @sa @ref clipboard
   4637  *  @sa @ref glfwSetClipboardString
   4638  *
   4639  *  @since Added in version 3.0.
   4640  *
   4641  *  @ingroup input
   4642  */
   4643 GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window);
   4644 
   4645 /*! @brief Returns the value of the GLFW timer.
   4646  *
   4647  *  This function returns the value of the GLFW timer.  Unless the timer has
   4648  *  been set using @ref glfwSetTime, the timer measures time elapsed since GLFW
   4649  *  was initialized.
   4650  *
   4651  *  The resolution of the timer is system dependent, but is usually on the order
   4652  *  of a few micro- or nanoseconds.  It uses the highest-resolution monotonic
   4653  *  time source on each supported platform.
   4654  *
   4655  *  @return The current value, in seconds, or zero if an
   4656  *  [error](@ref error_handling) occurred.
   4657  *
   4658  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4659  *
   4660  *  @thread_safety This function may be called from any thread.  Reading and
   4661  *  writing of the internal timer offset is not atomic, so it needs to be
   4662  *  externally synchronized with calls to @ref glfwSetTime.
   4663  *
   4664  *  @sa @ref time
   4665  *
   4666  *  @since Added in version 1.0.
   4667  *
   4668  *  @ingroup input
   4669  */
   4670 GLFWAPI double glfwGetTime(void);
   4671 
   4672 /*! @brief Sets the GLFW timer.
   4673  *
   4674  *  This function sets the value of the GLFW timer.  It then continues to count
   4675  *  up from that value.  The value must be a positive finite number less than
   4676  *  or equal to 18446744073.0, which is approximately 584.5 years.
   4677  *
   4678  *  @param[in] time The new value, in seconds.
   4679  *
   4680  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4681  *  GLFW_INVALID_VALUE.
   4682  *
   4683  *  @remark The upper limit of the timer is calculated as
   4684  *  floor((2<sup>64</sup> - 1) / 10<sup>9</sup>) and is due to implementations
   4685  *  storing nanoseconds in 64 bits.  The limit may be increased in the future.
   4686  *
   4687  *  @thread_safety This function may be called from any thread.  Reading and
   4688  *  writing of the internal timer offset is not atomic, so it needs to be
   4689  *  externally synchronized with calls to @ref glfwGetTime.
   4690  *
   4691  *  @sa @ref time
   4692  *
   4693  *  @since Added in version 2.2.
   4694  *
   4695  *  @ingroup input
   4696  */
   4697 GLFWAPI void glfwSetTime(double time);
   4698 
   4699 /*! @brief Returns the current value of the raw timer.
   4700  *
   4701  *  This function returns the current value of the raw timer, measured in
   4702  *  1&nbsp;/&nbsp;frequency seconds.  To get the frequency, call @ref
   4703  *  glfwGetTimerFrequency.
   4704  *
   4705  *  @return The value of the timer, or zero if an 
   4706  *  [error](@ref error_handling) occurred.
   4707  *
   4708  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4709  *
   4710  *  @thread_safety This function may be called from any thread.
   4711  *
   4712  *  @sa @ref time
   4713  *  @sa @ref glfwGetTimerFrequency
   4714  *
   4715  *  @since Added in version 3.2.
   4716  *
   4717  *  @ingroup input
   4718  */
   4719 GLFWAPI uint64_t glfwGetTimerValue(void);
   4720 
   4721 /*! @brief Returns the frequency, in Hz, of the raw timer.
   4722  *
   4723  *  This function returns the frequency, in Hz, of the raw timer.
   4724  *
   4725  *  @return The frequency of the timer, in Hz, or zero if an
   4726  *  [error](@ref error_handling) occurred.
   4727  *
   4728  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4729  *
   4730  *  @thread_safety This function may be called from any thread.
   4731  *
   4732  *  @sa @ref time
   4733  *  @sa @ref glfwGetTimerValue
   4734  *
   4735  *  @since Added in version 3.2.
   4736  *
   4737  *  @ingroup input
   4738  */
   4739 GLFWAPI uint64_t glfwGetTimerFrequency(void);
   4740 
   4741 /*! @brief Makes the context of the specified window current for the calling
   4742  *  thread.
   4743  *
   4744  *  This function makes the OpenGL or OpenGL ES context of the specified window
   4745  *  current on the calling thread.  A context can only be made current on
   4746  *  a single thread at a time and each thread can have only a single current
   4747  *  context at a time.
   4748  *
   4749  *  By default, making a context non-current implicitly forces a pipeline flush.
   4750  *  On machines that support `GL_KHR_context_flush_control`, you can control
   4751  *  whether a context performs this flush by setting the
   4752  *  [GLFW_CONTEXT_RELEASE_BEHAVIOR](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_hint)
   4753  *  hint.
   4754  *
   4755  *  The specified window must have an OpenGL or OpenGL ES context.  Specifying
   4756  *  a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT
   4757  *  error.
   4758  *
   4759  *  @param[in] window The window whose context to make current, or `NULL` to
   4760  *  detach the current context.
   4761  *
   4762  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4763  *  GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
   4764  *
   4765  *  @thread_safety This function may be called from any thread.
   4766  *
   4767  *  @sa @ref context_current
   4768  *  @sa @ref glfwGetCurrentContext
   4769  *
   4770  *  @since Added in version 3.0.
   4771  *
   4772  *  @ingroup context
   4773  */
   4774 GLFWAPI void glfwMakeContextCurrent(GLFWwindow* window);
   4775 
   4776 /*! @brief Returns the window whose context is current on the calling thread.
   4777  *
   4778  *  This function returns the window whose OpenGL or OpenGL ES context is
   4779  *  current on the calling thread.
   4780  *
   4781  *  @return The window whose context is current, or `NULL` if no window's
   4782  *  context is current.
   4783  *
   4784  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4785  *
   4786  *  @thread_safety This function may be called from any thread.
   4787  *
   4788  *  @sa @ref context_current
   4789  *  @sa @ref glfwMakeContextCurrent
   4790  *
   4791  *  @since Added in version 3.0.
   4792  *
   4793  *  @ingroup context
   4794  */
   4795 GLFWAPI GLFWwindow* glfwGetCurrentContext(void);
   4796 
   4797 /*! @brief Swaps the front and back buffers of the specified window.
   4798  *
   4799  *  This function swaps the front and back buffers of the specified window when
   4800  *  rendering with OpenGL or OpenGL ES.  If the swap interval is greater than
   4801  *  zero, the GPU driver waits the specified number of screen updates before
   4802  *  swapping the buffers.
   4803  *
   4804  *  The specified window must have an OpenGL or OpenGL ES context.  Specifying
   4805  *  a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT
   4806  *  error.
   4807  *
   4808  *  This function does not apply to Vulkan.  If you are rendering with Vulkan,
   4809  *  see `vkQueuePresentKHR` instead.
   4810  *
   4811  *  @param[in] window The window whose buffers to swap.
   4812  *
   4813  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4814  *  GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
   4815  *
   4816  *  @remark __EGL:__ The context of the specified window must be current on the
   4817  *  calling thread.
   4818  *
   4819  *  @thread_safety This function may be called from any thread.
   4820  *
   4821  *  @sa @ref buffer_swap
   4822  *  @sa @ref glfwSwapInterval
   4823  *
   4824  *  @since Added in version 1.0.
   4825  *  @glfw3 Added window handle parameter.
   4826  *
   4827  *  @ingroup window
   4828  */
   4829 GLFWAPI void glfwSwapBuffers(GLFWwindow* window);
   4830 
   4831 /*! @brief Sets the swap interval for the current context.
   4832  *
   4833  *  This function sets the swap interval for the current OpenGL or OpenGL ES
   4834  *  context, i.e. the number of screen updates to wait from the time @ref
   4835  *  glfwSwapBuffers was called before swapping the buffers and returning.  This
   4836  *  is sometimes called _vertical synchronization_, _vertical retrace
   4837  *  synchronization_ or just _vsync_.
   4838  *
   4839  *  Contexts that support either of the `WGL_EXT_swap_control_tear` and
   4840  *  `GLX_EXT_swap_control_tear` extensions also accept negative swap intervals,
   4841  *  which allow the driver to swap even if a frame arrives a little bit late.
   4842  *  You can check for the presence of these extensions using @ref
   4843  *  glfwExtensionSupported.  For more information about swap tearing, see the
   4844  *  extension specifications.
   4845  *
   4846  *  A context must be current on the calling thread.  Calling this function
   4847  *  without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
   4848  *
   4849  *  This function does not apply to Vulkan.  If you are rendering with Vulkan,
   4850  *  see the present mode of your swapchain instead.
   4851  *
   4852  *  @param[in] interval The minimum number of screen updates to wait for
   4853  *  until the buffers are swapped by @ref glfwSwapBuffers.
   4854  *
   4855  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4856  *  GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR.
   4857  *
   4858  *  @remark This function is not called during context creation, leaving the
   4859  *  swap interval set to whatever is the default on that platform.  This is done
   4860  *  because some swap interval extensions used by GLFW do not allow the swap
   4861  *  interval to be reset to zero once it has been set to a non-zero value.
   4862  *
   4863  *  @remark Some GPU drivers do not honor the requested swap interval, either
   4864  *  because of a user setting that overrides the application's request or due to
   4865  *  bugs in the driver.
   4866  *
   4867  *  @thread_safety This function may be called from any thread.
   4868  *
   4869  *  @sa @ref buffer_swap
   4870  *  @sa @ref glfwSwapBuffers
   4871  *
   4872  *  @since Added in version 1.0.
   4873  *
   4874  *  @ingroup context
   4875  */
   4876 GLFWAPI void glfwSwapInterval(int interval);
   4877 
   4878 /*! @brief Returns whether the specified extension is available.
   4879  *
   4880  *  This function returns whether the specified
   4881  *  [API extension](@ref context_glext) is supported by the current OpenGL or
   4882  *  OpenGL ES context.  It searches both for client API extension and context
   4883  *  creation API extensions.
   4884  *
   4885  *  A context must be current on the calling thread.  Calling this function
   4886  *  without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
   4887  *
   4888  *  As this functions retrieves and searches one or more extension strings each
   4889  *  call, it is recommended that you cache its results if it is going to be used
   4890  *  frequently.  The extension strings will not change during the lifetime of
   4891  *  a context, so there is no danger in doing this.
   4892  *
   4893  *  This function does not apply to Vulkan.  If you are using Vulkan, see @ref
   4894  *  glfwGetRequiredInstanceExtensions, `vkEnumerateInstanceExtensionProperties`
   4895  *  and `vkEnumerateDeviceExtensionProperties` instead.
   4896  *
   4897  *  @param[in] extension The ASCII encoded name of the extension.
   4898  *  @return `GLFW_TRUE` if the extension is available, or `GLFW_FALSE`
   4899  *  otherwise.
   4900  *
   4901  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4902  *  GLFW_NO_CURRENT_CONTEXT, @ref GLFW_INVALID_VALUE and @ref
   4903  *  GLFW_PLATFORM_ERROR.
   4904  *
   4905  *  @thread_safety This function may be called from any thread.
   4906  *
   4907  *  @sa @ref context_glext
   4908  *  @sa @ref glfwGetProcAddress
   4909  *
   4910  *  @since Added in version 1.0.
   4911  *
   4912  *  @ingroup context
   4913  */
   4914 GLFWAPI int glfwExtensionSupported(const char* extension);
   4915 
   4916 /*! @brief Returns the address of the specified function for the current
   4917  *  context.
   4918  *
   4919  *  This function returns the address of the specified OpenGL or OpenGL ES
   4920  *  [core or extension function](@ref context_glext), if it is supported
   4921  *  by the current context.
   4922  *
   4923  *  A context must be current on the calling thread.  Calling this function
   4924  *  without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
   4925  *
   4926  *  This function does not apply to Vulkan.  If you are rendering with Vulkan,
   4927  *  see @ref glfwGetInstanceProcAddress, `vkGetInstanceProcAddr` and
   4928  *  `vkGetDeviceProcAddr` instead.
   4929  *
   4930  *  @param[in] procname The ASCII encoded name of the function.
   4931  *  @return The address of the function, or `NULL` if an
   4932  *  [error](@ref error_handling) occurred.
   4933  *
   4934  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4935  *  GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR.
   4936  *
   4937  *  @remark The address of a given function is not guaranteed to be the same
   4938  *  between contexts.
   4939  *
   4940  *  @remark This function may return a non-`NULL` address despite the
   4941  *  associated version or extension not being available.  Always check the
   4942  *  context version or extension string first.
   4943  *
   4944  *  @pointer_lifetime The returned function pointer is valid until the context
   4945  *  is destroyed or the library is terminated.
   4946  *
   4947  *  @thread_safety This function may be called from any thread.
   4948  *
   4949  *  @sa @ref context_glext
   4950  *  @sa @ref glfwExtensionSupported
   4951  *
   4952  *  @since Added in version 1.0.
   4953  *
   4954  *  @ingroup context
   4955  */
   4956 GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname);
   4957 
   4958 /*! @brief Returns whether the Vulkan loader and an ICD have been found.
   4959  *
   4960  *  This function returns whether the Vulkan loader and any minimally functional
   4961  *  ICD have been found.
   4962  *
   4963  *  The availability of a Vulkan loader and even an ICD does not by itself
   4964  *  guarantee that surface creation or even instance creation is possible.
   4965  *  For example, on Fermi systems Nvidia will install an ICD that provides no
   4966  *  actual Vulkan support.  Call @ref glfwGetRequiredInstanceExtensions to check
   4967  *  whether the extensions necessary for Vulkan surface creation are available
   4968  *  and @ref glfwGetPhysicalDevicePresentationSupport to check whether a queue
   4969  *  family of a physical device supports image presentation.
   4970  *
   4971  *  @return `GLFW_TRUE` if Vulkan is minimally available, or `GLFW_FALSE`
   4972  *  otherwise.
   4973  *
   4974  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4975  *
   4976  *  @thread_safety This function may be called from any thread.
   4977  *
   4978  *  @sa @ref vulkan_support
   4979  *
   4980  *  @since Added in version 3.2.
   4981  *
   4982  *  @ingroup vulkan
   4983  */
   4984 GLFWAPI int glfwVulkanSupported(void);
   4985 
   4986 /*! @brief Returns the Vulkan instance extensions required by GLFW.
   4987  *
   4988  *  This function returns an array of names of Vulkan instance extensions required
   4989  *  by GLFW for creating Vulkan surfaces for GLFW windows.  If successful, the
   4990  *  list will always contains `VK_KHR_surface`, so if you don't require any
   4991  *  additional extensions you can pass this list directly to the
   4992  *  `VkInstanceCreateInfo` struct.
   4993  *
   4994  *  If Vulkan is not available on the machine, this function returns `NULL` and
   4995  *  generates a @ref GLFW_API_UNAVAILABLE error.  Call @ref glfwVulkanSupported
   4996  *  to check whether Vulkan is at least minimally available.
   4997  *
   4998  *  If Vulkan is available but no set of extensions allowing window surface
   4999  *  creation was found, this function returns `NULL`.  You may still use Vulkan
   5000  *  for off-screen rendering and compute work.
   5001  *
   5002  *  @param[out] count Where to store the number of extensions in the returned
   5003  *  array.  This is set to zero if an error occurred.
   5004  *  @return An array of ASCII encoded extension names, or `NULL` if an
   5005  *  [error](@ref error_handling) occurred.
   5006  *
   5007  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   5008  *  GLFW_API_UNAVAILABLE.
   5009  *
   5010  *  @remark Additional extensions may be required by future versions of GLFW.
   5011  *  You should check if any extensions you wish to enable are already in the
   5012  *  returned array, as it is an error to specify an extension more than once in
   5013  *  the `VkInstanceCreateInfo` struct.
   5014  *
   5015  *  @remark @macos This function currently only supports the
   5016  *  `VK_MVK_macos_surface` extension from MoltenVK.
   5017  *
   5018  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   5019  *  should not free it yourself.  It is guaranteed to be valid only until the
   5020  *  library is terminated.
   5021  *
   5022  *  @thread_safety This function may be called from any thread.
   5023  *
   5024  *  @sa @ref vulkan_ext
   5025  *  @sa @ref glfwCreateWindowSurface
   5026  *
   5027  *  @since Added in version 3.2.
   5028  *
   5029  *  @ingroup vulkan
   5030  */
   5031 GLFWAPI const char** glfwGetRequiredInstanceExtensions(uint32_t* count);
   5032 
   5033 #if defined(VK_VERSION_1_0)
   5034 
   5035 /*! @brief Returns the address of the specified Vulkan instance function.
   5036  *
   5037  *  This function returns the address of the specified Vulkan core or extension
   5038  *  function for the specified instance.  If instance is set to `NULL` it can
   5039  *  return any function exported from the Vulkan loader, including at least the
   5040  *  following functions:
   5041  *
   5042  *  - `vkEnumerateInstanceExtensionProperties`
   5043  *  - `vkEnumerateInstanceLayerProperties`
   5044  *  - `vkCreateInstance`
   5045  *  - `vkGetInstanceProcAddr`
   5046  *
   5047  *  If Vulkan is not available on the machine, this function returns `NULL` and
   5048  *  generates a @ref GLFW_API_UNAVAILABLE error.  Call @ref glfwVulkanSupported
   5049  *  to check whether Vulkan is at least minimally available.
   5050  *
   5051  *  This function is equivalent to calling `vkGetInstanceProcAddr` with
   5052  *  a platform-specific query of the Vulkan loader as a fallback.
   5053  *
   5054  *  @param[in] instance The Vulkan instance to query, or `NULL` to retrieve
   5055  *  functions related to instance creation.
   5056  *  @param[in] procname The ASCII encoded name of the function.
   5057  *  @return The address of the function, or `NULL` if an
   5058  *  [error](@ref error_handling) occurred.
   5059  *
   5060  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   5061  *  GLFW_API_UNAVAILABLE.
   5062  *
   5063  *  @pointer_lifetime The returned function pointer is valid until the library
   5064  *  is terminated.
   5065  *
   5066  *  @thread_safety This function may be called from any thread.
   5067  *
   5068  *  @sa @ref vulkan_proc
   5069  *
   5070  *  @since Added in version 3.2.
   5071  *
   5072  *  @ingroup vulkan
   5073  */
   5074 GLFWAPI GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, const char* procname);
   5075 
   5076 /*! @brief Returns whether the specified queue family can present images.
   5077  *
   5078  *  This function returns whether the specified queue family of the specified
   5079  *  physical device supports presentation to the platform GLFW was built for.
   5080  *
   5081  *  If Vulkan or the required window surface creation instance extensions are
   5082  *  not available on the machine, or if the specified instance was not created
   5083  *  with the required extensions, this function returns `GLFW_FALSE` and
   5084  *  generates a @ref GLFW_API_UNAVAILABLE error.  Call @ref glfwVulkanSupported
   5085  *  to check whether Vulkan is at least minimally available and @ref
   5086  *  glfwGetRequiredInstanceExtensions to check what instance extensions are
   5087  *  required.
   5088  *
   5089  *  @param[in] instance The instance that the physical device belongs to.
   5090  *  @param[in] device The physical device that the queue family belongs to.
   5091  *  @param[in] queuefamily The index of the queue family to query.
   5092  *  @return `GLFW_TRUE` if the queue family supports presentation, or
   5093  *  `GLFW_FALSE` otherwise.
   5094  *
   5095  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   5096  *  GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
   5097  *
   5098  *  @remark @macos This function currently always returns `GLFW_TRUE`, as the
   5099  *  `VK_MVK_macos_surface` extension does not provide
   5100  *  a `vkGetPhysicalDevice*PresentationSupport` type function.
   5101  *
   5102  *  @thread_safety This function may be called from any thread.  For
   5103  *  synchronization details of Vulkan objects, see the Vulkan specification.
   5104  *
   5105  *  @sa @ref vulkan_present
   5106  *
   5107  *  @since Added in version 3.2.
   5108  *
   5109  *  @ingroup vulkan
   5110  */
   5111 GLFWAPI int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily);
   5112 
   5113 /*! @brief Creates a Vulkan surface for the specified window.
   5114  *
   5115  *  This function creates a Vulkan surface for the specified window.
   5116  *
   5117  *  If the Vulkan loader or at least one minimally functional ICD were not found,
   5118  *  this function returns `VK_ERROR_INITIALIZATION_FAILED` and generates a @ref
   5119  *  GLFW_API_UNAVAILABLE error.  Call @ref glfwVulkanSupported to check whether
   5120  *  Vulkan is at least minimally available.
   5121  *
   5122  *  If the required window surface creation instance extensions are not
   5123  *  available or if the specified instance was not created with these extensions
   5124  *  enabled, this function returns `VK_ERROR_EXTENSION_NOT_PRESENT` and
   5125  *  generates a @ref GLFW_API_UNAVAILABLE error.  Call @ref
   5126  *  glfwGetRequiredInstanceExtensions to check what instance extensions are
   5127  *  required.
   5128  *
   5129  *  The window surface must be destroyed before the specified Vulkan instance.
   5130  *  It is the responsibility of the caller to destroy the window surface.  GLFW
   5131  *  does not destroy it for you.  Call `vkDestroySurfaceKHR` to destroy the
   5132  *  surface.
   5133  *
   5134  *  @param[in] instance The Vulkan instance to create the surface in.
   5135  *  @param[in] window The window to create the surface for.
   5136  *  @param[in] allocator The allocator to use, or `NULL` to use the default
   5137  *  allocator.
   5138  *  @param[out] surface Where to store the handle of the surface.  This is set
   5139  *  to `VK_NULL_HANDLE` if an error occurred.
   5140  *  @return `VK_SUCCESS` if successful, or a Vulkan error code if an
   5141  *  [error](@ref error_handling) occurred.
   5142  *
   5143  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   5144  *  GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
   5145  *
   5146  *  @remark If an error occurs before the creation call is made, GLFW returns
   5147  *  the Vulkan error code most appropriate for the error.  Appropriate use of
   5148  *  @ref glfwVulkanSupported and @ref glfwGetRequiredInstanceExtensions should
   5149  *  eliminate almost all occurrences of these errors.
   5150  *
   5151  *  @remark @macos This function currently only supports the
   5152  *  `VK_MVK_macos_surface` extension from MoltenVK.
   5153  *
   5154  *  @remark @macos This function creates and sets a `CAMetalLayer` instance for
   5155  *  the window content view, which is required for MoltenVK to function.
   5156  *
   5157  *  @thread_safety This function may be called from any thread.  For
   5158  *  synchronization details of Vulkan objects, see the Vulkan specification.
   5159  *
   5160  *  @sa @ref vulkan_surface
   5161  *  @sa @ref glfwGetRequiredInstanceExtensions
   5162  *
   5163  *  @since Added in version 3.2.
   5164  *
   5165  *  @ingroup vulkan
   5166  */
   5167 GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface);
   5168 
   5169 #endif /*VK_VERSION_1_0*/
   5170 
   5171 
   5172 /*************************************************************************
   5173  * Global definition cleanup
   5174  *************************************************************************/
   5175 
   5176 /* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */
   5177 
   5178 #ifdef GLFW_WINGDIAPI_DEFINED
   5179  #undef WINGDIAPI
   5180  #undef GLFW_WINGDIAPI_DEFINED
   5181 #endif
   5182 
   5183 #ifdef GLFW_CALLBACK_DEFINED
   5184  #undef CALLBACK
   5185  #undef GLFW_CALLBACK_DEFINED
   5186 #endif
   5187 
   5188 /* Some OpenGL related headers need GLAPIENTRY, but it is unconditionally
   5189  * defined by some gl.h variants (OpenBSD) so define it after if needed.
   5190  */
   5191 #ifndef GLAPIENTRY
   5192  #define GLAPIENTRY APIENTRY
   5193 #endif
   5194 
   5195 /* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */
   5196 
   5197 
   5198 #ifdef __cplusplus
   5199 }
   5200 #endif
   5201 
   5202 #endif /* _glfw3_h_ */
   5203