minesweeper

A minewseeper implementation to play around with Hare and Raylib
git clone https://git.tronto.net/minesweeper
Download | Log | Files | Refs | README | LICENSE

glfw3.h (241826B)


      1 /*************************************************************************
      2  * GLFW 3.4 - www.glfw.org
      3  * A library for OpenGL, window and input
      4  *------------------------------------------------------------------------
      5  * Copyright (c) 2002-2006 Marcus Geelnard
      6  * Copyright (c) 2006-2019 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 support 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 /* Include because most Windows GLU headers need wchar_t and
    100  * the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h.
    101  * Include it unconditionally to avoid surprising side-effects.
    102  */
    103 #include <stddef.h>
    104 
    105 /* Include because it is needed by Vulkan and related functions.
    106  * Include it unconditionally to avoid surprising side-effects.
    107  */
    108 #include <stdint.h>
    109 
    110 #if defined(GLFW_INCLUDE_VULKAN)
    111   #include <vulkan/vulkan.h>
    112 #endif /* Vulkan header */
    113 
    114 /* The Vulkan header may have indirectly included windows.h (because of
    115  * VK_USE_PLATFORM_WIN32_KHR) so we offer our replacement symbols after it.
    116  */
    117 
    118 /* It is customary to use APIENTRY for OpenGL function pointer declarations on
    119  * all platforms.  Additionally, the Windows OpenGL header needs APIENTRY.
    120  */
    121 #if !defined(APIENTRY)
    122  #if defined(_WIN32)
    123   #define APIENTRY __stdcall
    124  #else
    125   #define APIENTRY
    126  #endif
    127  #define GLFW_APIENTRY_DEFINED
    128 #endif /* APIENTRY */
    129 
    130 /* Some Windows OpenGL headers need this.
    131  */
    132 #if !defined(WINGDIAPI) && defined(_WIN32)
    133  #define WINGDIAPI __declspec(dllimport)
    134  #define GLFW_WINGDIAPI_DEFINED
    135 #endif /* WINGDIAPI */
    136 
    137 /* Some Windows GLU headers need this.
    138  */
    139 #if !defined(CALLBACK) && defined(_WIN32)
    140  #define CALLBACK __stdcall
    141  #define GLFW_CALLBACK_DEFINED
    142 #endif /* CALLBACK */
    143 
    144 /* Include the chosen OpenGL or OpenGL ES headers.
    145  */
    146 #if defined(GLFW_INCLUDE_ES1)
    147 
    148  #include <GLES/gl.h>
    149  #if defined(GLFW_INCLUDE_GLEXT)
    150   #include <GLES/glext.h>
    151  #endif
    152 
    153 #elif defined(GLFW_INCLUDE_ES2)
    154 
    155  #include <GLES2/gl2.h>
    156  #if defined(GLFW_INCLUDE_GLEXT)
    157   #include <GLES2/gl2ext.h>
    158  #endif
    159 
    160 #elif defined(GLFW_INCLUDE_ES3)
    161 
    162  #include <GLES3/gl3.h>
    163  #if defined(GLFW_INCLUDE_GLEXT)
    164   #include <GLES2/gl2ext.h>
    165  #endif
    166 
    167 #elif defined(GLFW_INCLUDE_ES31)
    168 
    169  #include <GLES3/gl31.h>
    170  #if defined(GLFW_INCLUDE_GLEXT)
    171   #include <GLES2/gl2ext.h>
    172  #endif
    173 
    174 #elif defined(GLFW_INCLUDE_ES32)
    175 
    176  #include <GLES3/gl32.h>
    177  #if defined(GLFW_INCLUDE_GLEXT)
    178   #include <GLES2/gl2ext.h>
    179  #endif
    180 
    181 #elif defined(GLFW_INCLUDE_GLCOREARB)
    182 
    183  #if defined(__APPLE__)
    184 
    185   #include <OpenGL/gl3.h>
    186   #if defined(GLFW_INCLUDE_GLEXT)
    187    #include <OpenGL/gl3ext.h>
    188   #endif /*GLFW_INCLUDE_GLEXT*/
    189 
    190  #else /*__APPLE__*/
    191 
    192   #include <GL/glcorearb.h>
    193   #if defined(GLFW_INCLUDE_GLEXT)
    194    #include <GL/glext.h>
    195   #endif
    196 
    197  #endif /*__APPLE__*/
    198 
    199 #elif defined(GLFW_INCLUDE_GLU)
    200 
    201  #if defined(__APPLE__)
    202 
    203   #if defined(GLFW_INCLUDE_GLU)
    204    #include <OpenGL/glu.h>
    205   #endif
    206 
    207  #else /*__APPLE__*/
    208 
    209   #if defined(GLFW_INCLUDE_GLU)
    210    #include <GL/glu.h>
    211   #endif
    212 
    213  #endif /*__APPLE__*/
    214 
    215 #elif !defined(GLFW_INCLUDE_NONE) && \
    216       !defined(__gl_h_) && \
    217       !defined(__gles1_gl_h_) && \
    218       !defined(__gles2_gl2_h_) && \
    219       !defined(__gles2_gl3_h_) && \
    220       !defined(__gles2_gl31_h_) && \
    221       !defined(__gles2_gl32_h_) && \
    222       !defined(__gl_glcorearb_h_) && \
    223       !defined(__gl2_h_) /*legacy*/ && \
    224       !defined(__gl3_h_) /*legacy*/ && \
    225       !defined(__gl31_h_) /*legacy*/ && \
    226       !defined(__gl32_h_) /*legacy*/ && \
    227       !defined(__glcorearb_h_) /*legacy*/ && \
    228       !defined(__GL_H__) /*non-standard*/ && \
    229       !defined(__gltypes_h_) /*non-standard*/ && \
    230       !defined(__glee_h_) /*non-standard*/
    231 
    232  #if defined(__APPLE__)
    233 
    234   #if !defined(GLFW_INCLUDE_GLEXT)
    235    #define GL_GLEXT_LEGACY
    236   #endif
    237   #include <OpenGL/gl.h>
    238 
    239  #else /*__APPLE__*/
    240 
    241   #include <GL/gl.h>
    242   #if defined(GLFW_INCLUDE_GLEXT)
    243    #include <GL/glext.h>
    244   #endif
    245 
    246  #endif /*__APPLE__*/
    247 
    248 #endif /* OpenGL and OpenGL ES headers */
    249 
    250 #if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL)
    251  /* GLFW_DLL must be defined by applications that are linking against the DLL
    252   * version of the GLFW library.  _GLFW_BUILD_DLL is defined by the GLFW
    253   * configuration header when compiling the DLL version of the library.
    254   */
    255  #error "You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined"
    256 #endif
    257 
    258 /* GLFWAPI is used to declare public API functions for export
    259  * from the DLL / shared library / dynamic library.
    260  */
    261 #if defined(_WIN32) && defined(_GLFW_BUILD_DLL)
    262  /* We are building GLFW as a Win32 DLL */
    263  #define GLFWAPI __declspec(dllexport)
    264 #elif defined(_WIN32) && defined(GLFW_DLL)
    265  /* We are calling a GLFW Win32 DLL */
    266  #define GLFWAPI __declspec(dllimport)
    267 #elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL)
    268  /* We are building GLFW as a Unix shared library */
    269  #define GLFWAPI __attribute__((visibility("default")))
    270 #else
    271  #define GLFWAPI
    272 #endif
    273 
    274 
    275 /*************************************************************************
    276  * GLFW API tokens
    277  *************************************************************************/
    278 
    279 /*! @name GLFW version macros
    280  *  @{ */
    281 /*! @brief The major version number of the GLFW header.
    282  *
    283  *  The major version number of the GLFW header.  This is incremented when the
    284  *  API is changed in non-compatible ways.
    285  *  @ingroup init
    286  */
    287 #define GLFW_VERSION_MAJOR          3
    288 /*! @brief The minor version number of the GLFW header.
    289  *
    290  *  The minor version number of the GLFW header.  This is incremented when
    291  *  features are added to the API but it remains backward-compatible.
    292  *  @ingroup init
    293  */
    294 #define GLFW_VERSION_MINOR          4
    295 /*! @brief The revision number of the GLFW header.
    296  *
    297  *  The revision number of the GLFW header.  This is incremented when a bug fix
    298  *  release is made that does not contain any API changes.
    299  *  @ingroup init
    300  */
    301 #define GLFW_VERSION_REVISION       0
    302 /*! @} */
    303 
    304 /*! @brief One.
    305  *
    306  *  This is only semantic sugar for the number 1.  You can instead use `1` or
    307  *  `true` or `_True` or `GL_TRUE` or `VK_TRUE` or anything else that is equal
    308  *  to one.
    309  *
    310  *  @ingroup init
    311  */
    312 #define GLFW_TRUE                   1
    313 /*! @brief Zero.
    314  *
    315  *  This is only semantic sugar for the number 0.  You can instead use `0` or
    316  *  `false` or `_False` or `GL_FALSE` or `VK_FALSE` or anything else that is
    317  *  equal to zero.
    318  *
    319  *  @ingroup init
    320  */
    321 #define GLFW_FALSE                  0
    322 
    323 /*! @name Key and button actions
    324  *  @{ */
    325 /*! @brief The key or mouse button was released.
    326  *
    327  *  The key or mouse button was released.
    328  *
    329  *  @ingroup input
    330  */
    331 #define GLFW_RELEASE                0
    332 /*! @brief The key or mouse button was pressed.
    333  *
    334  *  The key or mouse button was pressed.
    335  *
    336  *  @ingroup input
    337  */
    338 #define GLFW_PRESS                  1
    339 /*! @brief The key was held down until it repeated.
    340  *
    341  *  The key was held down until it repeated.
    342  *
    343  *  @ingroup input
    344  */
    345 #define GLFW_REPEAT                 2
    346 /*! @} */
    347 
    348 /*! @defgroup hat_state Joystick hat states
    349  *  @brief Joystick hat states.
    350  *
    351  *  See [joystick hat input](@ref joystick_hat) for how these are used.
    352  *
    353  *  @ingroup input
    354  *  @{ */
    355 #define GLFW_HAT_CENTERED           0
    356 #define GLFW_HAT_UP                 1
    357 #define GLFW_HAT_RIGHT              2
    358 #define GLFW_HAT_DOWN               4
    359 #define GLFW_HAT_LEFT               8
    360 #define GLFW_HAT_RIGHT_UP           (GLFW_HAT_RIGHT | GLFW_HAT_UP)
    361 #define GLFW_HAT_RIGHT_DOWN         (GLFW_HAT_RIGHT | GLFW_HAT_DOWN)
    362 #define GLFW_HAT_LEFT_UP            (GLFW_HAT_LEFT  | GLFW_HAT_UP)
    363 #define GLFW_HAT_LEFT_DOWN          (GLFW_HAT_LEFT  | GLFW_HAT_DOWN)
    364 
    365 /*! @ingroup input
    366  */
    367 #define GLFW_KEY_UNKNOWN            -1
    368 
    369 /*! @} */
    370 
    371 /*! @defgroup keys Keyboard key tokens
    372  *  @brief Keyboard key tokens.
    373  *
    374  *  See [key input](@ref input_key) for how these are used.
    375  *
    376  *  These key codes are inspired by the _USB HID Usage Tables v1.12_ (p. 53-60),
    377  *  but re-arranged to map to 7-bit ASCII for printable keys (function keys are
    378  *  put in the 256+ range).
    379  *
    380  *  The naming of the key codes follow these rules:
    381  *   - The US keyboard layout is used
    382  *   - Names of printable alphanumeric characters are used (e.g. "A", "R",
    383  *     "3", etc.)
    384  *   - For non-alphanumeric characters, Unicode:ish names are used (e.g.
    385  *     "COMMA", "LEFT_SQUARE_BRACKET", etc.). Note that some names do not
    386  *     correspond to the Unicode standard (usually for brevity)
    387  *   - Keys that lack a clear US mapping are named "WORLD_x"
    388  *   - For non-printable keys, custom names are used (e.g. "F4",
    389  *     "BACKSPACE", etc.)
    390  *
    391  *  @ingroup input
    392  *  @{
    393  */
    394 
    395 /* Printable keys */
    396 #define GLFW_KEY_SPACE              32
    397 #define GLFW_KEY_APOSTROPHE         39  /* ' */
    398 #define GLFW_KEY_COMMA              44  /* , */
    399 #define GLFW_KEY_MINUS              45  /* - */
    400 #define GLFW_KEY_PERIOD             46  /* . */
    401 #define GLFW_KEY_SLASH              47  /* / */
    402 #define GLFW_KEY_0                  48
    403 #define GLFW_KEY_1                  49
    404 #define GLFW_KEY_2                  50
    405 #define GLFW_KEY_3                  51
    406 #define GLFW_KEY_4                  52
    407 #define GLFW_KEY_5                  53
    408 #define GLFW_KEY_6                  54
    409 #define GLFW_KEY_7                  55
    410 #define GLFW_KEY_8                  56
    411 #define GLFW_KEY_9                  57
    412 #define GLFW_KEY_SEMICOLON          59  /* ; */
    413 #define GLFW_KEY_EQUAL              61  /* = */
    414 #define GLFW_KEY_A                  65
    415 #define GLFW_KEY_B                  66
    416 #define GLFW_KEY_C                  67
    417 #define GLFW_KEY_D                  68
    418 #define GLFW_KEY_E                  69
    419 #define GLFW_KEY_F                  70
    420 #define GLFW_KEY_G                  71
    421 #define GLFW_KEY_H                  72
    422 #define GLFW_KEY_I                  73
    423 #define GLFW_KEY_J                  74
    424 #define GLFW_KEY_K                  75
    425 #define GLFW_KEY_L                  76
    426 #define GLFW_KEY_M                  77
    427 #define GLFW_KEY_N                  78
    428 #define GLFW_KEY_O                  79
    429 #define GLFW_KEY_P                  80
    430 #define GLFW_KEY_Q                  81
    431 #define GLFW_KEY_R                  82
    432 #define GLFW_KEY_S                  83
    433 #define GLFW_KEY_T                  84
    434 #define GLFW_KEY_U                  85
    435 #define GLFW_KEY_V                  86
    436 #define GLFW_KEY_W                  87
    437 #define GLFW_KEY_X                  88
    438 #define GLFW_KEY_Y                  89
    439 #define GLFW_KEY_Z                  90
    440 #define GLFW_KEY_LEFT_BRACKET       91  /* [ */
    441 #define GLFW_KEY_BACKSLASH          92  /* \ */
    442 #define GLFW_KEY_RIGHT_BRACKET      93  /* ] */
    443 #define GLFW_KEY_GRAVE_ACCENT       96  /* ` */
    444 #define GLFW_KEY_WORLD_1            161 /* non-US #1 */
    445 #define GLFW_KEY_WORLD_2            162 /* non-US #2 */
    446 
    447 /* Function keys */
    448 #define GLFW_KEY_ESCAPE             256
    449 #define GLFW_KEY_ENTER              257
    450 #define GLFW_KEY_TAB                258
    451 #define GLFW_KEY_BACKSPACE          259
    452 #define GLFW_KEY_INSERT             260
    453 #define GLFW_KEY_DELETE             261
    454 #define GLFW_KEY_RIGHT              262
    455 #define GLFW_KEY_LEFT               263
    456 #define GLFW_KEY_DOWN               264
    457 #define GLFW_KEY_UP                 265
    458 #define GLFW_KEY_PAGE_UP            266
    459 #define GLFW_KEY_PAGE_DOWN          267
    460 #define GLFW_KEY_HOME               268
    461 #define GLFW_KEY_END                269
    462 #define GLFW_KEY_CAPS_LOCK          280
    463 #define GLFW_KEY_SCROLL_LOCK        281
    464 #define GLFW_KEY_NUM_LOCK           282
    465 #define GLFW_KEY_PRINT_SCREEN       283
    466 #define GLFW_KEY_PAUSE              284
    467 #define GLFW_KEY_F1                 290
    468 #define GLFW_KEY_F2                 291
    469 #define GLFW_KEY_F3                 292
    470 #define GLFW_KEY_F4                 293
    471 #define GLFW_KEY_F5                 294
    472 #define GLFW_KEY_F6                 295
    473 #define GLFW_KEY_F7                 296
    474 #define GLFW_KEY_F8                 297
    475 #define GLFW_KEY_F9                 298
    476 #define GLFW_KEY_F10                299
    477 #define GLFW_KEY_F11                300
    478 #define GLFW_KEY_F12                301
    479 #define GLFW_KEY_F13                302
    480 #define GLFW_KEY_F14                303
    481 #define GLFW_KEY_F15                304
    482 #define GLFW_KEY_F16                305
    483 #define GLFW_KEY_F17                306
    484 #define GLFW_KEY_F18                307
    485 #define GLFW_KEY_F19                308
    486 #define GLFW_KEY_F20                309
    487 #define GLFW_KEY_F21                310
    488 #define GLFW_KEY_F22                311
    489 #define GLFW_KEY_F23                312
    490 #define GLFW_KEY_F24                313
    491 #define GLFW_KEY_F25                314
    492 #define GLFW_KEY_KP_0               320
    493 #define GLFW_KEY_KP_1               321
    494 #define GLFW_KEY_KP_2               322
    495 #define GLFW_KEY_KP_3               323
    496 #define GLFW_KEY_KP_4               324
    497 #define GLFW_KEY_KP_5               325
    498 #define GLFW_KEY_KP_6               326
    499 #define GLFW_KEY_KP_7               327
    500 #define GLFW_KEY_KP_8               328
    501 #define GLFW_KEY_KP_9               329
    502 #define GLFW_KEY_KP_DECIMAL         330
    503 #define GLFW_KEY_KP_DIVIDE          331
    504 #define GLFW_KEY_KP_MULTIPLY        332
    505 #define GLFW_KEY_KP_SUBTRACT        333
    506 #define GLFW_KEY_KP_ADD             334
    507 #define GLFW_KEY_KP_ENTER           335
    508 #define GLFW_KEY_KP_EQUAL           336
    509 #define GLFW_KEY_LEFT_SHIFT         340
    510 #define GLFW_KEY_LEFT_CONTROL       341
    511 #define GLFW_KEY_LEFT_ALT           342
    512 #define GLFW_KEY_LEFT_SUPER         343
    513 #define GLFW_KEY_RIGHT_SHIFT        344
    514 #define GLFW_KEY_RIGHT_CONTROL      345
    515 #define GLFW_KEY_RIGHT_ALT          346
    516 #define GLFW_KEY_RIGHT_SUPER        347
    517 #define GLFW_KEY_MENU               348
    518 
    519 #define GLFW_KEY_LAST               GLFW_KEY_MENU
    520 
    521 /*! @} */
    522 
    523 /*! @defgroup mods Modifier key flags
    524  *  @brief Modifier key flags.
    525  *
    526  *  See [key input](@ref input_key) for how these are used.
    527  *
    528  *  @ingroup input
    529  *  @{ */
    530 
    531 /*! @brief If this bit is set one or more Shift keys were held down.
    532  *
    533  *  If this bit is set one or more Shift keys were held down.
    534  */
    535 #define GLFW_MOD_SHIFT           0x0001
    536 /*! @brief If this bit is set one or more Control keys were held down.
    537  *
    538  *  If this bit is set one or more Control keys were held down.
    539  */
    540 #define GLFW_MOD_CONTROL         0x0002
    541 /*! @brief If this bit is set one or more Alt keys were held down.
    542  *
    543  *  If this bit is set one or more Alt keys were held down.
    544  */
    545 #define GLFW_MOD_ALT             0x0004
    546 /*! @brief If this bit is set one or more Super keys were held down.
    547  *
    548  *  If this bit is set one or more Super keys were held down.
    549  */
    550 #define GLFW_MOD_SUPER           0x0008
    551 /*! @brief If this bit is set the Caps Lock key is enabled.
    552  *
    553  *  If this bit is set the Caps Lock key is enabled and the @ref
    554  *  GLFW_LOCK_KEY_MODS input mode is set.
    555  */
    556 #define GLFW_MOD_CAPS_LOCK       0x0010
    557 /*! @brief If this bit is set the Num Lock key is enabled.
    558  *
    559  *  If this bit is set the Num Lock key is enabled and the @ref
    560  *  GLFW_LOCK_KEY_MODS input mode is set.
    561  */
    562 #define GLFW_MOD_NUM_LOCK        0x0020
    563 
    564 /*! @} */
    565 
    566 /*! @defgroup buttons Mouse buttons
    567  *  @brief Mouse button IDs.
    568  *
    569  *  See [mouse button input](@ref input_mouse_button) for how these are used.
    570  *
    571  *  @ingroup input
    572  *  @{ */
    573 #define GLFW_MOUSE_BUTTON_1         0
    574 #define GLFW_MOUSE_BUTTON_2         1
    575 #define GLFW_MOUSE_BUTTON_3         2
    576 #define GLFW_MOUSE_BUTTON_4         3
    577 #define GLFW_MOUSE_BUTTON_5         4
    578 #define GLFW_MOUSE_BUTTON_6         5
    579 #define GLFW_MOUSE_BUTTON_7         6
    580 #define GLFW_MOUSE_BUTTON_8         7
    581 #define GLFW_MOUSE_BUTTON_LAST      GLFW_MOUSE_BUTTON_8
    582 #define GLFW_MOUSE_BUTTON_LEFT      GLFW_MOUSE_BUTTON_1
    583 #define GLFW_MOUSE_BUTTON_RIGHT     GLFW_MOUSE_BUTTON_2
    584 #define GLFW_MOUSE_BUTTON_MIDDLE    GLFW_MOUSE_BUTTON_3
    585 /*! @} */
    586 
    587 /*! @defgroup joysticks Joysticks
    588  *  @brief Joystick IDs.
    589  *
    590  *  See [joystick input](@ref joystick) for how these are used.
    591  *
    592  *  @ingroup input
    593  *  @{ */
    594 #define GLFW_JOYSTICK_1             0
    595 #define GLFW_JOYSTICK_2             1
    596 #define GLFW_JOYSTICK_3             2
    597 #define GLFW_JOYSTICK_4             3
    598 #define GLFW_JOYSTICK_5             4
    599 #define GLFW_JOYSTICK_6             5
    600 #define GLFW_JOYSTICK_7             6
    601 #define GLFW_JOYSTICK_8             7
    602 #define GLFW_JOYSTICK_9             8
    603 #define GLFW_JOYSTICK_10            9
    604 #define GLFW_JOYSTICK_11            10
    605 #define GLFW_JOYSTICK_12            11
    606 #define GLFW_JOYSTICK_13            12
    607 #define GLFW_JOYSTICK_14            13
    608 #define GLFW_JOYSTICK_15            14
    609 #define GLFW_JOYSTICK_16            15
    610 #define GLFW_JOYSTICK_LAST          GLFW_JOYSTICK_16
    611 /*! @} */
    612 
    613 /*! @defgroup gamepad_buttons Gamepad buttons
    614  *  @brief Gamepad buttons.
    615  *
    616  *  See @ref gamepad for how these are used.
    617  *
    618  *  @ingroup input
    619  *  @{ */
    620 #define GLFW_GAMEPAD_BUTTON_A               0
    621 #define GLFW_GAMEPAD_BUTTON_B               1
    622 #define GLFW_GAMEPAD_BUTTON_X               2
    623 #define GLFW_GAMEPAD_BUTTON_Y               3
    624 #define GLFW_GAMEPAD_BUTTON_LEFT_BUMPER     4
    625 #define GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER    5
    626 #define GLFW_GAMEPAD_BUTTON_BACK            6
    627 #define GLFW_GAMEPAD_BUTTON_START           7
    628 #define GLFW_GAMEPAD_BUTTON_GUIDE           8
    629 #define GLFW_GAMEPAD_BUTTON_LEFT_THUMB      9
    630 #define GLFW_GAMEPAD_BUTTON_RIGHT_THUMB     10
    631 #define GLFW_GAMEPAD_BUTTON_DPAD_UP         11
    632 #define GLFW_GAMEPAD_BUTTON_DPAD_RIGHT      12
    633 #define GLFW_GAMEPAD_BUTTON_DPAD_DOWN       13
    634 #define GLFW_GAMEPAD_BUTTON_DPAD_LEFT       14
    635 #define GLFW_GAMEPAD_BUTTON_LAST            GLFW_GAMEPAD_BUTTON_DPAD_LEFT
    636 
    637 #define GLFW_GAMEPAD_BUTTON_CROSS       GLFW_GAMEPAD_BUTTON_A
    638 #define GLFW_GAMEPAD_BUTTON_CIRCLE      GLFW_GAMEPAD_BUTTON_B
    639 #define GLFW_GAMEPAD_BUTTON_SQUARE      GLFW_GAMEPAD_BUTTON_X
    640 #define GLFW_GAMEPAD_BUTTON_TRIANGLE    GLFW_GAMEPAD_BUTTON_Y
    641 /*! @} */
    642 
    643 /*! @defgroup gamepad_axes Gamepad axes
    644  *  @brief Gamepad axes.
    645  *
    646  *  See @ref gamepad for how these are used.
    647  *
    648  *  @ingroup input
    649  *  @{ */
    650 #define GLFW_GAMEPAD_AXIS_LEFT_X        0
    651 #define GLFW_GAMEPAD_AXIS_LEFT_Y        1
    652 #define GLFW_GAMEPAD_AXIS_RIGHT_X       2
    653 #define GLFW_GAMEPAD_AXIS_RIGHT_Y       3
    654 #define GLFW_GAMEPAD_AXIS_LEFT_TRIGGER  4
    655 #define GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER 5
    656 #define GLFW_GAMEPAD_AXIS_LAST          GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER
    657 /*! @} */
    658 
    659 /*! @defgroup errors Error codes
    660  *  @brief Error codes.
    661  *
    662  *  See [error handling](@ref error_handling) for how these are used.
    663  *
    664  *  @ingroup init
    665  *  @{ */
    666 /*! @brief No error has occurred.
    667  *
    668  *  No error has occurred.
    669  *
    670  *  @analysis Yay.
    671  */
    672 #define GLFW_NO_ERROR               0
    673 /*! @brief GLFW has not been initialized.
    674  *
    675  *  This occurs if a GLFW function was called that must not be called unless the
    676  *  library is [initialized](@ref intro_init).
    677  *
    678  *  @analysis Application programmer error.  Initialize GLFW before calling any
    679  *  function that requires initialization.
    680  */
    681 #define GLFW_NOT_INITIALIZED        0x00010001
    682 /*! @brief No context is current for this thread.
    683  *
    684  *  This occurs if a GLFW function was called that needs and operates on the
    685  *  current OpenGL or OpenGL ES context but no context is current on the calling
    686  *  thread.  One such function is @ref glfwSwapInterval.
    687  *
    688  *  @analysis Application programmer error.  Ensure a context is current before
    689  *  calling functions that require a current context.
    690  */
    691 #define GLFW_NO_CURRENT_CONTEXT     0x00010002
    692 /*! @brief One of the arguments to the function was an invalid enum value.
    693  *
    694  *  One of the arguments to the function was an invalid enum value, for example
    695  *  requesting @ref GLFW_RED_BITS with @ref glfwGetWindowAttrib.
    696  *
    697  *  @analysis Application programmer error.  Fix the offending call.
    698  */
    699 #define GLFW_INVALID_ENUM           0x00010003
    700 /*! @brief One of the arguments to the function was an invalid value.
    701  *
    702  *  One of the arguments to the function was an invalid value, for example
    703  *  requesting a non-existent OpenGL or OpenGL ES version like 2.7.
    704  *
    705  *  Requesting a valid but unavailable OpenGL or OpenGL ES version will instead
    706  *  result in a @ref GLFW_VERSION_UNAVAILABLE error.
    707  *
    708  *  @analysis Application programmer error.  Fix the offending call.
    709  */
    710 #define GLFW_INVALID_VALUE          0x00010004
    711 /*! @brief A memory allocation failed.
    712  *
    713  *  A memory allocation failed.
    714  *
    715  *  @analysis A bug in GLFW or the underlying operating system.  Report the bug
    716  *  to our [issue tracker](https://github.com/glfw/glfw/issues).
    717  */
    718 #define GLFW_OUT_OF_MEMORY          0x00010005
    719 /*! @brief GLFW could not find support for the requested API on the system.
    720  *
    721  *  GLFW could not find support for the requested API on the system.
    722  *
    723  *  @analysis The installed graphics driver does not support the requested
    724  *  API, or does not support it via the chosen context creation API.
    725  *  Below are a few examples.
    726  *
    727  *  @par
    728  *  Some pre-installed Windows graphics drivers do not support OpenGL.  AMD only
    729  *  supports OpenGL ES via EGL, while Nvidia and Intel only support it via
    730  *  a WGL or GLX extension.  macOS does not provide OpenGL ES at all.  The Mesa
    731  *  EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary
    732  *  driver.  Older graphics drivers do not support Vulkan.
    733  */
    734 #define GLFW_API_UNAVAILABLE        0x00010006
    735 /*! @brief The requested OpenGL or OpenGL ES version is not available.
    736  *
    737  *  The requested OpenGL or OpenGL ES version (including any requested context
    738  *  or framebuffer hints) is not available on this machine.
    739  *
    740  *  @analysis The machine does not support your requirements.  If your
    741  *  application is sufficiently flexible, downgrade your requirements and try
    742  *  again.  Otherwise, inform the user that their machine does not match your
    743  *  requirements.
    744  *
    745  *  @par
    746  *  Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0
    747  *  comes out before the 4.x series gets that far, also fail with this error and
    748  *  not @ref GLFW_INVALID_VALUE, because GLFW cannot know what future versions
    749  *  will exist.
    750  */
    751 #define GLFW_VERSION_UNAVAILABLE    0x00010007
    752 /*! @brief A platform-specific error occurred that does not match any of the
    753  *  more specific categories.
    754  *
    755  *  A platform-specific error occurred that does not match any of the more
    756  *  specific categories.
    757  *
    758  *  @analysis A bug or configuration error in GLFW, the underlying operating
    759  *  system or its drivers, or a lack of required resources.  Report the issue to
    760  *  our [issue tracker](https://github.com/glfw/glfw/issues).
    761  */
    762 #define GLFW_PLATFORM_ERROR         0x00010008
    763 /*! @brief The requested format is not supported or available.
    764  *
    765  *  If emitted during window creation, the requested pixel format is not
    766  *  supported.
    767  *
    768  *  If emitted when querying the clipboard, the contents of the clipboard could
    769  *  not be converted to the requested format.
    770  *
    771  *  @analysis If emitted during window creation, one or more
    772  *  [hard constraints](@ref window_hints_hard) did not match any of the
    773  *  available pixel formats.  If your application is sufficiently flexible,
    774  *  downgrade your requirements and try again.  Otherwise, inform the user that
    775  *  their machine does not match your requirements.
    776  *
    777  *  @par
    778  *  If emitted when querying the clipboard, ignore the error or report it to
    779  *  the user, as appropriate.
    780  */
    781 #define GLFW_FORMAT_UNAVAILABLE     0x00010009
    782 /*! @brief The specified window does not have an OpenGL or OpenGL ES context.
    783  *
    784  *  A window that does not have an OpenGL or OpenGL ES context was passed to
    785  *  a function that requires it to have one.
    786  *
    787  *  @analysis Application programmer error.  Fix the offending call.
    788  */
    789 #define GLFW_NO_WINDOW_CONTEXT      0x0001000A
    790 /*! @brief The specified cursor shape is not available.
    791  *
    792  *  The specified standard cursor shape is not available, either because the
    793  *  current platform cursor theme does not provide it or because it is not
    794  *  available on the platform.
    795  *
    796  *  @analysis Platform or system settings limitation.  Pick another
    797  *  [standard cursor shape](@ref shapes) or create a
    798  *  [custom cursor](@ref cursor_custom).
    799  */
    800 #define GLFW_CURSOR_UNAVAILABLE     0x0001000B
    801 /*! @brief The requested feature is not provided by the platform.
    802  *
    803  *  The requested feature is not provided by the platform, so GLFW is unable to
    804  *  implement it.  The documentation for each function notes if it could emit
    805  *  this error.
    806  *
    807  *  @analysis Platform or platform version limitation.  The error can be ignored
    808  *  unless the feature is critical to the application.
    809  *
    810  *  @par
    811  *  A function call that emits this error has no effect other than the error and
    812  *  updating any existing out parameters.
    813  */
    814 #define GLFW_FEATURE_UNAVAILABLE    0x0001000C
    815 /*! @brief The requested feature is not implemented for the platform.
    816  *
    817  *  The requested feature has not yet been implemented in GLFW for this platform.
    818  *
    819  *  @analysis An incomplete implementation of GLFW for this platform, hopefully
    820  *  fixed in a future release.  The error can be ignored unless the feature is
    821  *  critical to the application.
    822  *
    823  *  @par
    824  *  A function call that emits this error has no effect other than the error and
    825  *  updating any existing out parameters.
    826  */
    827 #define GLFW_FEATURE_UNIMPLEMENTED  0x0001000D
    828 /*! @brief Platform unavailable or no matching platform was found.
    829  *
    830  *  If emitted during initialization, no matching platform was found.  If the @ref
    831  *  GLFW_PLATFORM init hint was set to `GLFW_ANY_PLATFORM`, GLFW could not detect any of
    832  *  the platforms supported by this library binary, except for the Null platform.  If the
    833  *  init hint was set to a specific platform, it is either not supported by this library
    834  *  binary or GLFW was not able to detect it.
    835  *
    836  *  If emitted by a native access function, GLFW was initialized for a different platform
    837  *  than the function is for.
    838  *
    839  *  @analysis Failure to detect any platform usually only happens on non-macOS Unix
    840  *  systems, either when no window system is running or the program was run from
    841  *  a terminal that does not have the necessary environment variables.  Fall back to
    842  *  a different platform if possible or notify the user that no usable platform was
    843  *  detected.
    844  *
    845  *  Failure to detect a specific platform may have the same cause as above or be because
    846  *  support for that platform was not compiled in.  Call @ref glfwPlatformSupported to
    847  *  check whether a specific platform is supported by a library binary.
    848  */
    849 #define GLFW_PLATFORM_UNAVAILABLE   0x0001000E
    850 /*! @} */
    851 
    852 /*! @addtogroup window
    853  *  @{ */
    854 /*! @brief Input focus window hint and attribute
    855  *
    856  *  Input focus [window hint](@ref GLFW_FOCUSED_hint) or
    857  *  [window attribute](@ref GLFW_FOCUSED_attrib).
    858  */
    859 #define GLFW_FOCUSED                0x00020001
    860 /*! @brief Window iconification window attribute
    861  *
    862  *  Window iconification [window attribute](@ref GLFW_ICONIFIED_attrib).
    863  */
    864 #define GLFW_ICONIFIED              0x00020002
    865 /*! @brief Window resize-ability window hint and attribute
    866  *
    867  *  Window resize-ability [window hint](@ref GLFW_RESIZABLE_hint) and
    868  *  [window attribute](@ref GLFW_RESIZABLE_attrib).
    869  */
    870 #define GLFW_RESIZABLE              0x00020003
    871 /*! @brief Window visibility window hint and attribute
    872  *
    873  *  Window visibility [window hint](@ref GLFW_VISIBLE_hint) and
    874  *  [window attribute](@ref GLFW_VISIBLE_attrib).
    875  */
    876 #define GLFW_VISIBLE                0x00020004
    877 /*! @brief Window decoration window hint and attribute
    878  *
    879  *  Window decoration [window hint](@ref GLFW_DECORATED_hint) and
    880  *  [window attribute](@ref GLFW_DECORATED_attrib).
    881  */
    882 #define GLFW_DECORATED              0x00020005
    883 /*! @brief Window auto-iconification window hint and attribute
    884  *
    885  *  Window auto-iconification [window hint](@ref GLFW_AUTO_ICONIFY_hint) and
    886  *  [window attribute](@ref GLFW_AUTO_ICONIFY_attrib).
    887  */
    888 #define GLFW_AUTO_ICONIFY           0x00020006
    889 /*! @brief Window decoration window hint and attribute
    890  *
    891  *  Window decoration [window hint](@ref GLFW_FLOATING_hint) and
    892  *  [window attribute](@ref GLFW_FLOATING_attrib).
    893  */
    894 #define GLFW_FLOATING               0x00020007
    895 /*! @brief Window maximization window hint and attribute
    896  *
    897  *  Window maximization [window hint](@ref GLFW_MAXIMIZED_hint) and
    898  *  [window attribute](@ref GLFW_MAXIMIZED_attrib).
    899  */
    900 #define GLFW_MAXIMIZED              0x00020008
    901 /*! @brief Cursor centering window hint
    902  *
    903  *  Cursor centering [window hint](@ref GLFW_CENTER_CURSOR_hint).
    904  */
    905 #define GLFW_CENTER_CURSOR          0x00020009
    906 /*! @brief Window framebuffer transparency hint and attribute
    907  *
    908  *  Window framebuffer transparency
    909  *  [window hint](@ref GLFW_TRANSPARENT_FRAMEBUFFER_hint) and
    910  *  [window attribute](@ref GLFW_TRANSPARENT_FRAMEBUFFER_attrib).
    911  */
    912 #define GLFW_TRANSPARENT_FRAMEBUFFER 0x0002000A
    913 /*! @brief Mouse cursor hover window attribute.
    914  *
    915  *  Mouse cursor hover [window attribute](@ref GLFW_HOVERED_attrib).
    916  */
    917 #define GLFW_HOVERED                0x0002000B
    918 /*! @brief Input focus on calling show window hint and attribute
    919  *
    920  *  Input focus [window hint](@ref GLFW_FOCUS_ON_SHOW_hint) or
    921  *  [window attribute](@ref GLFW_FOCUS_ON_SHOW_attrib).
    922  */
    923 #define GLFW_FOCUS_ON_SHOW          0x0002000C
    924 
    925 /*! @brief Mouse input transparency window hint and attribute
    926  *
    927  *  Mouse input transparency [window hint](@ref GLFW_MOUSE_PASSTHROUGH_hint) or
    928  *  [window attribute](@ref GLFW_MOUSE_PASSTHROUGH_attrib).
    929  */
    930 #define GLFW_MOUSE_PASSTHROUGH      0x0002000D
    931 
    932 /*! @brief Initial position x-coordinate window hint.
    933  *
    934  *  Initial position x-coordinate [window hint](@ref GLFW_POSITION_X).
    935  */
    936 #define GLFW_POSITION_X             0x0002000E
    937 
    938 /*! @brief Initial position y-coordinate window hint.
    939  *
    940  *  Initial position y-coordinate [window hint](@ref GLFW_POSITION_Y).
    941  */
    942 #define GLFW_POSITION_Y             0x0002000F
    943 
    944 /*! @brief Framebuffer bit depth hint.
    945  *
    946  *  Framebuffer bit depth [hint](@ref GLFW_RED_BITS).
    947  */
    948 #define GLFW_RED_BITS               0x00021001
    949 /*! @brief Framebuffer bit depth hint.
    950  *
    951  *  Framebuffer bit depth [hint](@ref GLFW_GREEN_BITS).
    952  */
    953 #define GLFW_GREEN_BITS             0x00021002
    954 /*! @brief Framebuffer bit depth hint.
    955  *
    956  *  Framebuffer bit depth [hint](@ref GLFW_BLUE_BITS).
    957  */
    958 #define GLFW_BLUE_BITS              0x00021003
    959 /*! @brief Framebuffer bit depth hint.
    960  *
    961  *  Framebuffer bit depth [hint](@ref GLFW_ALPHA_BITS).
    962  */
    963 #define GLFW_ALPHA_BITS             0x00021004
    964 /*! @brief Framebuffer bit depth hint.
    965  *
    966  *  Framebuffer bit depth [hint](@ref GLFW_DEPTH_BITS).
    967  */
    968 #define GLFW_DEPTH_BITS             0x00021005
    969 /*! @brief Framebuffer bit depth hint.
    970  *
    971  *  Framebuffer bit depth [hint](@ref GLFW_STENCIL_BITS).
    972  */
    973 #define GLFW_STENCIL_BITS           0x00021006
    974 /*! @brief Framebuffer bit depth hint.
    975  *
    976  *  Framebuffer bit depth [hint](@ref GLFW_ACCUM_RED_BITS).
    977  */
    978 #define GLFW_ACCUM_RED_BITS         0x00021007
    979 /*! @brief Framebuffer bit depth hint.
    980  *
    981  *  Framebuffer bit depth [hint](@ref GLFW_ACCUM_GREEN_BITS).
    982  */
    983 #define GLFW_ACCUM_GREEN_BITS       0x00021008
    984 /*! @brief Framebuffer bit depth hint.
    985  *
    986  *  Framebuffer bit depth [hint](@ref GLFW_ACCUM_BLUE_BITS).
    987  */
    988 #define GLFW_ACCUM_BLUE_BITS        0x00021009
    989 /*! @brief Framebuffer bit depth hint.
    990  *
    991  *  Framebuffer bit depth [hint](@ref GLFW_ACCUM_ALPHA_BITS).
    992  */
    993 #define GLFW_ACCUM_ALPHA_BITS       0x0002100A
    994 /*! @brief Framebuffer auxiliary buffer hint.
    995  *
    996  *  Framebuffer auxiliary buffer [hint](@ref GLFW_AUX_BUFFERS).
    997  */
    998 #define GLFW_AUX_BUFFERS            0x0002100B
    999 /*! @brief OpenGL stereoscopic rendering hint.
   1000  *
   1001  *  OpenGL stereoscopic rendering [hint](@ref GLFW_STEREO).
   1002  */
   1003 #define GLFW_STEREO                 0x0002100C
   1004 /*! @brief Framebuffer MSAA samples hint.
   1005  *
   1006  *  Framebuffer MSAA samples [hint](@ref GLFW_SAMPLES).
   1007  */
   1008 #define GLFW_SAMPLES                0x0002100D
   1009 /*! @brief Framebuffer sRGB hint.
   1010  *
   1011  *  Framebuffer sRGB [hint](@ref GLFW_SRGB_CAPABLE).
   1012  */
   1013 #define GLFW_SRGB_CAPABLE           0x0002100E
   1014 /*! @brief Monitor refresh rate hint.
   1015  *
   1016  *  Monitor refresh rate [hint](@ref GLFW_REFRESH_RATE).
   1017  */
   1018 #define GLFW_REFRESH_RATE           0x0002100F
   1019 /*! @brief Framebuffer double buffering hint and attribute.
   1020  *
   1021  *  Framebuffer double buffering [hint](@ref GLFW_DOUBLEBUFFER_hint) and
   1022  *  [attribute](@ref GLFW_DOUBLEBUFFER_attrib).
   1023  */
   1024 #define GLFW_DOUBLEBUFFER           0x00021010
   1025 
   1026 /*! @brief Context client API hint and attribute.
   1027  *
   1028  *  Context client API [hint](@ref GLFW_CLIENT_API_hint) and
   1029  *  [attribute](@ref GLFW_CLIENT_API_attrib).
   1030  */
   1031 #define GLFW_CLIENT_API             0x00022001
   1032 /*! @brief Context client API major version hint and attribute.
   1033  *
   1034  *  Context client API major version [hint](@ref GLFW_CONTEXT_VERSION_MAJOR_hint)
   1035  *  and [attribute](@ref GLFW_CONTEXT_VERSION_MAJOR_attrib).
   1036  */
   1037 #define GLFW_CONTEXT_VERSION_MAJOR  0x00022002
   1038 /*! @brief Context client API minor version hint and attribute.
   1039  *
   1040  *  Context client API minor version [hint](@ref GLFW_CONTEXT_VERSION_MINOR_hint)
   1041  *  and [attribute](@ref GLFW_CONTEXT_VERSION_MINOR_attrib).
   1042  */
   1043 #define GLFW_CONTEXT_VERSION_MINOR  0x00022003
   1044 /*! @brief Context client API revision number attribute.
   1045  *
   1046  *  Context client API revision number
   1047  *  [attribute](@ref GLFW_CONTEXT_REVISION_attrib).
   1048  */
   1049 #define GLFW_CONTEXT_REVISION       0x00022004
   1050 /*! @brief Context robustness hint and attribute.
   1051  *
   1052  *  Context client API revision number [hint](@ref GLFW_CONTEXT_ROBUSTNESS_hint)
   1053  *  and [attribute](@ref GLFW_CONTEXT_ROBUSTNESS_attrib).
   1054  */
   1055 #define GLFW_CONTEXT_ROBUSTNESS     0x00022005
   1056 /*! @brief OpenGL forward-compatibility hint and attribute.
   1057  *
   1058  *  OpenGL forward-compatibility [hint](@ref GLFW_OPENGL_FORWARD_COMPAT_hint)
   1059  *  and [attribute](@ref GLFW_OPENGL_FORWARD_COMPAT_attrib).
   1060  */
   1061 #define GLFW_OPENGL_FORWARD_COMPAT  0x00022006
   1062 /*! @brief Debug mode context hint and attribute.
   1063  *
   1064  *  Debug mode context [hint](@ref GLFW_CONTEXT_DEBUG_hint) and
   1065  *  [attribute](@ref GLFW_CONTEXT_DEBUG_attrib).
   1066  */
   1067 #define GLFW_CONTEXT_DEBUG          0x00022007
   1068 /*! @brief Legacy name for compatibility.
   1069  *
   1070  *  This is an alias for compatibility with earlier versions.
   1071  */
   1072 #define GLFW_OPENGL_DEBUG_CONTEXT   GLFW_CONTEXT_DEBUG
   1073 /*! @brief OpenGL profile hint and attribute.
   1074  *
   1075  *  OpenGL profile [hint](@ref GLFW_OPENGL_PROFILE_hint) and
   1076  *  [attribute](@ref GLFW_OPENGL_PROFILE_attrib).
   1077  */
   1078 #define GLFW_OPENGL_PROFILE         0x00022008
   1079 /*! @brief Context flush-on-release hint and attribute.
   1080  *
   1081  *  Context flush-on-release [hint](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_hint) and
   1082  *  [attribute](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_attrib).
   1083  */
   1084 #define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009
   1085 /*! @brief Context error suppression hint and attribute.
   1086  *
   1087  *  Context error suppression [hint](@ref GLFW_CONTEXT_NO_ERROR_hint) and
   1088  *  [attribute](@ref GLFW_CONTEXT_NO_ERROR_attrib).
   1089  */
   1090 #define GLFW_CONTEXT_NO_ERROR       0x0002200A
   1091 /*! @brief Context creation API hint and attribute.
   1092  *
   1093  *  Context creation API [hint](@ref GLFW_CONTEXT_CREATION_API_hint) and
   1094  *  [attribute](@ref GLFW_CONTEXT_CREATION_API_attrib).
   1095  */
   1096 #define GLFW_CONTEXT_CREATION_API   0x0002200B
   1097 /*! @brief Window content area scaling window
   1098  *  [window hint](@ref GLFW_SCALE_TO_MONITOR).
   1099  */
   1100 #define GLFW_SCALE_TO_MONITOR       0x0002200C
   1101 /*! @brief Window framebuffer scaling
   1102  *  [window hint](@ref GLFW_SCALE_FRAMEBUFFER_hint).
   1103  */
   1104 #define GLFW_SCALE_FRAMEBUFFER      0x0002200D
   1105 /*! @brief Legacy name for compatibility.
   1106  *
   1107  *  This is an alias for the
   1108  *  [GLFW_SCALE_FRAMEBUFFER](@ref GLFW_SCALE_FRAMEBUFFER_hint) window hint for
   1109  *  compatibility with earlier versions.
   1110  */
   1111 #define GLFW_COCOA_RETINA_FRAMEBUFFER 0x00023001
   1112 /*! @brief macOS specific
   1113  *  [window hint](@ref GLFW_COCOA_FRAME_NAME_hint).
   1114  */
   1115 #define GLFW_COCOA_FRAME_NAME         0x00023002
   1116 /*! @brief macOS specific
   1117  *  [window hint](@ref GLFW_COCOA_GRAPHICS_SWITCHING_hint).
   1118  */
   1119 #define GLFW_COCOA_GRAPHICS_SWITCHING 0x00023003
   1120 /*! @brief X11 specific
   1121  *  [window hint](@ref GLFW_X11_CLASS_NAME_hint).
   1122  */
   1123 #define GLFW_X11_CLASS_NAME         0x00024001
   1124 /*! @brief X11 specific
   1125  *  [window hint](@ref GLFW_X11_CLASS_NAME_hint).
   1126  */
   1127 #define GLFW_X11_INSTANCE_NAME      0x00024002
   1128 #define GLFW_WIN32_KEYBOARD_MENU    0x00025001
   1129 /*! @brief Win32 specific [window hint](@ref GLFW_WIN32_SHOWDEFAULT_hint).
   1130  */
   1131 #define GLFW_WIN32_SHOWDEFAULT      0x00025002
   1132 /*! @brief Wayland specific
   1133  *  [window hint](@ref GLFW_WAYLAND_APP_ID_hint).
   1134  *  
   1135  *  Allows specification of the Wayland app_id.
   1136  */
   1137 #define GLFW_WAYLAND_APP_ID         0x00026001
   1138 /*! @} */
   1139 
   1140 #define GLFW_NO_API                          0
   1141 #define GLFW_OPENGL_API             0x00030001
   1142 #define GLFW_OPENGL_ES_API          0x00030002
   1143 
   1144 #define GLFW_NO_ROBUSTNESS                   0
   1145 #define GLFW_NO_RESET_NOTIFICATION  0x00031001
   1146 #define GLFW_LOSE_CONTEXT_ON_RESET  0x00031002
   1147 
   1148 #define GLFW_OPENGL_ANY_PROFILE              0
   1149 #define GLFW_OPENGL_CORE_PROFILE    0x00032001
   1150 #define GLFW_OPENGL_COMPAT_PROFILE  0x00032002
   1151 
   1152 #define GLFW_CURSOR                 0x00033001
   1153 #define GLFW_STICKY_KEYS            0x00033002
   1154 #define GLFW_STICKY_MOUSE_BUTTONS   0x00033003
   1155 #define GLFW_LOCK_KEY_MODS          0x00033004
   1156 #define GLFW_RAW_MOUSE_MOTION       0x00033005
   1157 
   1158 #define GLFW_CURSOR_NORMAL          0x00034001
   1159 #define GLFW_CURSOR_HIDDEN          0x00034002
   1160 #define GLFW_CURSOR_DISABLED        0x00034003
   1161 #define GLFW_CURSOR_CAPTURED        0x00034004
   1162 
   1163 #define GLFW_ANY_RELEASE_BEHAVIOR            0
   1164 #define GLFW_RELEASE_BEHAVIOR_FLUSH 0x00035001
   1165 #define GLFW_RELEASE_BEHAVIOR_NONE  0x00035002
   1166 
   1167 #define GLFW_NATIVE_CONTEXT_API     0x00036001
   1168 #define GLFW_EGL_CONTEXT_API        0x00036002
   1169 #define GLFW_OSMESA_CONTEXT_API     0x00036003
   1170 
   1171 #define GLFW_ANGLE_PLATFORM_TYPE_NONE    0x00037001
   1172 #define GLFW_ANGLE_PLATFORM_TYPE_OPENGL  0x00037002
   1173 #define GLFW_ANGLE_PLATFORM_TYPE_OPENGLES 0x00037003
   1174 #define GLFW_ANGLE_PLATFORM_TYPE_D3D9    0x00037004
   1175 #define GLFW_ANGLE_PLATFORM_TYPE_D3D11   0x00037005
   1176 #define GLFW_ANGLE_PLATFORM_TYPE_VULKAN  0x00037007
   1177 #define GLFW_ANGLE_PLATFORM_TYPE_METAL   0x00037008
   1178 
   1179 #define GLFW_WAYLAND_PREFER_LIBDECOR    0x00038001
   1180 #define GLFW_WAYLAND_DISABLE_LIBDECOR   0x00038002
   1181 
   1182 #define GLFW_ANY_POSITION           0x80000000
   1183 
   1184 /*! @defgroup shapes Standard cursor shapes
   1185  *  @brief Standard system cursor shapes.
   1186  *
   1187  *  These are the [standard cursor shapes](@ref cursor_standard) that can be
   1188  *  requested from the platform (window system).
   1189  *
   1190  *  @ingroup input
   1191  *  @{ */
   1192 
   1193 /*! @brief The regular arrow cursor shape.
   1194  *
   1195  *  The regular arrow cursor shape.
   1196  */
   1197 #define GLFW_ARROW_CURSOR           0x00036001
   1198 /*! @brief The text input I-beam cursor shape.
   1199  *
   1200  *  The text input I-beam cursor shape.
   1201  */
   1202 #define GLFW_IBEAM_CURSOR           0x00036002
   1203 /*! @brief The crosshair cursor shape.
   1204  *
   1205  *  The crosshair cursor shape.
   1206  */
   1207 #define GLFW_CROSSHAIR_CURSOR       0x00036003
   1208 /*! @brief The pointing hand cursor shape.
   1209  *
   1210  *  The pointing hand cursor shape.
   1211  */
   1212 #define GLFW_POINTING_HAND_CURSOR   0x00036004
   1213 /*! @brief The horizontal resize/move arrow shape.
   1214  *
   1215  *  The horizontal resize/move arrow shape.  This is usually a horizontal
   1216  *  double-headed arrow.
   1217  */
   1218 #define GLFW_RESIZE_EW_CURSOR       0x00036005
   1219 /*! @brief The vertical resize/move arrow shape.
   1220  *
   1221  *  The vertical resize/move shape.  This is usually a vertical double-headed
   1222  *  arrow.
   1223  */
   1224 #define GLFW_RESIZE_NS_CURSOR       0x00036006
   1225 /*! @brief The top-left to bottom-right diagonal resize/move arrow shape.
   1226  *
   1227  *  The top-left to bottom-right diagonal resize/move shape.  This is usually
   1228  *  a diagonal double-headed arrow.
   1229  *
   1230  *  @note @macos This shape is provided by a private system API and may fail
   1231  *  with @ref GLFW_CURSOR_UNAVAILABLE in the future.
   1232  *
   1233  *  @note @wayland This shape is provided by a newer standard not supported by
   1234  *  all cursor themes.
   1235  *
   1236  *  @note @x11 This shape is provided by a newer standard not supported by all
   1237  *  cursor themes.
   1238  */
   1239 #define GLFW_RESIZE_NWSE_CURSOR     0x00036007
   1240 /*! @brief The top-right to bottom-left diagonal resize/move arrow shape.
   1241  *
   1242  *  The top-right to bottom-left diagonal resize/move shape.  This is usually
   1243  *  a diagonal double-headed arrow.
   1244  *
   1245  *  @note @macos This shape is provided by a private system API and may fail
   1246  *  with @ref GLFW_CURSOR_UNAVAILABLE in the future.
   1247  *
   1248  *  @note @wayland This shape is provided by a newer standard not supported by
   1249  *  all cursor themes.
   1250  *
   1251  *  @note @x11 This shape is provided by a newer standard not supported by all
   1252  *  cursor themes.
   1253  */
   1254 #define GLFW_RESIZE_NESW_CURSOR     0x00036008
   1255 /*! @brief The omni-directional resize/move cursor shape.
   1256  *
   1257  *  The omni-directional resize cursor/move shape.  This is usually either
   1258  *  a combined horizontal and vertical double-headed arrow or a grabbing hand.
   1259  */
   1260 #define GLFW_RESIZE_ALL_CURSOR      0x00036009
   1261 /*! @brief The operation-not-allowed shape.
   1262  *
   1263  *  The operation-not-allowed shape.  This is usually a circle with a diagonal
   1264  *  line through it.
   1265  *
   1266  *  @note @wayland This shape is provided by a newer standard not supported by
   1267  *  all cursor themes.
   1268  *
   1269  *  @note @x11 This shape is provided by a newer standard not supported by all
   1270  *  cursor themes.
   1271  */
   1272 #define GLFW_NOT_ALLOWED_CURSOR     0x0003600A
   1273 /*! @brief Legacy name for compatibility.
   1274  *
   1275  *  This is an alias for compatibility with earlier versions.
   1276  */
   1277 #define GLFW_HRESIZE_CURSOR         GLFW_RESIZE_EW_CURSOR
   1278 /*! @brief Legacy name for compatibility.
   1279  *
   1280  *  This is an alias for compatibility with earlier versions.
   1281  */
   1282 #define GLFW_VRESIZE_CURSOR         GLFW_RESIZE_NS_CURSOR
   1283 /*! @brief Legacy name for compatibility.
   1284  *
   1285  *  This is an alias for compatibility with earlier versions.
   1286  */
   1287 #define GLFW_HAND_CURSOR            GLFW_POINTING_HAND_CURSOR
   1288 /*! @} */
   1289 
   1290 #define GLFW_CONNECTED              0x00040001
   1291 #define GLFW_DISCONNECTED           0x00040002
   1292 
   1293 /*! @addtogroup init
   1294  *  @{ */
   1295 /*! @brief Joystick hat buttons init hint.
   1296  *
   1297  *  Joystick hat buttons [init hint](@ref GLFW_JOYSTICK_HAT_BUTTONS).
   1298  */
   1299 #define GLFW_JOYSTICK_HAT_BUTTONS   0x00050001
   1300 /*! @brief ANGLE rendering backend init hint.
   1301  *
   1302  *  ANGLE rendering backend [init hint](@ref GLFW_ANGLE_PLATFORM_TYPE_hint).
   1303  */
   1304 #define GLFW_ANGLE_PLATFORM_TYPE    0x00050002
   1305 /*! @brief Platform selection init hint.
   1306  *
   1307  *  Platform selection [init hint](@ref GLFW_PLATFORM).
   1308  */
   1309 #define GLFW_PLATFORM               0x00050003
   1310 /*! @brief macOS specific init hint.
   1311  *
   1312  *  macOS specific [init hint](@ref GLFW_COCOA_CHDIR_RESOURCES_hint).
   1313  */
   1314 #define GLFW_COCOA_CHDIR_RESOURCES  0x00051001
   1315 /*! @brief macOS specific init hint.
   1316  *
   1317  *  macOS specific [init hint](@ref GLFW_COCOA_MENUBAR_hint).
   1318  */
   1319 #define GLFW_COCOA_MENUBAR          0x00051002
   1320 /*! @brief X11 specific init hint.
   1321  *
   1322  *  X11 specific [init hint](@ref GLFW_X11_XCB_VULKAN_SURFACE_hint).
   1323  */
   1324 #define GLFW_X11_XCB_VULKAN_SURFACE 0x00052001
   1325 /*! @brief Wayland specific init hint.
   1326  *
   1327  *  Wayland specific [init hint](@ref GLFW_WAYLAND_LIBDECOR_hint).
   1328  */
   1329 #define GLFW_WAYLAND_LIBDECOR       0x00053001
   1330 /*! @} */
   1331 
   1332 /*! @addtogroup init
   1333  *  @{ */
   1334 /*! @brief Hint value that enables automatic platform selection.
   1335  *
   1336  *  Hint value for @ref GLFW_PLATFORM that enables automatic platform selection.
   1337  */
   1338 #define GLFW_ANY_PLATFORM           0x00060000
   1339 #define GLFW_PLATFORM_WIN32         0x00060001
   1340 #define GLFW_PLATFORM_COCOA         0x00060002
   1341 #define GLFW_PLATFORM_WAYLAND       0x00060003
   1342 #define GLFW_PLATFORM_X11           0x00060004
   1343 #define GLFW_PLATFORM_NULL          0x00060005
   1344 /*! @} */
   1345 
   1346 #define GLFW_DONT_CARE              -1
   1347 
   1348 
   1349 /*************************************************************************
   1350  * GLFW API types
   1351  *************************************************************************/
   1352 
   1353 /*! @brief Client API function pointer type.
   1354  *
   1355  *  Generic function pointer used for returning client API function pointers
   1356  *  without forcing a cast from a regular pointer.
   1357  *
   1358  *  @sa @ref context_glext
   1359  *  @sa @ref glfwGetProcAddress
   1360  *
   1361  *  @since Added in version 3.0.
   1362  *
   1363  *  @ingroup context
   1364  */
   1365 typedef void (*GLFWglproc)(void);
   1366 
   1367 /*! @brief Vulkan API function pointer type.
   1368  *
   1369  *  Generic function pointer used for returning Vulkan API function pointers
   1370  *  without forcing a cast from a regular pointer.
   1371  *
   1372  *  @sa @ref vulkan_proc
   1373  *  @sa @ref glfwGetInstanceProcAddress
   1374  *
   1375  *  @since Added in version 3.2.
   1376  *
   1377  *  @ingroup vulkan
   1378  */
   1379 typedef void (*GLFWvkproc)(void);
   1380 
   1381 /*! @brief Opaque monitor object.
   1382  *
   1383  *  Opaque monitor object.
   1384  *
   1385  *  @see @ref monitor_object
   1386  *
   1387  *  @since Added in version 3.0.
   1388  *
   1389  *  @ingroup monitor
   1390  */
   1391 typedef struct GLFWmonitor GLFWmonitor;
   1392 
   1393 /*! @brief Opaque window object.
   1394  *
   1395  *  Opaque window object.
   1396  *
   1397  *  @see @ref window_object
   1398  *
   1399  *  @since Added in version 3.0.
   1400  *
   1401  *  @ingroup window
   1402  */
   1403 typedef struct GLFWwindow GLFWwindow;
   1404 
   1405 /*! @brief Opaque cursor object.
   1406  *
   1407  *  Opaque cursor object.
   1408  *
   1409  *  @see @ref cursor_object
   1410  *
   1411  *  @since Added in version 3.1.
   1412  *
   1413  *  @ingroup input
   1414  */
   1415 typedef struct GLFWcursor GLFWcursor;
   1416 
   1417 /*! @brief The function pointer type for memory allocation callbacks.
   1418  *
   1419  *  This is the function pointer type for memory allocation callbacks.  A memory
   1420  *  allocation callback function has the following signature:
   1421  *  @code
   1422  *  void* function_name(size_t size, void* user)
   1423  *  @endcode
   1424  *
   1425  *  This function must return either a memory block at least `size` bytes long,
   1426  *  or `NULL` if allocation failed.  Note that not all parts of GLFW handle allocation
   1427  *  failures gracefully yet.
   1428  *
   1429  *  This function must support being called during @ref glfwInit but before the library is
   1430  *  flagged as initialized, as well as during @ref glfwTerminate after the library is no
   1431  *  longer flagged as initialized.
   1432  *
   1433  *  Any memory allocated via this function will be deallocated via the same allocator
   1434  *  during library termination or earlier.
   1435  *
   1436  *  Any memory allocated via this function must be suitably aligned for any object type.
   1437  *  If you are using C99 or earlier, this alignment is platform-dependent but will be the
   1438  *  same as what `malloc` provides.  If you are using C11 or later, this is the value of
   1439  *  `alignof(max_align_t)`.
   1440  *
   1441  *  The size will always be greater than zero.  Allocations of size zero are filtered out
   1442  *  before reaching the custom allocator.
   1443  *
   1444  *  If this function returns `NULL`, GLFW will emit @ref GLFW_OUT_OF_MEMORY.
   1445  *
   1446  *  This function must not call any GLFW function.
   1447  *
   1448  *  @param[in] size The minimum size, in bytes, of the memory block.
   1449  *  @param[in] user The user-defined pointer from the allocator.
   1450  *  @return The address of the newly allocated memory block, or `NULL` if an
   1451  *  error occurred.
   1452  *
   1453  *  @pointer_lifetime The returned memory block must be valid at least until it
   1454  *  is deallocated.
   1455  *
   1456  *  @reentrancy This function should not call any GLFW function.
   1457  *
   1458  *  @thread_safety This function must support being called from any thread that calls GLFW
   1459  *  functions.
   1460  *
   1461  *  @sa @ref init_allocator
   1462  *  @sa @ref GLFWallocator
   1463  *
   1464  *  @since Added in version 3.4.
   1465  *
   1466  *  @ingroup init
   1467  */
   1468 typedef void* (* GLFWallocatefun)(size_t size, void* user);
   1469 
   1470 /*! @brief The function pointer type for memory reallocation callbacks.
   1471  *
   1472  *  This is the function pointer type for memory reallocation callbacks.
   1473  *  A memory reallocation callback function has the following signature:
   1474  *  @code
   1475  *  void* function_name(void* block, size_t size, void* user)
   1476  *  @endcode
   1477  *
   1478  *  This function must return a memory block at least `size` bytes long, or
   1479  *  `NULL` if allocation failed.  Note that not all parts of GLFW handle allocation
   1480  *  failures gracefully yet.
   1481  *
   1482  *  This function must support being called during @ref glfwInit but before the library is
   1483  *  flagged as initialized, as well as during @ref glfwTerminate after the library is no
   1484  *  longer flagged as initialized.
   1485  *
   1486  *  Any memory allocated via this function will be deallocated via the same allocator
   1487  *  during library termination or earlier.
   1488  *
   1489  *  Any memory allocated via this function must be suitably aligned for any object type.
   1490  *  If you are using C99 or earlier, this alignment is platform-dependent but will be the
   1491  *  same as what `realloc` provides.  If you are using C11 or later, this is the value of
   1492  *  `alignof(max_align_t)`.
   1493  *
   1494  *  The block address will never be `NULL` and the size will always be greater than zero.
   1495  *  Reallocations of a block to size zero are converted into deallocations before reaching
   1496  *  the custom allocator.  Reallocations of `NULL` to a non-zero size are converted into
   1497  *  regular allocations before reaching the custom allocator.
   1498  *
   1499  *  If this function returns `NULL`, GLFW will emit @ref GLFW_OUT_OF_MEMORY.
   1500  *
   1501  *  This function must not call any GLFW function.
   1502  *
   1503  *  @param[in] block The address of the memory block to reallocate.
   1504  *  @param[in] size The new minimum size, in bytes, of the memory block.
   1505  *  @param[in] user The user-defined pointer from the allocator.
   1506  *  @return The address of the newly allocated or resized memory block, or
   1507  *  `NULL` if an error occurred.
   1508  *
   1509  *  @pointer_lifetime The returned memory block must be valid at least until it
   1510  *  is deallocated.
   1511  *
   1512  *  @reentrancy This function should not call any GLFW function.
   1513  *
   1514  *  @thread_safety This function must support being called from any thread that calls GLFW
   1515  *  functions.
   1516  *
   1517  *  @sa @ref init_allocator
   1518  *  @sa @ref GLFWallocator
   1519  *
   1520  *  @since Added in version 3.4.
   1521  *
   1522  *  @ingroup init
   1523  */
   1524 typedef void* (* GLFWreallocatefun)(void* block, size_t size, void* user);
   1525 
   1526 /*! @brief The function pointer type for memory deallocation callbacks.
   1527  *
   1528  *  This is the function pointer type for memory deallocation callbacks.
   1529  *  A memory deallocation callback function has the following signature:
   1530  *  @code
   1531  *  void function_name(void* block, void* user)
   1532  *  @endcode
   1533  *
   1534  *  This function may deallocate the specified memory block.  This memory block
   1535  *  will have been allocated with the same allocator.
   1536  *
   1537  *  This function must support being called during @ref glfwInit but before the library is
   1538  *  flagged as initialized, as well as during @ref glfwTerminate after the library is no
   1539  *  longer flagged as initialized.
   1540  *
   1541  *  The block address will never be `NULL`.  Deallocations of `NULL` are filtered out
   1542  *  before reaching the custom allocator.
   1543  *
   1544  *  If this function returns `NULL`, GLFW will emit @ref GLFW_OUT_OF_MEMORY.
   1545  *
   1546  *  This function must not call any GLFW function.
   1547  *
   1548  *  @param[in] block The address of the memory block to deallocate.
   1549  *  @param[in] user The user-defined pointer from the allocator.
   1550  *
   1551  *  @pointer_lifetime The specified memory block will not be accessed by GLFW
   1552  *  after this function is called.
   1553  *
   1554  *  @reentrancy This function should not call any GLFW function.
   1555  *
   1556  *  @thread_safety This function must support being called from any thread that calls GLFW
   1557  *  functions.
   1558  *
   1559  *  @sa @ref init_allocator
   1560  *  @sa @ref GLFWallocator
   1561  *
   1562  *  @since Added in version 3.4.
   1563  *
   1564  *  @ingroup init
   1565  */
   1566 typedef void (* GLFWdeallocatefun)(void* block, void* user);
   1567 
   1568 /*! @brief The function pointer type for error callbacks.
   1569  *
   1570  *  This is the function pointer type for error callbacks.  An error callback
   1571  *  function has the following signature:
   1572  *  @code
   1573  *  void callback_name(int error_code, const char* description)
   1574  *  @endcode
   1575  *
   1576  *  @param[in] error_code An [error code](@ref errors).  Future releases may add
   1577  *  more error codes.
   1578  *  @param[in] description A UTF-8 encoded string describing the error.
   1579  *
   1580  *  @pointer_lifetime The error description string is valid until the callback
   1581  *  function returns.
   1582  *
   1583  *  @sa @ref error_handling
   1584  *  @sa @ref glfwSetErrorCallback
   1585  *
   1586  *  @since Added in version 3.0.
   1587  *
   1588  *  @ingroup init
   1589  */
   1590 typedef void (* GLFWerrorfun)(int error_code, const char* description);
   1591 
   1592 /*! @brief The function pointer type for window position callbacks.
   1593  *
   1594  *  This is the function pointer type for window position callbacks.  A window
   1595  *  position callback function has the following signature:
   1596  *  @code
   1597  *  void callback_name(GLFWwindow* window, int xpos, int ypos)
   1598  *  @endcode
   1599  *
   1600  *  @param[in] window The window that was moved.
   1601  *  @param[in] xpos The new x-coordinate, in screen coordinates, of the
   1602  *  upper-left corner of the content area of the window.
   1603  *  @param[in] ypos The new y-coordinate, in screen coordinates, of the
   1604  *  upper-left corner of the content area of the window.
   1605  *
   1606  *  @sa @ref window_pos
   1607  *  @sa @ref glfwSetWindowPosCallback
   1608  *
   1609  *  @since Added in version 3.0.
   1610  *
   1611  *  @ingroup window
   1612  */
   1613 typedef void (* GLFWwindowposfun)(GLFWwindow* window, int xpos, int ypos);
   1614 
   1615 /*! @brief The function pointer type for window size callbacks.
   1616  *
   1617  *  This is the function pointer type for window size callbacks.  A window size
   1618  *  callback function has the following signature:
   1619  *  @code
   1620  *  void callback_name(GLFWwindow* window, int width, int height)
   1621  *  @endcode
   1622  *
   1623  *  @param[in] window The window that was resized.
   1624  *  @param[in] width The new width, in screen coordinates, of the window.
   1625  *  @param[in] height The new height, in screen coordinates, of the window.
   1626  *
   1627  *  @sa @ref window_size
   1628  *  @sa @ref glfwSetWindowSizeCallback
   1629  *
   1630  *  @since Added in version 1.0.
   1631  *  @glfw3 Added window handle parameter.
   1632  *
   1633  *  @ingroup window
   1634  */
   1635 typedef void (* GLFWwindowsizefun)(GLFWwindow* window, int width, int height);
   1636 
   1637 /*! @brief The function pointer type for window close callbacks.
   1638  *
   1639  *  This is the function pointer type for window close callbacks.  A window
   1640  *  close callback function has the following signature:
   1641  *  @code
   1642  *  void function_name(GLFWwindow* window)
   1643  *  @endcode
   1644  *
   1645  *  @param[in] window The window that the user attempted to close.
   1646  *
   1647  *  @sa @ref window_close
   1648  *  @sa @ref glfwSetWindowCloseCallback
   1649  *
   1650  *  @since Added in version 2.5.
   1651  *  @glfw3 Added window handle parameter.
   1652  *
   1653  *  @ingroup window
   1654  */
   1655 typedef void (* GLFWwindowclosefun)(GLFWwindow* window);
   1656 
   1657 /*! @brief The function pointer type for window content refresh callbacks.
   1658  *
   1659  *  This is the function pointer type for window content refresh callbacks.
   1660  *  A window content refresh callback function has the following signature:
   1661  *  @code
   1662  *  void function_name(GLFWwindow* window);
   1663  *  @endcode
   1664  *
   1665  *  @param[in] window The window whose content needs to be refreshed.
   1666  *
   1667  *  @sa @ref window_refresh
   1668  *  @sa @ref glfwSetWindowRefreshCallback
   1669  *
   1670  *  @since Added in version 2.5.
   1671  *  @glfw3 Added window handle parameter.
   1672  *
   1673  *  @ingroup window
   1674  */
   1675 typedef void (* GLFWwindowrefreshfun)(GLFWwindow* window);
   1676 
   1677 /*! @brief The function pointer type for window focus callbacks.
   1678  *
   1679  *  This is the function pointer type for window focus callbacks.  A window
   1680  *  focus callback function has the following signature:
   1681  *  @code
   1682  *  void function_name(GLFWwindow* window, int focused)
   1683  *  @endcode
   1684  *
   1685  *  @param[in] window The window that gained or lost input focus.
   1686  *  @param[in] focused `GLFW_TRUE` if the window was given input focus, or
   1687  *  `GLFW_FALSE` if it lost it.
   1688  *
   1689  *  @sa @ref window_focus
   1690  *  @sa @ref glfwSetWindowFocusCallback
   1691  *
   1692  *  @since Added in version 3.0.
   1693  *
   1694  *  @ingroup window
   1695  */
   1696 typedef void (* GLFWwindowfocusfun)(GLFWwindow* window, int focused);
   1697 
   1698 /*! @brief The function pointer type for window iconify callbacks.
   1699  *
   1700  *  This is the function pointer type for window iconify callbacks.  A window
   1701  *  iconify callback function has the following signature:
   1702  *  @code
   1703  *  void function_name(GLFWwindow* window, int iconified)
   1704  *  @endcode
   1705  *
   1706  *  @param[in] window The window that was iconified or restored.
   1707  *  @param[in] iconified `GLFW_TRUE` if the window was iconified, or
   1708  *  `GLFW_FALSE` if it was restored.
   1709  *
   1710  *  @sa @ref window_iconify
   1711  *  @sa @ref glfwSetWindowIconifyCallback
   1712  *
   1713  *  @since Added in version 3.0.
   1714  *
   1715  *  @ingroup window
   1716  */
   1717 typedef void (* GLFWwindowiconifyfun)(GLFWwindow* window, int iconified);
   1718 
   1719 /*! @brief The function pointer type for window maximize callbacks.
   1720  *
   1721  *  This is the function pointer type for window maximize callbacks.  A window
   1722  *  maximize callback function has the following signature:
   1723  *  @code
   1724  *  void function_name(GLFWwindow* window, int maximized)
   1725  *  @endcode
   1726  *
   1727  *  @param[in] window The window that was maximized or restored.
   1728  *  @param[in] maximized `GLFW_TRUE` if the window was maximized, or
   1729  *  `GLFW_FALSE` if it was restored.
   1730  *
   1731  *  @sa @ref window_maximize
   1732  *  @sa glfwSetWindowMaximizeCallback
   1733  *
   1734  *  @since Added in version 3.3.
   1735  *
   1736  *  @ingroup window
   1737  */
   1738 typedef void (* GLFWwindowmaximizefun)(GLFWwindow* window, int maximized);
   1739 
   1740 /*! @brief The function pointer type for framebuffer size callbacks.
   1741  *
   1742  *  This is the function pointer type for framebuffer size callbacks.
   1743  *  A framebuffer size callback function has the following signature:
   1744  *  @code
   1745  *  void function_name(GLFWwindow* window, int width, int height)
   1746  *  @endcode
   1747  *
   1748  *  @param[in] window The window whose framebuffer was resized.
   1749  *  @param[in] width The new width, in pixels, of the framebuffer.
   1750  *  @param[in] height The new height, in pixels, of the framebuffer.
   1751  *
   1752  *  @sa @ref window_fbsize
   1753  *  @sa @ref glfwSetFramebufferSizeCallback
   1754  *
   1755  *  @since Added in version 3.0.
   1756  *
   1757  *  @ingroup window
   1758  */
   1759 typedef void (* GLFWframebuffersizefun)(GLFWwindow* window, int width, int height);
   1760 
   1761 /*! @brief The function pointer type for window content scale callbacks.
   1762  *
   1763  *  This is the function pointer type for window content scale callbacks.
   1764  *  A window content scale callback function has the following signature:
   1765  *  @code
   1766  *  void function_name(GLFWwindow* window, float xscale, float yscale)
   1767  *  @endcode
   1768  *
   1769  *  @param[in] window The window whose content scale changed.
   1770  *  @param[in] xscale The new x-axis content scale of the window.
   1771  *  @param[in] yscale The new y-axis content scale of the window.
   1772  *
   1773  *  @sa @ref window_scale
   1774  *  @sa @ref glfwSetWindowContentScaleCallback
   1775  *
   1776  *  @since Added in version 3.3.
   1777  *
   1778  *  @ingroup window
   1779  */
   1780 typedef void (* GLFWwindowcontentscalefun)(GLFWwindow* window, float xscale, float yscale);
   1781 
   1782 /*! @brief The function pointer type for mouse button callbacks.
   1783  *
   1784  *  This is the function pointer type for mouse button callback functions.
   1785  *  A mouse button callback function has the following signature:
   1786  *  @code
   1787  *  void function_name(GLFWwindow* window, int button, int action, int mods)
   1788  *  @endcode
   1789  *
   1790  *  @param[in] window The window that received the event.
   1791  *  @param[in] button The [mouse button](@ref buttons) that was pressed or
   1792  *  released.
   1793  *  @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`.  Future releases
   1794  *  may add more actions.
   1795  *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were
   1796  *  held down.
   1797  *
   1798  *  @sa @ref input_mouse_button
   1799  *  @sa @ref glfwSetMouseButtonCallback
   1800  *
   1801  *  @since Added in version 1.0.
   1802  *  @glfw3 Added window handle and modifier mask parameters.
   1803  *
   1804  *  @ingroup input
   1805  */
   1806 typedef void (* GLFWmousebuttonfun)(GLFWwindow* window, int button, int action, int mods);
   1807 
   1808 /*! @brief The function pointer type for cursor position callbacks.
   1809  *
   1810  *  This is the function pointer type for cursor position callbacks.  A cursor
   1811  *  position callback function has the following signature:
   1812  *  @code
   1813  *  void function_name(GLFWwindow* window, double xpos, double ypos);
   1814  *  @endcode
   1815  *
   1816  *  @param[in] window The window that received the event.
   1817  *  @param[in] xpos The new cursor x-coordinate, relative to the left edge of
   1818  *  the content area.
   1819  *  @param[in] ypos The new cursor y-coordinate, relative to the top edge of the
   1820  *  content area.
   1821  *
   1822  *  @sa @ref cursor_pos
   1823  *  @sa @ref glfwSetCursorPosCallback
   1824  *
   1825  *  @since Added in version 3.0.  Replaces `GLFWmouseposfun`.
   1826  *
   1827  *  @ingroup input
   1828  */
   1829 typedef void (* GLFWcursorposfun)(GLFWwindow* window, double xpos, double ypos);
   1830 
   1831 /*! @brief The function pointer type for cursor enter/leave callbacks.
   1832  *
   1833  *  This is the function pointer type for cursor enter/leave callbacks.
   1834  *  A cursor enter/leave callback function has the following signature:
   1835  *  @code
   1836  *  void function_name(GLFWwindow* window, int entered)
   1837  *  @endcode
   1838  *
   1839  *  @param[in] window The window that received the event.
   1840  *  @param[in] entered `GLFW_TRUE` if the cursor entered the window's content
   1841  *  area, or `GLFW_FALSE` if it left it.
   1842  *
   1843  *  @sa @ref cursor_enter
   1844  *  @sa @ref glfwSetCursorEnterCallback
   1845  *
   1846  *  @since Added in version 3.0.
   1847  *
   1848  *  @ingroup input
   1849  */
   1850 typedef void (* GLFWcursorenterfun)(GLFWwindow* window, int entered);
   1851 
   1852 /*! @brief The function pointer type for scroll callbacks.
   1853  *
   1854  *  This is the function pointer type for scroll callbacks.  A scroll callback
   1855  *  function has the following signature:
   1856  *  @code
   1857  *  void function_name(GLFWwindow* window, double xoffset, double yoffset)
   1858  *  @endcode
   1859  *
   1860  *  @param[in] window The window that received the event.
   1861  *  @param[in] xoffset The scroll offset along the x-axis.
   1862  *  @param[in] yoffset The scroll offset along the y-axis.
   1863  *
   1864  *  @sa @ref scrolling
   1865  *  @sa @ref glfwSetScrollCallback
   1866  *
   1867  *  @since Added in version 3.0.  Replaces `GLFWmousewheelfun`.
   1868  *
   1869  *  @ingroup input
   1870  */
   1871 typedef void (* GLFWscrollfun)(GLFWwindow* window, double xoffset, double yoffset);
   1872 
   1873 /*! @brief The function pointer type for keyboard key callbacks.
   1874  *
   1875  *  This is the function pointer type for keyboard key callbacks.  A keyboard
   1876  *  key callback function has the following signature:
   1877  *  @code
   1878  *  void function_name(GLFWwindow* window, int key, int scancode, int action, int mods)
   1879  *  @endcode
   1880  *
   1881  *  @param[in] window The window that received the event.
   1882  *  @param[in] key The [keyboard key](@ref keys) that was pressed or released.
   1883  *  @param[in] scancode The platform-specific scancode of the key.
   1884  *  @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`.  Future
   1885  *  releases may add more actions.
   1886  *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were
   1887  *  held down.
   1888  *
   1889  *  @sa @ref input_key
   1890  *  @sa @ref glfwSetKeyCallback
   1891  *
   1892  *  @since Added in version 1.0.
   1893  *  @glfw3 Added window handle, scancode and modifier mask parameters.
   1894  *
   1895  *  @ingroup input
   1896  */
   1897 typedef void (* GLFWkeyfun)(GLFWwindow* window, int key, int scancode, int action, int mods);
   1898 
   1899 /*! @brief The function pointer type for Unicode character callbacks.
   1900  *
   1901  *  This is the function pointer type for Unicode character callbacks.
   1902  *  A Unicode character callback function has the following signature:
   1903  *  @code
   1904  *  void function_name(GLFWwindow* window, unsigned int codepoint)
   1905  *  @endcode
   1906  *
   1907  *  @param[in] window The window that received the event.
   1908  *  @param[in] codepoint The Unicode code point of the character.
   1909  *
   1910  *  @sa @ref input_char
   1911  *  @sa @ref glfwSetCharCallback
   1912  *
   1913  *  @since Added in version 2.4.
   1914  *  @glfw3 Added window handle parameter.
   1915  *
   1916  *  @ingroup input
   1917  */
   1918 typedef void (* GLFWcharfun)(GLFWwindow* window, unsigned int codepoint);
   1919 
   1920 /*! @brief The function pointer type for Unicode character with modifiers
   1921  *  callbacks.
   1922  *
   1923  *  This is the function pointer type for Unicode character with modifiers
   1924  *  callbacks.  It is called for each input character, regardless of what
   1925  *  modifier keys are held down.  A Unicode character with modifiers callback
   1926  *  function has the following signature:
   1927  *  @code
   1928  *  void function_name(GLFWwindow* window, unsigned int codepoint, int mods)
   1929  *  @endcode
   1930  *
   1931  *  @param[in] window The window that received the event.
   1932  *  @param[in] codepoint The Unicode code point of the character.
   1933  *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were
   1934  *  held down.
   1935  *
   1936  *  @sa @ref input_char
   1937  *  @sa @ref glfwSetCharModsCallback
   1938  *
   1939  *  @deprecated Scheduled for removal in version 4.0.
   1940  *
   1941  *  @since Added in version 3.1.
   1942  *
   1943  *  @ingroup input
   1944  */
   1945 typedef void (* GLFWcharmodsfun)(GLFWwindow* window, unsigned int codepoint, int mods);
   1946 
   1947 /*! @brief The function pointer type for path drop callbacks.
   1948  *
   1949  *  This is the function pointer type for path drop callbacks.  A path drop
   1950  *  callback function has the following signature:
   1951  *  @code
   1952  *  void function_name(GLFWwindow* window, int path_count, const char* paths[])
   1953  *  @endcode
   1954  *
   1955  *  @param[in] window The window that received the event.
   1956  *  @param[in] path_count The number of dropped paths.
   1957  *  @param[in] paths The UTF-8 encoded file and/or directory path names.
   1958  *
   1959  *  @pointer_lifetime The path array and its strings are valid until the
   1960  *  callback function returns.
   1961  *
   1962  *  @sa @ref path_drop
   1963  *  @sa @ref glfwSetDropCallback
   1964  *
   1965  *  @since Added in version 3.1.
   1966  *
   1967  *  @ingroup input
   1968  */
   1969 typedef void (* GLFWdropfun)(GLFWwindow* window, int path_count, const char* paths[]);
   1970 
   1971 /*! @brief The function pointer type for monitor configuration callbacks.
   1972  *
   1973  *  This is the function pointer type for monitor configuration callbacks.
   1974  *  A monitor callback function has the following signature:
   1975  *  @code
   1976  *  void function_name(GLFWmonitor* monitor, int event)
   1977  *  @endcode
   1978  *
   1979  *  @param[in] monitor The monitor that was connected or disconnected.
   1980  *  @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.  Future
   1981  *  releases may add more events.
   1982  *
   1983  *  @sa @ref monitor_event
   1984  *  @sa @ref glfwSetMonitorCallback
   1985  *
   1986  *  @since Added in version 3.0.
   1987  *
   1988  *  @ingroup monitor
   1989  */
   1990 typedef void (* GLFWmonitorfun)(GLFWmonitor* monitor, int event);
   1991 
   1992 /*! @brief The function pointer type for joystick configuration callbacks.
   1993  *
   1994  *  This is the function pointer type for joystick configuration callbacks.
   1995  *  A joystick configuration callback function has the following signature:
   1996  *  @code
   1997  *  void function_name(int jid, int event)
   1998  *  @endcode
   1999  *
   2000  *  @param[in] jid The joystick that was connected or disconnected.
   2001  *  @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.  Future
   2002  *  releases may add more events.
   2003  *
   2004  *  @sa @ref joystick_event
   2005  *  @sa @ref glfwSetJoystickCallback
   2006  *
   2007  *  @since Added in version 3.2.
   2008  *
   2009  *  @ingroup input
   2010  */
   2011 typedef void (* GLFWjoystickfun)(int jid, int event);
   2012 
   2013 /*! @brief Video mode type.
   2014  *
   2015  *  This describes a single video mode.
   2016  *
   2017  *  @sa @ref monitor_modes
   2018  *  @sa @ref glfwGetVideoMode
   2019  *  @sa @ref glfwGetVideoModes
   2020  *
   2021  *  @since Added in version 1.0.
   2022  *  @glfw3 Added refresh rate member.
   2023  *
   2024  *  @ingroup monitor
   2025  */
   2026 typedef struct GLFWvidmode
   2027 {
   2028     /*! The width, in screen coordinates, of the video mode.
   2029      */
   2030     int width;
   2031     /*! The height, in screen coordinates, of the video mode.
   2032      */
   2033     int height;
   2034     /*! The bit depth of the red channel of the video mode.
   2035      */
   2036     int redBits;
   2037     /*! The bit depth of the green channel of the video mode.
   2038      */
   2039     int greenBits;
   2040     /*! The bit depth of the blue channel of the video mode.
   2041      */
   2042     int blueBits;
   2043     /*! The refresh rate, in Hz, of the video mode.
   2044      */
   2045     int refreshRate;
   2046 } GLFWvidmode;
   2047 
   2048 /*! @brief Gamma ramp.
   2049  *
   2050  *  This describes the gamma ramp for a monitor.
   2051  *
   2052  *  @sa @ref monitor_gamma
   2053  *  @sa @ref glfwGetGammaRamp
   2054  *  @sa @ref glfwSetGammaRamp
   2055  *
   2056  *  @since Added in version 3.0.
   2057  *
   2058  *  @ingroup monitor
   2059  */
   2060 typedef struct GLFWgammaramp
   2061 {
   2062     /*! An array of value describing the response of the red channel.
   2063      */
   2064     unsigned short* red;
   2065     /*! An array of value describing the response of the green channel.
   2066      */
   2067     unsigned short* green;
   2068     /*! An array of value describing the response of the blue channel.
   2069      */
   2070     unsigned short* blue;
   2071     /*! The number of elements in each array.
   2072      */
   2073     unsigned int size;
   2074 } GLFWgammaramp;
   2075 
   2076 /*! @brief Image data.
   2077  *
   2078  *  This describes a single 2D image.  See the documentation for each related
   2079  *  function what the expected pixel format is.
   2080  *
   2081  *  @sa @ref cursor_custom
   2082  *  @sa @ref window_icon
   2083  *
   2084  *  @since Added in version 2.1.
   2085  *  @glfw3 Removed format and bytes-per-pixel members.
   2086  *
   2087  *  @ingroup window
   2088  */
   2089 typedef struct GLFWimage
   2090 {
   2091     /*! The width, in pixels, of this image.
   2092      */
   2093     int width;
   2094     /*! The height, in pixels, of this image.
   2095      */
   2096     int height;
   2097     /*! The pixel data of this image, arranged left-to-right, top-to-bottom.
   2098      */
   2099     unsigned char* pixels;
   2100 } GLFWimage;
   2101 
   2102 /*! @brief Gamepad input state
   2103  *
   2104  *  This describes the input state of a gamepad.
   2105  *
   2106  *  @sa @ref gamepad
   2107  *  @sa @ref glfwGetGamepadState
   2108  *
   2109  *  @since Added in version 3.3.
   2110  *
   2111  *  @ingroup input
   2112  */
   2113 typedef struct GLFWgamepadstate
   2114 {
   2115     /*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS`
   2116      *  or `GLFW_RELEASE`.
   2117      */
   2118     unsigned char buttons[15];
   2119     /*! The states of each [gamepad axis](@ref gamepad_axes), in the range -1.0
   2120      *  to 1.0 inclusive.
   2121      */
   2122     float axes[6];
   2123 } GLFWgamepadstate;
   2124 
   2125 /*! @brief Custom heap memory allocator.
   2126  *
   2127  *  This describes a custom heap memory allocator for GLFW.  To set an allocator, pass it
   2128  *  to @ref glfwInitAllocator before initializing the library.
   2129  *
   2130  *  @sa @ref init_allocator
   2131  *  @sa @ref glfwInitAllocator
   2132  *
   2133  *  @since Added in version 3.4.
   2134  *
   2135  *  @ingroup init
   2136  */
   2137 typedef struct GLFWallocator
   2138 {
   2139     /*! The memory allocation function.  See @ref GLFWallocatefun for details about
   2140      *  allocation function.
   2141      */
   2142     GLFWallocatefun allocate;
   2143     /*! The memory reallocation function.  See @ref GLFWreallocatefun for details about
   2144      *  reallocation function.
   2145      */
   2146     GLFWreallocatefun reallocate;
   2147     /*! The memory deallocation function.  See @ref GLFWdeallocatefun for details about
   2148      *  deallocation function.
   2149      */
   2150     GLFWdeallocatefun deallocate;
   2151     /*! The user pointer for this custom allocator.  This value will be passed to the
   2152      *  allocator functions.
   2153      */
   2154     void* user;
   2155 } GLFWallocator;
   2156 
   2157 
   2158 /*************************************************************************
   2159  * GLFW API functions
   2160  *************************************************************************/
   2161 
   2162 /*! @brief Initializes the GLFW library.
   2163  *
   2164  *  This function initializes the GLFW library.  Before most GLFW functions can
   2165  *  be used, GLFW must be initialized, and before an application terminates GLFW
   2166  *  should be terminated in order to free any resources allocated during or
   2167  *  after initialization.
   2168  *
   2169  *  If this function fails, it calls @ref glfwTerminate before returning.  If it
   2170  *  succeeds, you should call @ref glfwTerminate before the application exits.
   2171  *
   2172  *  Additional calls to this function after successful initialization but before
   2173  *  termination will return `GLFW_TRUE` immediately.
   2174  *
   2175  *  The @ref GLFW_PLATFORM init hint controls which platforms are considered during
   2176  *  initialization.  This also depends on which platforms the library was compiled to
   2177  *  support.
   2178  *
   2179  *  @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
   2180  *  [error](@ref error_handling) occurred.
   2181  *
   2182  *  @errors Possible errors include @ref GLFW_PLATFORM_UNAVAILABLE and @ref
   2183  *  GLFW_PLATFORM_ERROR.
   2184  *
   2185  *  @remark @macos This function will change the current directory of the
   2186  *  application to the `Contents/Resources` subdirectory of the application's
   2187  *  bundle, if present.  This can be disabled with the @ref
   2188  *  GLFW_COCOA_CHDIR_RESOURCES init hint.
   2189  *
   2190  *  @remark @macos This function will create the main menu and dock icon for the
   2191  *  application.  If GLFW finds a `MainMenu.nib` it is loaded and assumed to
   2192  *  contain a menu bar.  Otherwise a minimal menu bar is created manually with
   2193  *  common commands like Hide, Quit and About.  The About entry opens a minimal
   2194  *  about dialog with information from the application's bundle.  The menu bar
   2195  *  and dock icon can be disabled entirely with the @ref GLFW_COCOA_MENUBAR init
   2196  *  hint.
   2197  *
   2198  *  @remark __Wayland, X11:__ If the library was compiled with support for both
   2199  *  Wayland and X11, and the @ref GLFW_PLATFORM init hint is set to
   2200  *  `GLFW_ANY_PLATFORM`, the `XDG_SESSION_TYPE` environment variable affects
   2201  *  which platform is picked.  If the environment variable is not set, or is set
   2202  *  to something other than `wayland` or `x11`, the regular detection mechanism
   2203  *  will be used instead.
   2204  *
   2205  *  @remark @x11 This function will set the `LC_CTYPE` category of the
   2206  *  application locale according to the current environment if that category is
   2207  *  still "C".  This is because the "C" locale breaks Unicode text input.
   2208  *
   2209  *  @thread_safety This function must only be called from the main thread.
   2210  *
   2211  *  @sa @ref intro_init
   2212  *  @sa @ref glfwInitHint
   2213  *  @sa @ref glfwInitAllocator
   2214  *  @sa @ref glfwTerminate
   2215  *
   2216  *  @since Added in version 1.0.
   2217  *
   2218  *  @ingroup init
   2219  */
   2220 GLFWAPI int glfwInit(void);
   2221 
   2222 /*! @brief Terminates the GLFW library.
   2223  *
   2224  *  This function destroys all remaining windows and cursors, restores any
   2225  *  modified gamma ramps and frees any other allocated resources.  Once this
   2226  *  function is called, you must again call @ref glfwInit successfully before
   2227  *  you will be able to use most GLFW functions.
   2228  *
   2229  *  If GLFW has been successfully initialized, this function should be called
   2230  *  before the application exits.  If initialization fails, there is no need to
   2231  *  call this function, as it is called by @ref glfwInit before it returns
   2232  *  failure.
   2233  *
   2234  *  This function has no effect if GLFW is not initialized.
   2235  *
   2236  *  @errors Possible errors include @ref GLFW_PLATFORM_ERROR.
   2237  *
   2238  *  @remark This function may be called before @ref glfwInit.
   2239  *
   2240  *  @warning The contexts of any remaining windows must not be current on any
   2241  *  other thread when this function is called.
   2242  *
   2243  *  @reentrancy This function must not be called from a callback.
   2244  *
   2245  *  @thread_safety This function must only be called from the main thread.
   2246  *
   2247  *  @sa @ref intro_init
   2248  *  @sa @ref glfwInit
   2249  *
   2250  *  @since Added in version 1.0.
   2251  *
   2252  *  @ingroup init
   2253  */
   2254 GLFWAPI void glfwTerminate(void);
   2255 
   2256 /*! @brief Sets the specified init hint to the desired value.
   2257  *
   2258  *  This function sets hints for the next initialization of GLFW.
   2259  *
   2260  *  The values you set hints to are never reset by GLFW, but they only take
   2261  *  effect during initialization.  Once GLFW has been initialized, any values
   2262  *  you set will be ignored until the library is terminated and initialized
   2263  *  again.
   2264  *
   2265  *  Some hints are platform specific.  These may be set on any platform but they
   2266  *  will only affect their specific platform.  Other platforms will ignore them.
   2267  *  Setting these hints requires no platform specific headers or functions.
   2268  *
   2269  *  @param[in] hint The [init hint](@ref init_hints) to set.
   2270  *  @param[in] value The new value of the init hint.
   2271  *
   2272  *  @errors Possible errors include @ref GLFW_INVALID_ENUM and @ref
   2273  *  GLFW_INVALID_VALUE.
   2274  *
   2275  *  @remarks This function may be called before @ref glfwInit.
   2276  *
   2277  *  @thread_safety This function must only be called from the main thread.
   2278  *
   2279  *  @sa init_hints
   2280  *  @sa glfwInit
   2281  *
   2282  *  @since Added in version 3.3.
   2283  *
   2284  *  @ingroup init
   2285  */
   2286 GLFWAPI void glfwInitHint(int hint, int value);
   2287 
   2288 /*! @brief Sets the init allocator to the desired value.
   2289  *
   2290  *  To use the default allocator, call this function with a `NULL` argument.
   2291  *
   2292  *  If you specify an allocator struct, every member must be a valid function
   2293  *  pointer.  If any member is `NULL`, this function will emit @ref
   2294  *  GLFW_INVALID_VALUE and the init allocator will be unchanged.
   2295  *
   2296  *  The functions in the allocator must fulfil a number of requirements.  See the
   2297  *  documentation for @ref GLFWallocatefun, @ref GLFWreallocatefun and @ref
   2298  *  GLFWdeallocatefun for details.
   2299  *
   2300  *  @param[in] allocator The allocator to use at the next initialization, or
   2301  *  `NULL` to use the default one.
   2302  *
   2303  *  @errors Possible errors include @ref GLFW_INVALID_VALUE.
   2304  *
   2305  *  @pointer_lifetime The specified allocator is copied before this function
   2306  *  returns.
   2307  *
   2308  *  @thread_safety This function must only be called from the main thread.
   2309  *
   2310  *  @sa @ref init_allocator
   2311  *  @sa @ref glfwInit
   2312  *
   2313  *  @since Added in version 3.4.
   2314  *
   2315  *  @ingroup init
   2316  */
   2317 GLFWAPI void glfwInitAllocator(const GLFWallocator* allocator);
   2318 
   2319 #if defined(VK_VERSION_1_0)
   2320 
   2321 /*! @brief Sets the desired Vulkan `vkGetInstanceProcAddr` function.
   2322  *
   2323  *  This function sets the `vkGetInstanceProcAddr` function that GLFW will use for all
   2324  *  Vulkan related entry point queries.
   2325  *
   2326  *  This feature is mostly useful on macOS, if your copy of the Vulkan loader is in
   2327  *  a location where GLFW cannot find it through dynamic loading, or if you are still
   2328  *  using the static library version of the loader.
   2329  *
   2330  *  If set to `NULL`, GLFW will try to load the Vulkan loader dynamically by its standard
   2331  *  name and get this function from there.  This is the default behavior.
   2332  *
   2333  *  The standard name of the loader is `vulkan-1.dll` on Windows, `libvulkan.so.1` on
   2334  *  Linux and other Unix-like systems and `libvulkan.1.dylib` on macOS.  If your code is
   2335  *  also loading it via these names then you probably don't need to use this function.
   2336  *
   2337  *  The function address you set is never reset by GLFW, but it only takes effect during
   2338  *  initialization.  Once GLFW has been initialized, any updates will be ignored until the
   2339  *  library is terminated and initialized again.
   2340  *
   2341  *  @param[in] loader The address of the function to use, or `NULL`.
   2342  *
   2343  *  @par Loader function signature
   2344  *  @code
   2345  *  PFN_vkVoidFunction vkGetInstanceProcAddr(VkInstance instance, const char* name)
   2346  *  @endcode
   2347  *  For more information about this function, see the
   2348  *  [Vulkan Registry](https://www.khronos.org/registry/vulkan/).
   2349  *
   2350  *  @errors None.
   2351  *
   2352  *  @remark This function may be called before @ref glfwInit.
   2353  *
   2354  *  @thread_safety This function must only be called from the main thread.
   2355  *
   2356  *  @sa @ref vulkan_loader
   2357  *  @sa @ref glfwInit
   2358  *
   2359  *  @since Added in version 3.4.
   2360  *
   2361  *  @ingroup init
   2362  */
   2363 GLFWAPI void glfwInitVulkanLoader(PFN_vkGetInstanceProcAddr loader);
   2364 
   2365 #endif /*VK_VERSION_1_0*/
   2366 
   2367 /*! @brief Retrieves the version of the GLFW library.
   2368  *
   2369  *  This function retrieves the major, minor and revision numbers of the GLFW
   2370  *  library.  It is intended for when you are using GLFW as a shared library and
   2371  *  want to ensure that you are using the minimum required version.
   2372  *
   2373  *  Any or all of the version arguments may be `NULL`.
   2374  *
   2375  *  @param[out] major Where to store the major version number, or `NULL`.
   2376  *  @param[out] minor Where to store the minor version number, or `NULL`.
   2377  *  @param[out] rev Where to store the revision number, or `NULL`.
   2378  *
   2379  *  @errors None.
   2380  *
   2381  *  @remark This function may be called before @ref glfwInit.
   2382  *
   2383  *  @thread_safety This function may be called from any thread.
   2384  *
   2385  *  @sa @ref intro_version
   2386  *  @sa @ref glfwGetVersionString
   2387  *
   2388  *  @since Added in version 1.0.
   2389  *
   2390  *  @ingroup init
   2391  */
   2392 GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);
   2393 
   2394 /*! @brief Returns a string describing the compile-time configuration.
   2395  *
   2396  *  This function returns the compile-time generated
   2397  *  [version string](@ref intro_version_string) of the GLFW library binary.  It describes
   2398  *  the version, platforms, compiler and any platform or operating system specific
   2399  *  compile-time options.  It should not be confused with the OpenGL or OpenGL ES version
   2400  *  string, queried with `glGetString`.
   2401  *
   2402  *  __Do not use the version string__ to parse the GLFW library version.  The
   2403  *  @ref glfwGetVersion function provides the version of the running library
   2404  *  binary in numerical format.
   2405  *
   2406  *  __Do not use the version string__ to parse what platforms are supported.  The @ref
   2407  *  glfwPlatformSupported function lets you query platform support.
   2408  *
   2409  *  @return The ASCII encoded GLFW version string.
   2410  *
   2411  *  @errors None.
   2412  *
   2413  *  @remark This function may be called before @ref glfwInit.
   2414  *
   2415  *  @pointer_lifetime The returned string is static and compile-time generated.
   2416  *
   2417  *  @thread_safety This function may be called from any thread.
   2418  *
   2419  *  @sa @ref intro_version
   2420  *  @sa @ref glfwGetVersion
   2421  *
   2422  *  @since Added in version 3.0.
   2423  *
   2424  *  @ingroup init
   2425  */
   2426 GLFWAPI const char* glfwGetVersionString(void);
   2427 
   2428 /*! @brief Returns and clears the last error for the calling thread.
   2429  *
   2430  *  This function returns and clears the [error code](@ref errors) of the last
   2431  *  error that occurred on the calling thread, and optionally a UTF-8 encoded
   2432  *  human-readable description of it.  If no error has occurred since the last
   2433  *  call, it returns @ref GLFW_NO_ERROR (zero) and the description pointer is
   2434  *  set to `NULL`.
   2435  *
   2436  *  @param[in] description Where to store the error description pointer, or `NULL`.
   2437  *  @return The last error code for the calling thread, or @ref GLFW_NO_ERROR
   2438  *  (zero).
   2439  *
   2440  *  @errors None.
   2441  *
   2442  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   2443  *  should not free it yourself.  It is guaranteed to be valid only until the
   2444  *  next error occurs or the library is terminated.
   2445  *
   2446  *  @remark This function may be called before @ref glfwInit.
   2447  *
   2448  *  @thread_safety This function may be called from any thread.
   2449  *
   2450  *  @sa @ref error_handling
   2451  *  @sa @ref glfwSetErrorCallback
   2452  *
   2453  *  @since Added in version 3.3.
   2454  *
   2455  *  @ingroup init
   2456  */
   2457 GLFWAPI int glfwGetError(const char** description);
   2458 
   2459 /*! @brief Sets the error callback.
   2460  *
   2461  *  This function sets the error callback, which is called with an error code
   2462  *  and a human-readable description each time a GLFW error occurs.
   2463  *
   2464  *  The error code is set before the callback is called.  Calling @ref
   2465  *  glfwGetError from the error callback will return the same value as the error
   2466  *  code argument.
   2467  *
   2468  *  The error callback is called on the thread where the error occurred.  If you
   2469  *  are using GLFW from multiple threads, your error callback needs to be
   2470  *  written accordingly.
   2471  *
   2472  *  Because the description string may have been generated specifically for that
   2473  *  error, it is not guaranteed to be valid after the callback has returned.  If
   2474  *  you wish to use it after the callback returns, you need to make a copy.
   2475  *
   2476  *  Once set, the error callback remains set even after the library has been
   2477  *  terminated.
   2478  *
   2479  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   2480  *  callback.
   2481  *  @return The previously set callback, or `NULL` if no callback was set.
   2482  *
   2483  *  @callback_signature
   2484  *  @code
   2485  *  void callback_name(int error_code, const char* description)
   2486  *  @endcode
   2487  *  For more information about the callback parameters, see the
   2488  *  [callback pointer type](@ref GLFWerrorfun).
   2489  *
   2490  *  @errors None.
   2491  *
   2492  *  @remark This function may be called before @ref glfwInit.
   2493  *
   2494  *  @thread_safety This function must only be called from the main thread.
   2495  *
   2496  *  @sa @ref error_handling
   2497  *  @sa @ref glfwGetError
   2498  *
   2499  *  @since Added in version 3.0.
   2500  *
   2501  *  @ingroup init
   2502  */
   2503 GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback);
   2504 
   2505 /*! @brief Returns the currently selected platform.
   2506  *
   2507  *  This function returns the platform that was selected during initialization.  The
   2508  *  returned value will be one of `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`,
   2509  *  `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` or `GLFW_PLATFORM_NULL`.
   2510  *
   2511  *  @return The currently selected platform, or zero if an error occurred.
   2512  *
   2513  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   2514  *
   2515  *  @thread_safety This function may be called from any thread.
   2516  *
   2517  *  @sa @ref platform
   2518  *  @sa @ref glfwPlatformSupported
   2519  *
   2520  *  @since Added in version 3.4.
   2521  *
   2522  *  @ingroup init
   2523  */
   2524 GLFWAPI int glfwGetPlatform(void);
   2525 
   2526 /*! @brief Returns whether the library includes support for the specified platform.
   2527  *
   2528  *  This function returns whether the library was compiled with support for the specified
   2529  *  platform.  The platform must be one of `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`,
   2530  *  `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` or `GLFW_PLATFORM_NULL`.
   2531  *
   2532  *  @param[in] platform The platform to query.
   2533  *  @return `GLFW_TRUE` if the platform is supported, or `GLFW_FALSE` otherwise.
   2534  *
   2535  *  @errors Possible errors include @ref GLFW_INVALID_ENUM.
   2536  *
   2537  *  @remark This function may be called before @ref glfwInit.
   2538  *
   2539  *  @thread_safety This function may be called from any thread.
   2540  *
   2541  *  @sa @ref platform
   2542  *  @sa @ref glfwGetPlatform
   2543  *
   2544  *  @since Added in version 3.4.
   2545  *
   2546  *  @ingroup init
   2547  */
   2548 GLFWAPI int glfwPlatformSupported(int platform);
   2549 
   2550 /*! @brief Returns the currently connected monitors.
   2551  *
   2552  *  This function returns an array of handles for all currently connected
   2553  *  monitors.  The primary monitor is always first in the returned array.  If no
   2554  *  monitors were found, this function returns `NULL`.
   2555  *
   2556  *  @param[out] count Where to store the number of monitors in the returned
   2557  *  array.  This is set to zero if an error occurred.
   2558  *  @return An array of monitor handles, or `NULL` if no monitors were found or
   2559  *  if an [error](@ref error_handling) occurred.
   2560  *
   2561  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   2562  *
   2563  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   2564  *  should not free it yourself.  It is guaranteed to be valid only until the
   2565  *  monitor configuration changes or the library is terminated.
   2566  *
   2567  *  @thread_safety This function must only be called from the main thread.
   2568  *
   2569  *  @sa @ref monitor_monitors
   2570  *  @sa @ref monitor_event
   2571  *  @sa @ref glfwGetPrimaryMonitor
   2572  *
   2573  *  @since Added in version 3.0.
   2574  *
   2575  *  @ingroup monitor
   2576  */
   2577 GLFWAPI GLFWmonitor** glfwGetMonitors(int* count);
   2578 
   2579 /*! @brief Returns the primary monitor.
   2580  *
   2581  *  This function returns the primary monitor.  This is usually the monitor
   2582  *  where elements like the task bar or global menu bar are located.
   2583  *
   2584  *  @return The primary monitor, or `NULL` if no monitors were found or if an
   2585  *  [error](@ref error_handling) occurred.
   2586  *
   2587  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   2588  *
   2589  *  @thread_safety This function must only be called from the main thread.
   2590  *
   2591  *  @remark The primary monitor is always first in the array returned by @ref
   2592  *  glfwGetMonitors.
   2593  *
   2594  *  @sa @ref monitor_monitors
   2595  *  @sa @ref glfwGetMonitors
   2596  *
   2597  *  @since Added in version 3.0.
   2598  *
   2599  *  @ingroup monitor
   2600  */
   2601 GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void);
   2602 
   2603 /*! @brief Returns the position of the monitor's viewport on the virtual screen.
   2604  *
   2605  *  This function returns the position, in screen coordinates, of the upper-left
   2606  *  corner of the specified monitor.
   2607  *
   2608  *  Any or all of the position arguments may be `NULL`.  If an error occurs, all
   2609  *  non-`NULL` position arguments will be set to zero.
   2610  *
   2611  *  @param[in] monitor The monitor to query.
   2612  *  @param[out] xpos Where to store the monitor x-coordinate, or `NULL`.
   2613  *  @param[out] ypos Where to store the monitor y-coordinate, or `NULL`.
   2614  *
   2615  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2616  *  GLFW_PLATFORM_ERROR.
   2617  *
   2618  *  @thread_safety This function must only be called from the main thread.
   2619  *
   2620  *  @sa @ref monitor_properties
   2621  *
   2622  *  @since Added in version 3.0.
   2623  *
   2624  *  @ingroup monitor
   2625  */
   2626 GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);
   2627 
   2628 /*! @brief Retrieves the work area of the monitor.
   2629  *
   2630  *  This function returns the position, in screen coordinates, of the upper-left
   2631  *  corner of the work area of the specified monitor along with the work area
   2632  *  size in screen coordinates. The work area is defined as the area of the
   2633  *  monitor not occluded by the window system task bar where present. If no
   2634  *  task bar exists then the work area is the monitor resolution in screen
   2635  *  coordinates.
   2636  *
   2637  *  Any or all of the position and size arguments may be `NULL`.  If an error
   2638  *  occurs, all non-`NULL` position and size arguments will be set to zero.
   2639  *
   2640  *  @param[in] monitor The monitor to query.
   2641  *  @param[out] xpos Where to store the monitor x-coordinate, or `NULL`.
   2642  *  @param[out] ypos Where to store the monitor y-coordinate, or `NULL`.
   2643  *  @param[out] width Where to store the monitor width, or `NULL`.
   2644  *  @param[out] height Where to store the monitor height, or `NULL`.
   2645  *
   2646  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2647  *  GLFW_PLATFORM_ERROR.
   2648  *
   2649  *  @thread_safety This function must only be called from the main thread.
   2650  *
   2651  *  @sa @ref monitor_workarea
   2652  *
   2653  *  @since Added in version 3.3.
   2654  *
   2655  *  @ingroup monitor
   2656  */
   2657 GLFWAPI void glfwGetMonitorWorkarea(GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height);
   2658 
   2659 /*! @brief Returns the physical size of the monitor.
   2660  *
   2661  *  This function returns the size, in millimetres, of the display area of the
   2662  *  specified monitor.
   2663  *
   2664  *  Some platforms do not provide accurate monitor size information, either
   2665  *  because the monitor [EDID][] data is incorrect or because the driver does
   2666  *  not report it accurately.
   2667  *
   2668  *  [EDID]: https://en.wikipedia.org/wiki/Extended_display_identification_data
   2669  *
   2670  *  Any or all of the size arguments may be `NULL`.  If an error occurs, all
   2671  *  non-`NULL` size arguments will be set to zero.
   2672  *
   2673  *  @param[in] monitor The monitor to query.
   2674  *  @param[out] widthMM Where to store the width, in millimetres, of the
   2675  *  monitor's display area, or `NULL`.
   2676  *  @param[out] heightMM Where to store the height, in millimetres, of the
   2677  *  monitor's display area, or `NULL`.
   2678  *
   2679  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   2680  *
   2681  *  @remark @win32 On Windows 8 and earlier the physical size is calculated from
   2682  *  the current resolution and system DPI instead of querying the monitor EDID data.
   2683  *
   2684  *  @thread_safety This function must only be called from the main thread.
   2685  *
   2686  *  @sa @ref monitor_properties
   2687  *
   2688  *  @since Added in version 3.0.
   2689  *
   2690  *  @ingroup monitor
   2691  */
   2692 GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* widthMM, int* heightMM);
   2693 
   2694 /*! @brief Retrieves the content scale for the specified monitor.
   2695  *
   2696  *  This function retrieves the content scale for the specified monitor.  The
   2697  *  content scale is the ratio between the current DPI and the platform's
   2698  *  default DPI.  This is especially important for text and any UI elements.  If
   2699  *  the pixel dimensions of your UI scaled by this look appropriate on your
   2700  *  machine then it should appear at a reasonable size on other machines
   2701  *  regardless of their DPI and scaling settings.  This relies on the system DPI
   2702  *  and scaling settings being somewhat correct.
   2703  *
   2704  *  The content scale may depend on both the monitor resolution and pixel
   2705  *  density and on user settings.  It may be very different from the raw DPI
   2706  *  calculated from the physical size and current resolution.
   2707  *
   2708  *  @param[in] monitor The monitor to query.
   2709  *  @param[out] xscale Where to store the x-axis content scale, or `NULL`.
   2710  *  @param[out] yscale Where to store the y-axis content scale, or `NULL`.
   2711  *
   2712  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2713  *  GLFW_PLATFORM_ERROR.
   2714  *
   2715  *  @remark @wayland Fractional scaling information is not yet available for
   2716  *  monitors, so this function only returns integer content scales.
   2717  *
   2718  *  @thread_safety This function must only be called from the main thread.
   2719  *
   2720  *  @sa @ref monitor_scale
   2721  *  @sa @ref glfwGetWindowContentScale
   2722  *
   2723  *  @since Added in version 3.3.
   2724  *
   2725  *  @ingroup monitor
   2726  */
   2727 GLFWAPI void glfwGetMonitorContentScale(GLFWmonitor* monitor, float* xscale, float* yscale);
   2728 
   2729 /*! @brief Returns the name of the specified monitor.
   2730  *
   2731  *  This function returns a human-readable name, encoded as UTF-8, of the
   2732  *  specified monitor.  The name typically reflects the make and model of the
   2733  *  monitor and is not guaranteed to be unique among the connected monitors.
   2734  *
   2735  *  @param[in] monitor The monitor to query.
   2736  *  @return The UTF-8 encoded name of the monitor, or `NULL` if an
   2737  *  [error](@ref error_handling) occurred.
   2738  *
   2739  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   2740  *
   2741  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   2742  *  should not free it yourself.  It is valid until the specified monitor is
   2743  *  disconnected or the library is terminated.
   2744  *
   2745  *  @thread_safety This function must only be called from the main thread.
   2746  *
   2747  *  @sa @ref monitor_properties
   2748  *
   2749  *  @since Added in version 3.0.
   2750  *
   2751  *  @ingroup monitor
   2752  */
   2753 GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor);
   2754 
   2755 /*! @brief Sets the user pointer of the specified monitor.
   2756  *
   2757  *  This function sets the user-defined pointer of the specified monitor.  The
   2758  *  current value is retained until the monitor is disconnected.  The initial
   2759  *  value is `NULL`.
   2760  *
   2761  *  This function may be called from the monitor callback, even for a monitor
   2762  *  that is being disconnected.
   2763  *
   2764  *  @param[in] monitor The monitor whose pointer to set.
   2765  *  @param[in] pointer The new value.
   2766  *
   2767  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   2768  *
   2769  *  @thread_safety This function may be called from any thread.  Access is not
   2770  *  synchronized.
   2771  *
   2772  *  @sa @ref monitor_userptr
   2773  *  @sa @ref glfwGetMonitorUserPointer
   2774  *
   2775  *  @since Added in version 3.3.
   2776  *
   2777  *  @ingroup monitor
   2778  */
   2779 GLFWAPI void glfwSetMonitorUserPointer(GLFWmonitor* monitor, void* pointer);
   2780 
   2781 /*! @brief Returns the user pointer of the specified monitor.
   2782  *
   2783  *  This function returns the current value of the user-defined pointer of the
   2784  *  specified monitor.  The initial value is `NULL`.
   2785  *
   2786  *  This function may be called from the monitor callback, even for a monitor
   2787  *  that is being disconnected.
   2788  *
   2789  *  @param[in] monitor The monitor whose pointer to return.
   2790  *
   2791  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   2792  *
   2793  *  @thread_safety This function may be called from any thread.  Access is not
   2794  *  synchronized.
   2795  *
   2796  *  @sa @ref monitor_userptr
   2797  *  @sa @ref glfwSetMonitorUserPointer
   2798  *
   2799  *  @since Added in version 3.3.
   2800  *
   2801  *  @ingroup monitor
   2802  */
   2803 GLFWAPI void* glfwGetMonitorUserPointer(GLFWmonitor* monitor);
   2804 
   2805 /*! @brief Sets the monitor configuration callback.
   2806  *
   2807  *  This function sets the monitor configuration callback, or removes the
   2808  *  currently set callback.  This is called when a monitor is connected to or
   2809  *  disconnected from the system.
   2810  *
   2811  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   2812  *  callback.
   2813  *  @return The previously set callback, or `NULL` if no callback was set or the
   2814  *  library had not been [initialized](@ref intro_init).
   2815  *
   2816  *  @callback_signature
   2817  *  @code
   2818  *  void function_name(GLFWmonitor* monitor, int event)
   2819  *  @endcode
   2820  *  For more information about the callback parameters, see the
   2821  *  [function pointer type](@ref GLFWmonitorfun).
   2822  *
   2823  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   2824  *
   2825  *  @thread_safety This function must only be called from the main thread.
   2826  *
   2827  *  @sa @ref monitor_event
   2828  *
   2829  *  @since Added in version 3.0.
   2830  *
   2831  *  @ingroup monitor
   2832  */
   2833 GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback);
   2834 
   2835 /*! @brief Returns the available video modes for the specified monitor.
   2836  *
   2837  *  This function returns an array of all video modes supported by the specified
   2838  *  monitor.  The returned array is sorted in ascending order, first by color
   2839  *  bit depth (the sum of all channel depths), then by resolution area (the
   2840  *  product of width and height), then resolution width and finally by refresh
   2841  *  rate.
   2842  *
   2843  *  @param[in] monitor The monitor to query.
   2844  *  @param[out] count Where to store the number of video modes in the returned
   2845  *  array.  This is set to zero if an error occurred.
   2846  *  @return An array of video modes, or `NULL` if an
   2847  *  [error](@ref error_handling) occurred.
   2848  *
   2849  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2850  *  GLFW_PLATFORM_ERROR.
   2851  *
   2852  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   2853  *  should not free it yourself.  It is valid until the specified monitor is
   2854  *  disconnected, this function is called again for that monitor or the library
   2855  *  is terminated.
   2856  *
   2857  *  @thread_safety This function must only be called from the main thread.
   2858  *
   2859  *  @sa @ref monitor_modes
   2860  *  @sa @ref glfwGetVideoMode
   2861  *
   2862  *  @since Added in version 1.0.
   2863  *  @glfw3 Changed to return an array of modes for a specific monitor.
   2864  *
   2865  *  @ingroup monitor
   2866  */
   2867 GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count);
   2868 
   2869 /*! @brief Returns the current mode of the specified monitor.
   2870  *
   2871  *  This function returns the current video mode of the specified monitor.  If
   2872  *  you have created a full screen window for that monitor, the return value
   2873  *  will depend on whether that window is iconified.
   2874  *
   2875  *  @param[in] monitor The monitor to query.
   2876  *  @return The current mode of the monitor, or `NULL` if an
   2877  *  [error](@ref error_handling) occurred.
   2878  *
   2879  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   2880  *  GLFW_PLATFORM_ERROR.
   2881  *
   2882  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   2883  *  should not free it yourself.  It is valid until the specified monitor is
   2884  *  disconnected or the library is terminated.
   2885  *
   2886  *  @thread_safety This function must only be called from the main thread.
   2887  *
   2888  *  @sa @ref monitor_modes
   2889  *  @sa @ref glfwGetVideoModes
   2890  *
   2891  *  @since Added in version 3.0.  Replaces `glfwGetDesktopMode`.
   2892  *
   2893  *  @ingroup monitor
   2894  */
   2895 GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
   2896 
   2897 /*! @brief Generates a gamma ramp and sets it for the specified monitor.
   2898  *
   2899  *  This function generates an appropriately sized gamma ramp from the specified
   2900  *  exponent and then calls @ref glfwSetGammaRamp with it.  The value must be
   2901  *  a finite number greater than zero.
   2902  *
   2903  *  The software controlled gamma ramp is applied _in addition_ to the hardware
   2904  *  gamma correction, which today is usually an approximation of sRGB gamma.
   2905  *  This means that setting a perfectly linear ramp, or gamma 1.0, will produce
   2906  *  the default (usually sRGB-like) behavior.
   2907  *
   2908  *  For gamma correct rendering with OpenGL or OpenGL ES, see the @ref
   2909  *  GLFW_SRGB_CAPABLE hint.
   2910  *
   2911  *  @param[in] monitor The monitor whose gamma ramp to set.
   2912  *  @param[in] gamma The desired exponent.
   2913  *
   2914  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_INVALID_VALUE,
   2915  *  @ref GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
   2916  *
   2917  *  @remark @wayland Gamma handling is a privileged protocol, this function
   2918  *  will thus never be implemented and emits @ref GLFW_FEATURE_UNAVAILABLE.
   2919  *
   2920  *  @thread_safety This function must only be called from the main thread.
   2921  *
   2922  *  @sa @ref monitor_gamma
   2923  *
   2924  *  @since Added in version 3.0.
   2925  *
   2926  *  @ingroup monitor
   2927  */
   2928 GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma);
   2929 
   2930 /*! @brief Returns the current gamma ramp for the specified monitor.
   2931  *
   2932  *  This function returns the current gamma ramp of the specified monitor.
   2933  *
   2934  *  @param[in] monitor The monitor to query.
   2935  *  @return The current gamma ramp, or `NULL` if an
   2936  *  [error](@ref error_handling) occurred.
   2937  *
   2938  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_PLATFORM_ERROR
   2939  *  and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
   2940  *
   2941  *  @remark @wayland Gamma handling is a privileged protocol, this function
   2942  *  will thus never be implemented and emits @ref GLFW_FEATURE_UNAVAILABLE while
   2943  *  returning `NULL`.
   2944  *
   2945  *  @pointer_lifetime The returned structure and its arrays are allocated and
   2946  *  freed by GLFW.  You should not free them yourself.  They are valid until the
   2947  *  specified monitor is disconnected, this function is called again for that
   2948  *  monitor or the library is terminated.
   2949  *
   2950  *  @thread_safety This function must only be called from the main thread.
   2951  *
   2952  *  @sa @ref monitor_gamma
   2953  *
   2954  *  @since Added in version 3.0.
   2955  *
   2956  *  @ingroup monitor
   2957  */
   2958 GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor);
   2959 
   2960 /*! @brief Sets the current gamma ramp for the specified monitor.
   2961  *
   2962  *  This function sets the current gamma ramp for the specified monitor.  The
   2963  *  original gamma ramp for that monitor is saved by GLFW the first time this
   2964  *  function is called and is restored by @ref glfwTerminate.
   2965  *
   2966  *  The software controlled gamma ramp is applied _in addition_ to the hardware
   2967  *  gamma correction, which today is usually an approximation of sRGB gamma.
   2968  *  This means that setting a perfectly linear ramp, or gamma 1.0, will produce
   2969  *  the default (usually sRGB-like) behavior.
   2970  *
   2971  *  For gamma correct rendering with OpenGL or OpenGL ES, see the @ref
   2972  *  GLFW_SRGB_CAPABLE hint.
   2973  *
   2974  *  @param[in] monitor The monitor whose gamma ramp to set.
   2975  *  @param[in] ramp The gamma ramp to use.
   2976  *
   2977  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_PLATFORM_ERROR
   2978  *  and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
   2979  *
   2980  *  @remark The size of the specified gamma ramp should match the size of the
   2981  *  current ramp for that monitor.
   2982  *
   2983  *  @remark @win32 The gamma ramp size must be 256.
   2984  *
   2985  *  @remark @wayland Gamma handling is a privileged protocol, this function
   2986  *  will thus never be implemented and emits @ref GLFW_FEATURE_UNAVAILABLE.
   2987  *
   2988  *  @pointer_lifetime The specified gamma ramp is copied before this function
   2989  *  returns.
   2990  *
   2991  *  @thread_safety This function must only be called from the main thread.
   2992  *
   2993  *  @sa @ref monitor_gamma
   2994  *
   2995  *  @since Added in version 3.0.
   2996  *
   2997  *  @ingroup monitor
   2998  */
   2999 GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp);
   3000 
   3001 /*! @brief Resets all window hints to their default values.
   3002  *
   3003  *  This function resets all window hints to their
   3004  *  [default values](@ref window_hints_values).
   3005  *
   3006  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3007  *
   3008  *  @thread_safety This function must only be called from the main thread.
   3009  *
   3010  *  @sa @ref window_hints
   3011  *  @sa @ref glfwWindowHint
   3012  *  @sa @ref glfwWindowHintString
   3013  *
   3014  *  @since Added in version 3.0.
   3015  *
   3016  *  @ingroup window
   3017  */
   3018 GLFWAPI void glfwDefaultWindowHints(void);
   3019 
   3020 /*! @brief Sets the specified window hint to the desired value.
   3021  *
   3022  *  This function sets hints for the next call to @ref glfwCreateWindow.  The
   3023  *  hints, once set, retain their values until changed by a call to this
   3024  *  function or @ref glfwDefaultWindowHints, or until the library is terminated.
   3025  *
   3026  *  Only integer value hints can be set with this function.  String value hints
   3027  *  are set with @ref glfwWindowHintString.
   3028  *
   3029  *  This function does not check whether the specified hint values are valid.
   3030  *  If you set hints to invalid values this will instead be reported by the next
   3031  *  call to @ref glfwCreateWindow.
   3032  *
   3033  *  Some hints are platform specific.  These may be set on any platform but they
   3034  *  will only affect their specific platform.  Other platforms will ignore them.
   3035  *  Setting these hints requires no platform specific headers or functions.
   3036  *
   3037  *  @param[in] hint The [window hint](@ref window_hints) to set.
   3038  *  @param[in] value The new value of the window hint.
   3039  *
   3040  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3041  *  GLFW_INVALID_ENUM.
   3042  *
   3043  *  @thread_safety This function must only be called from the main thread.
   3044  *
   3045  *  @sa @ref window_hints
   3046  *  @sa @ref glfwWindowHintString
   3047  *  @sa @ref glfwDefaultWindowHints
   3048  *
   3049  *  @since Added in version 3.0.  Replaces `glfwOpenWindowHint`.
   3050  *
   3051  *  @ingroup window
   3052  */
   3053 GLFWAPI void glfwWindowHint(int hint, int value);
   3054 
   3055 /*! @brief Sets the specified window hint to the desired value.
   3056  *
   3057  *  This function sets hints for the next call to @ref glfwCreateWindow.  The
   3058  *  hints, once set, retain their values until changed by a call to this
   3059  *  function or @ref glfwDefaultWindowHints, or until the library is terminated.
   3060  *
   3061  *  Only string type hints can be set with this function.  Integer value hints
   3062  *  are set with @ref glfwWindowHint.
   3063  *
   3064  *  This function does not check whether the specified hint values are valid.
   3065  *  If you set hints to invalid values this will instead be reported by the next
   3066  *  call to @ref glfwCreateWindow.
   3067  *
   3068  *  Some hints are platform specific.  These may be set on any platform but they
   3069  *  will only affect their specific platform.  Other platforms will ignore them.
   3070  *  Setting these hints requires no platform specific headers or functions.
   3071  *
   3072  *  @param[in] hint The [window hint](@ref window_hints) to set.
   3073  *  @param[in] value The new value of the window hint.
   3074  *
   3075  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3076  *  GLFW_INVALID_ENUM.
   3077  *
   3078  *  @pointer_lifetime The specified string is copied before this function
   3079  *  returns.
   3080  *
   3081  *  @thread_safety This function must only be called from the main thread.
   3082  *
   3083  *  @sa @ref window_hints
   3084  *  @sa @ref glfwWindowHint
   3085  *  @sa @ref glfwDefaultWindowHints
   3086  *
   3087  *  @since Added in version 3.3.
   3088  *
   3089  *  @ingroup window
   3090  */
   3091 GLFWAPI void glfwWindowHintString(int hint, const char* value);
   3092 
   3093 /*! @brief Creates a window and its associated context.
   3094  *
   3095  *  This function creates a window and its associated OpenGL or OpenGL ES
   3096  *  context.  Most of the options controlling how the window and its context
   3097  *  should be created are specified with [window hints](@ref window_hints).
   3098  *
   3099  *  Successful creation does not change which context is current.  Before you
   3100  *  can use the newly created context, you need to
   3101  *  [make it current](@ref context_current).  For information about the `share`
   3102  *  parameter, see @ref context_sharing.
   3103  *
   3104  *  The created window, framebuffer and context may differ from what you
   3105  *  requested, as not all parameters and hints are
   3106  *  [hard constraints](@ref window_hints_hard).  This includes the size of the
   3107  *  window, especially for full screen windows.  To query the actual attributes
   3108  *  of the created window, framebuffer and context, see @ref
   3109  *  glfwGetWindowAttrib, @ref glfwGetWindowSize and @ref glfwGetFramebufferSize.
   3110  *
   3111  *  To create a full screen window, you need to specify the monitor the window
   3112  *  will cover.  If no monitor is specified, the window will be windowed mode.
   3113  *  Unless you have a way for the user to choose a specific monitor, it is
   3114  *  recommended that you pick the primary monitor.  For more information on how
   3115  *  to query connected monitors, see @ref monitor_monitors.
   3116  *
   3117  *  For full screen windows, the specified size becomes the resolution of the
   3118  *  window's _desired video mode_.  As long as a full screen window is not
   3119  *  iconified, the supported video mode most closely matching the desired video
   3120  *  mode is set for the specified monitor.  For more information about full
   3121  *  screen windows, including the creation of so called _windowed full screen_
   3122  *  or _borderless full screen_ windows, see @ref window_windowed_full_screen.
   3123  *
   3124  *  Once you have created the window, you can switch it between windowed and
   3125  *  full screen mode with @ref glfwSetWindowMonitor.  This will not affect its
   3126  *  OpenGL or OpenGL ES context.
   3127  *
   3128  *  By default, newly created windows use the placement recommended by the
   3129  *  window system.  To create the window at a specific position, set the @ref
   3130  *  GLFW_POSITION_X and @ref GLFW_POSITION_Y window hints before creation.  To
   3131  *  restore the default behavior, set either or both hints back to
   3132  *  `GLFW_ANY_POSITION`.
   3133  *
   3134  *  As long as at least one full screen window is not iconified, the screensaver
   3135  *  is prohibited from starting.
   3136  *
   3137  *  Window systems put limits on window sizes.  Very large or very small window
   3138  *  dimensions may be overridden by the window system on creation.  Check the
   3139  *  actual [size](@ref window_size) after creation.
   3140  *
   3141  *  The [swap interval](@ref buffer_swap) is not set during window creation and
   3142  *  the initial value may vary depending on driver settings and defaults.
   3143  *
   3144  *  @param[in] width The desired width, in screen coordinates, of the window.
   3145  *  This must be greater than zero.
   3146  *  @param[in] height The desired height, in screen coordinates, of the window.
   3147  *  This must be greater than zero.
   3148  *  @param[in] title The initial, UTF-8 encoded window title.
   3149  *  @param[in] monitor The monitor to use for full screen mode, or `NULL` for
   3150  *  windowed mode.
   3151  *  @param[in] share The window whose context to share resources with, or `NULL`
   3152  *  to not share resources.
   3153  *  @return The handle of the created window, or `NULL` if an
   3154  *  [error](@ref error_handling) occurred.
   3155  *
   3156  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   3157  *  GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_API_UNAVAILABLE, @ref
   3158  *  GLFW_VERSION_UNAVAILABLE, @ref GLFW_FORMAT_UNAVAILABLE, @ref
   3159  *  GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
   3160  *
   3161  *  @remark @win32 Window creation will fail if the Microsoft GDI software
   3162  *  OpenGL implementation is the only one available.
   3163  *
   3164  *  @remark @win32 If the executable has an icon resource named `GLFW_ICON,` it
   3165  *  will be set as the initial icon for the window.  If no such icon is present,
   3166  *  the `IDI_APPLICATION` icon will be used instead.  To set a different icon,
   3167  *  see @ref glfwSetWindowIcon.
   3168  *
   3169  *  @remark @win32 The context to share resources with must not be current on
   3170  *  any other thread.
   3171  *
   3172  *  @remark @macos The OS only supports core profile contexts for OpenGL
   3173  *  versions 3.2 and later.  Before creating an OpenGL context of version 3.2 or
   3174  *  later you must set the [GLFW_OPENGL_PROFILE](@ref GLFW_OPENGL_PROFILE_hint)
   3175  *  hint accordingly.  OpenGL 3.0 and 3.1 contexts are not supported at all
   3176  *  on macOS.
   3177  *
   3178  *  @remark @macos The GLFW window has no icon, as it is not a document
   3179  *  window, but the dock icon will be the same as the application bundle's icon.
   3180  *  For more information on bundles, see the
   3181  *  [Bundle Programming Guide][bundle-guide] in the Mac Developer Library.
   3182  *
   3183  *  [bundle-guide]: https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/
   3184  *
   3185  *  @remark @macos On OS X 10.10 and later the window frame will not be rendered
   3186  *  at full resolution on Retina displays unless the
   3187  *  [GLFW_SCALE_FRAMEBUFFER](@ref GLFW_SCALE_FRAMEBUFFER_hint)
   3188  *  hint is `GLFW_TRUE` and the `NSHighResolutionCapable` key is enabled in the
   3189  *  application bundle's `Info.plist`.  For more information, see
   3190  *  [High Resolution Guidelines for OS X][hidpi-guide] in the Mac Developer
   3191  *  Library.  The GLFW test and example programs use a custom `Info.plist`
   3192  *  template for this, which can be found as `CMake/Info.plist.in` in the source
   3193  *  tree.
   3194  *
   3195  *  [hidpi-guide]: https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html
   3196  *
   3197  *  @remark @macos When activating frame autosaving with
   3198  *  [GLFW_COCOA_FRAME_NAME](@ref GLFW_COCOA_FRAME_NAME_hint), the specified
   3199  *  window size and position may be overridden by previously saved values.
   3200  *
   3201  *  @remark @wayland GLFW uses [libdecor][] where available to create its window
   3202  *  decorations.  This in turn uses server-side XDG decorations where available
   3203  *  and provides high quality client-side decorations on compositors like GNOME.
   3204  *  If both XDG decorations and libdecor are unavailable, GLFW falls back to
   3205  *  a very simple set of window decorations that only support moving, resizing
   3206  *  and the window manager's right-click menu.
   3207  *
   3208  *  [libdecor]: https://gitlab.freedesktop.org/libdecor/libdecor
   3209  *
   3210  *  @remark @x11 Some window managers will not respect the placement of
   3211  *  initially hidden windows.
   3212  *
   3213  *  @remark @x11 Due to the asynchronous nature of X11, it may take a moment for
   3214  *  a window to reach its requested state.  This means you may not be able to
   3215  *  query the final size, position or other attributes directly after window
   3216  *  creation.
   3217  *
   3218  *  @remark @x11 The class part of the `WM_CLASS` window property will by
   3219  *  default be set to the window title passed to this function.  The instance
   3220  *  part will use the contents of the `RESOURCE_NAME` environment variable, if
   3221  *  present and not empty, or fall back to the window title.  Set the
   3222  *  [GLFW_X11_CLASS_NAME](@ref GLFW_X11_CLASS_NAME_hint) and
   3223  *  [GLFW_X11_INSTANCE_NAME](@ref GLFW_X11_INSTANCE_NAME_hint) window hints to
   3224  *  override this.
   3225  *
   3226  *  @thread_safety This function must only be called from the main thread.
   3227  *
   3228  *  @sa @ref window_creation
   3229  *  @sa @ref glfwDestroyWindow
   3230  *
   3231  *  @since Added in version 3.0.  Replaces `glfwOpenWindow`.
   3232  *
   3233  *  @ingroup window
   3234  */
   3235 GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);
   3236 
   3237 /*! @brief Destroys the specified window and its context.
   3238  *
   3239  *  This function destroys the specified window and its context.  On calling
   3240  *  this function, no further callbacks will be called for that window.
   3241  *
   3242  *  If the context of the specified window is current on the main thread, it is
   3243  *  detached before being destroyed.
   3244  *
   3245  *  @param[in] window The window to destroy.
   3246  *
   3247  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3248  *  GLFW_PLATFORM_ERROR.
   3249  *
   3250  *  @note The context of the specified window must not be current on any other
   3251  *  thread when this function is called.
   3252  *
   3253  *  @reentrancy This function must not be called from a callback.
   3254  *
   3255  *  @thread_safety This function must only be called from the main thread.
   3256  *
   3257  *  @sa @ref window_creation
   3258  *  @sa @ref glfwCreateWindow
   3259  *
   3260  *  @since Added in version 3.0.  Replaces `glfwCloseWindow`.
   3261  *
   3262  *  @ingroup window
   3263  */
   3264 GLFWAPI void glfwDestroyWindow(GLFWwindow* window);
   3265 
   3266 /*! @brief Checks the close flag of the specified window.
   3267  *
   3268  *  This function returns the value of the close flag of the specified window.
   3269  *
   3270  *  @param[in] window The window to query.
   3271  *  @return The value of the close flag.
   3272  *
   3273  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3274  *
   3275  *  @thread_safety This function may be called from any thread.  Access is not
   3276  *  synchronized.
   3277  *
   3278  *  @sa @ref window_close
   3279  *
   3280  *  @since Added in version 3.0.
   3281  *
   3282  *  @ingroup window
   3283  */
   3284 GLFWAPI int glfwWindowShouldClose(GLFWwindow* window);
   3285 
   3286 /*! @brief Sets the close flag of the specified window.
   3287  *
   3288  *  This function sets the value of the close flag of the specified window.
   3289  *  This can be used to override the user's attempt to close the window, or
   3290  *  to signal that it should be closed.
   3291  *
   3292  *  @param[in] window The window whose flag to change.
   3293  *  @param[in] value The new value.
   3294  *
   3295  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3296  *
   3297  *  @thread_safety This function may be called from any thread.  Access is not
   3298  *  synchronized.
   3299  *
   3300  *  @sa @ref window_close
   3301  *
   3302  *  @since Added in version 3.0.
   3303  *
   3304  *  @ingroup window
   3305  */
   3306 GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value);
   3307 
   3308 /*! @brief Returns the title of the specified window.
   3309  *
   3310  *  This function returns the window title, encoded as UTF-8, of the specified
   3311  *  window.  This is the title set previously by @ref glfwCreateWindow
   3312  *  or @ref glfwSetWindowTitle.
   3313  *
   3314  *  @param[in] window The window to query.
   3315  *  @return The UTF-8 encoded window title, or `NULL` if an
   3316  *  [error](@ref error_handling) occurred.
   3317  *
   3318  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   3319  *
   3320  *  @remark The returned title is currently a copy of the title last set by @ref
   3321  *  glfwCreateWindow or @ref glfwSetWindowTitle.  It does not include any
   3322  *  additional text which may be appended by the platform or another program.
   3323  *
   3324  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   3325  *  should not free it yourself.  It is valid until the next call to @ref
   3326  *  glfwGetWindowTitle or @ref glfwSetWindowTitle, or until the library is
   3327  *  terminated.
   3328  *
   3329  *  @thread_safety This function must only be called from the main thread.
   3330  *
   3331  *  @sa @ref window_title
   3332  *  @sa @ref glfwSetWindowTitle
   3333  *
   3334  *  @since Added in version 3.4.
   3335  *
   3336  *  @ingroup window
   3337  */
   3338 GLFWAPI const char* glfwGetWindowTitle(GLFWwindow* window);
   3339 
   3340 /*! @brief Sets the title of the specified window.
   3341  *
   3342  *  This function sets the window title, encoded as UTF-8, of the specified
   3343  *  window.
   3344  *
   3345  *  @param[in] window The window whose title to change.
   3346  *  @param[in] title The UTF-8 encoded window title.
   3347  *
   3348  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3349  *  GLFW_PLATFORM_ERROR.
   3350  *
   3351  *  @remark @macos The window title will not be updated until the next time you
   3352  *  process events.
   3353  *
   3354  *  @thread_safety This function must only be called from the main thread.
   3355  *
   3356  *  @sa @ref window_title
   3357  *  @sa @ref glfwGetWindowTitle
   3358  *
   3359  *  @since Added in version 1.0.
   3360  *  @glfw3 Added window handle parameter.
   3361  *
   3362  *  @ingroup window
   3363  */
   3364 GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title);
   3365 
   3366 /*! @brief Sets the icon for the specified window.
   3367  *
   3368  *  This function sets the icon of the specified window.  If passed an array of
   3369  *  candidate images, those of or closest to the sizes desired by the system are
   3370  *  selected.  If no images are specified, the window reverts to its default
   3371  *  icon.
   3372  *
   3373  *  The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight
   3374  *  bits per channel with the red channel first.  They are arranged canonically
   3375  *  as packed sequential rows, starting from the top-left corner.
   3376  *
   3377  *  The desired image sizes varies depending on platform and system settings.
   3378  *  The selected images will be rescaled as needed.  Good sizes include 16x16,
   3379  *  32x32 and 48x48.
   3380  *
   3381  *  @param[in] window The window whose icon to set.
   3382  *  @param[in] count The number of images in the specified array, or zero to
   3383  *  revert to the default window icon.
   3384  *  @param[in] images The images to create the icon from.  This is ignored if
   3385  *  count is zero.
   3386  *
   3387  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   3388  *  GLFW_INVALID_VALUE, @ref GLFW_PLATFORM_ERROR and @ref
   3389  *  GLFW_FEATURE_UNAVAILABLE (see remarks).
   3390  *
   3391  *  @pointer_lifetime The specified image data is copied before this function
   3392  *  returns.
   3393  *
   3394  *  @remark @macos Regular windows do not have icons on macOS.  This function
   3395  *  will emit @ref GLFW_FEATURE_UNAVAILABLE.  The dock icon will be the same as
   3396  *  the application bundle's icon.  For more information on bundles, see the
   3397  *  [Bundle Programming Guide][bundle-guide] in the Mac Developer Library.
   3398  *
   3399  *  [bundle-guide]: https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/
   3400  *
   3401  *  @remark @wayland There is no existing protocol to change an icon, the
   3402  *  window will thus inherit the one defined in the application's desktop file.
   3403  *  This function will emit @ref GLFW_FEATURE_UNAVAILABLE.
   3404  *
   3405  *  @thread_safety This function must only be called from the main thread.
   3406  *
   3407  *  @sa @ref window_icon
   3408  *
   3409  *  @since Added in version 3.2.
   3410  *
   3411  *  @ingroup window
   3412  */
   3413 GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* images);
   3414 
   3415 /*! @brief Retrieves the position of the content area of the specified window.
   3416  *
   3417  *  This function retrieves the position, in screen coordinates, of the
   3418  *  upper-left corner of the content area of the specified window.
   3419  *
   3420  *  Any or all of the position arguments may be `NULL`.  If an error occurs, all
   3421  *  non-`NULL` position arguments will be set to zero.
   3422  *
   3423  *  @param[in] window The window to query.
   3424  *  @param[out] xpos Where to store the x-coordinate of the upper-left corner of
   3425  *  the content area, or `NULL`.
   3426  *  @param[out] ypos Where to store the y-coordinate of the upper-left corner of
   3427  *  the content area, or `NULL`.
   3428  *
   3429  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   3430  *  GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
   3431  *
   3432  *  @remark @wayland There is no way for an application to retrieve the global
   3433  *  position of its windows.  This function will emit @ref
   3434  *  GLFW_FEATURE_UNAVAILABLE.
   3435  *
   3436  *  @thread_safety This function must only be called from the main thread.
   3437  *
   3438  *  @sa @ref window_pos
   3439  *  @sa @ref glfwSetWindowPos
   3440  *
   3441  *  @since Added in version 3.0.
   3442  *
   3443  *  @ingroup window
   3444  */
   3445 GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos);
   3446 
   3447 /*! @brief Sets the position of the content area of the specified window.
   3448  *
   3449  *  This function sets the position, in screen coordinates, of the upper-left
   3450  *  corner of the content area of the specified windowed mode window.  If the
   3451  *  window is a full screen window, this function does nothing.
   3452  *
   3453  *  __Do not use this function__ to move an already visible window unless you
   3454  *  have very good reasons for doing so, as it will confuse and annoy the user.
   3455  *
   3456  *  The window manager may put limits on what positions are allowed.  GLFW
   3457  *  cannot and should not override these limits.
   3458  *
   3459  *  @param[in] window The window to query.
   3460  *  @param[in] xpos The x-coordinate of the upper-left corner of the content area.
   3461  *  @param[in] ypos The y-coordinate of the upper-left corner of the content area.
   3462  *
   3463  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   3464  *  GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
   3465  *
   3466  *  @remark @wayland There is no way for an application to set the global
   3467  *  position of its windows.  This function will emit @ref
   3468  *  GLFW_FEATURE_UNAVAILABLE.
   3469  *
   3470  *  @thread_safety This function must only be called from the main thread.
   3471  *
   3472  *  @sa @ref window_pos
   3473  *  @sa @ref glfwGetWindowPos
   3474  *
   3475  *  @since Added in version 1.0.
   3476  *  @glfw3 Added window handle parameter.
   3477  *
   3478  *  @ingroup window
   3479  */
   3480 GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);
   3481 
   3482 /*! @brief Retrieves the size of the content area of the specified window.
   3483  *
   3484  *  This function retrieves the size, in screen coordinates, of the content area
   3485  *  of the specified window.  If you wish to retrieve the size of the
   3486  *  framebuffer of the window in pixels, see @ref glfwGetFramebufferSize.
   3487  *
   3488  *  Any or all of the size arguments may be `NULL`.  If an error occurs, all
   3489  *  non-`NULL` size arguments will be set to zero.
   3490  *
   3491  *  @param[in] window The window whose size to retrieve.
   3492  *  @param[out] width Where to store the width, in screen coordinates, of the
   3493  *  content area, or `NULL`.
   3494  *  @param[out] height Where to store the height, in screen coordinates, of the
   3495  *  content area, or `NULL`.
   3496  *
   3497  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3498  *  GLFW_PLATFORM_ERROR.
   3499  *
   3500  *  @thread_safety This function must only be called from the main thread.
   3501  *
   3502  *  @sa @ref window_size
   3503  *  @sa @ref glfwSetWindowSize
   3504  *
   3505  *  @since Added in version 1.0.
   3506  *  @glfw3 Added window handle parameter.
   3507  *
   3508  *  @ingroup window
   3509  */
   3510 GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height);
   3511 
   3512 /*! @brief Sets the size limits of the specified window.
   3513  *
   3514  *  This function sets the size limits of the content area of the specified
   3515  *  window.  If the window is full screen, the size limits only take effect
   3516  *  once it is made windowed.  If the window is not resizable, this function
   3517  *  does nothing.
   3518  *
   3519  *  The size limits are applied immediately to a windowed mode window and may
   3520  *  cause it to be resized.
   3521  *
   3522  *  The maximum dimensions must be greater than or equal to the minimum
   3523  *  dimensions and all must be greater than or equal to zero.
   3524  *
   3525  *  @param[in] window The window to set limits for.
   3526  *  @param[in] minwidth The minimum width, in screen coordinates, of the content
   3527  *  area, or `GLFW_DONT_CARE`.
   3528  *  @param[in] minheight The minimum height, in screen coordinates, of the
   3529  *  content area, or `GLFW_DONT_CARE`.
   3530  *  @param[in] maxwidth The maximum width, in screen coordinates, of the content
   3531  *  area, or `GLFW_DONT_CARE`.
   3532  *  @param[in] maxheight The maximum height, in screen coordinates, of the
   3533  *  content area, or `GLFW_DONT_CARE`.
   3534  *
   3535  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   3536  *  GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
   3537  *
   3538  *  @remark If you set size limits and an aspect ratio that conflict, the
   3539  *  results are undefined.
   3540  *
   3541  *  @remark @wayland The size limits will not be applied until the window is
   3542  *  actually resized, either by the user or by the compositor.
   3543  *
   3544  *  @thread_safety This function must only be called from the main thread.
   3545  *
   3546  *  @sa @ref window_sizelimits
   3547  *  @sa @ref glfwSetWindowAspectRatio
   3548  *
   3549  *  @since Added in version 3.2.
   3550  *
   3551  *  @ingroup window
   3552  */
   3553 GLFWAPI void glfwSetWindowSizeLimits(GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight);
   3554 
   3555 /*! @brief Sets the aspect ratio of the specified window.
   3556  *
   3557  *  This function sets the required aspect ratio of the content area of the
   3558  *  specified window.  If the window is full screen, the aspect ratio only takes
   3559  *  effect once it is made windowed.  If the window is not resizable, this
   3560  *  function does nothing.
   3561  *
   3562  *  The aspect ratio is specified as a numerator and a denominator and both
   3563  *  values must be greater than zero.  For example, the common 16:9 aspect ratio
   3564  *  is specified as 16 and 9, respectively.
   3565  *
   3566  *  If the numerator and denominator is set to `GLFW_DONT_CARE` then the aspect
   3567  *  ratio limit is disabled.
   3568  *
   3569  *  The aspect ratio is applied immediately to a windowed mode window and may
   3570  *  cause it to be resized.
   3571  *
   3572  *  @param[in] window The window to set limits for.
   3573  *  @param[in] numer The numerator of the desired aspect ratio, or
   3574  *  `GLFW_DONT_CARE`.
   3575  *  @param[in] denom The denominator of the desired aspect ratio, or
   3576  *  `GLFW_DONT_CARE`.
   3577  *
   3578  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   3579  *  GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
   3580  *
   3581  *  @remark If you set size limits and an aspect ratio that conflict, the
   3582  *  results are undefined.
   3583  *
   3584  *  @remark @wayland The aspect ratio will not be applied until the window is
   3585  *  actually resized, either by the user or by the compositor.
   3586  *
   3587  *  @thread_safety This function must only be called from the main thread.
   3588  *
   3589  *  @sa @ref window_sizelimits
   3590  *  @sa @ref glfwSetWindowSizeLimits
   3591  *
   3592  *  @since Added in version 3.2.
   3593  *
   3594  *  @ingroup window
   3595  */
   3596 GLFWAPI void glfwSetWindowAspectRatio(GLFWwindow* window, int numer, int denom);
   3597 
   3598 /*! @brief Sets the size of the content area of the specified window.
   3599  *
   3600  *  This function sets the size, in screen coordinates, of the content area of
   3601  *  the specified window.
   3602  *
   3603  *  For full screen windows, this function updates the resolution of its desired
   3604  *  video mode and switches to the video mode closest to it, without affecting
   3605  *  the window's context.  As the context is unaffected, the bit depths of the
   3606  *  framebuffer remain unchanged.
   3607  *
   3608  *  If you wish to update the refresh rate of the desired video mode in addition
   3609  *  to its resolution, see @ref glfwSetWindowMonitor.
   3610  *
   3611  *  The window manager may put limits on what sizes are allowed.  GLFW cannot
   3612  *  and should not override these limits.
   3613  *
   3614  *  @param[in] window The window to resize.
   3615  *  @param[in] width The desired width, in screen coordinates, of the window
   3616  *  content area.
   3617  *  @param[in] height The desired height, in screen coordinates, of the window
   3618  *  content area.
   3619  *
   3620  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3621  *  GLFW_PLATFORM_ERROR.
   3622  *
   3623  *  @thread_safety This function must only be called from the main thread.
   3624  *
   3625  *  @sa @ref window_size
   3626  *  @sa @ref glfwGetWindowSize
   3627  *  @sa @ref glfwSetWindowMonitor
   3628  *
   3629  *  @since Added in version 1.0.
   3630  *  @glfw3 Added window handle parameter.
   3631  *
   3632  *  @ingroup window
   3633  */
   3634 GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height);
   3635 
   3636 /*! @brief Retrieves the size of the framebuffer of the specified window.
   3637  *
   3638  *  This function retrieves the size, in pixels, of the framebuffer of the
   3639  *  specified window.  If you wish to retrieve the size of the window in screen
   3640  *  coordinates, see @ref glfwGetWindowSize.
   3641  *
   3642  *  Any or all of the size arguments may be `NULL`.  If an error occurs, all
   3643  *  non-`NULL` size arguments will be set to zero.
   3644  *
   3645  *  @param[in] window The window whose framebuffer to query.
   3646  *  @param[out] width Where to store the width, in pixels, of the framebuffer,
   3647  *  or `NULL`.
   3648  *  @param[out] height Where to store the height, in pixels, of the framebuffer,
   3649  *  or `NULL`.
   3650  *
   3651  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3652  *  GLFW_PLATFORM_ERROR.
   3653  *
   3654  *  @thread_safety This function must only be called from the main thread.
   3655  *
   3656  *  @sa @ref window_fbsize
   3657  *  @sa @ref glfwSetFramebufferSizeCallback
   3658  *
   3659  *  @since Added in version 3.0.
   3660  *
   3661  *  @ingroup window
   3662  */
   3663 GLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height);
   3664 
   3665 /*! @brief Retrieves the size of the frame of the window.
   3666  *
   3667  *  This function retrieves the size, in screen coordinates, of each edge of the
   3668  *  frame of the specified window.  This size includes the title bar, if the
   3669  *  window has one.  The size of the frame may vary depending on the
   3670  *  [window-related hints](@ref window_hints_wnd) used to create it.
   3671  *
   3672  *  Because this function retrieves the size of each window frame edge and not
   3673  *  the offset along a particular coordinate axis, the retrieved values will
   3674  *  always be zero or positive.
   3675  *
   3676  *  Any or all of the size arguments may be `NULL`.  If an error occurs, all
   3677  *  non-`NULL` size arguments will be set to zero.
   3678  *
   3679  *  @param[in] window The window whose frame size to query.
   3680  *  @param[out] left Where to store the size, in screen coordinates, of the left
   3681  *  edge of the window frame, or `NULL`.
   3682  *  @param[out] top Where to store the size, in screen coordinates, of the top
   3683  *  edge of the window frame, or `NULL`.
   3684  *  @param[out] right Where to store the size, in screen coordinates, of the
   3685  *  right edge of the window frame, or `NULL`.
   3686  *  @param[out] bottom Where to store the size, in screen coordinates, of the
   3687  *  bottom edge of the window frame, or `NULL`.
   3688  *
   3689  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3690  *  GLFW_PLATFORM_ERROR.
   3691  *
   3692  *  @thread_safety This function must only be called from the main thread.
   3693  *
   3694  *  @sa @ref window_size
   3695  *
   3696  *  @since Added in version 3.1.
   3697  *
   3698  *  @ingroup window
   3699  */
   3700 GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int* right, int* bottom);
   3701 
   3702 /*! @brief Retrieves the content scale for the specified window.
   3703  *
   3704  *  This function retrieves the content scale for the specified window.  The
   3705  *  content scale is the ratio between the current DPI and the platform's
   3706  *  default DPI.  This is especially important for text and any UI elements.  If
   3707  *  the pixel dimensions of your UI scaled by this look appropriate on your
   3708  *  machine then it should appear at a reasonable size on other machines
   3709  *  regardless of their DPI and scaling settings.  This relies on the system DPI
   3710  *  and scaling settings being somewhat correct.
   3711  *
   3712  *  On platforms where each monitors can have its own content scale, the window
   3713  *  content scale will depend on which monitor the system considers the window
   3714  *  to be on.
   3715  *
   3716  *  @param[in] window The window to query.
   3717  *  @param[out] xscale Where to store the x-axis content scale, or `NULL`.
   3718  *  @param[out] yscale Where to store the y-axis content scale, or `NULL`.
   3719  *
   3720  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3721  *  GLFW_PLATFORM_ERROR.
   3722  *
   3723  *  @thread_safety This function must only be called from the main thread.
   3724  *
   3725  *  @sa @ref window_scale
   3726  *  @sa @ref glfwSetWindowContentScaleCallback
   3727  *  @sa @ref glfwGetMonitorContentScale
   3728  *
   3729  *  @since Added in version 3.3.
   3730  *
   3731  *  @ingroup window
   3732  */
   3733 GLFWAPI void glfwGetWindowContentScale(GLFWwindow* window, float* xscale, float* yscale);
   3734 
   3735 /*! @brief Returns the opacity of the whole window.
   3736  *
   3737  *  This function returns the opacity of the window, including any decorations.
   3738  *
   3739  *  The opacity (or alpha) value is a positive finite number between zero and
   3740  *  one, where zero is fully transparent and one is fully opaque.  If the system
   3741  *  does not support whole window transparency, this function always returns one.
   3742  *
   3743  *  The initial opacity value for newly created windows is one.
   3744  *
   3745  *  @param[in] window The window to query.
   3746  *  @return The opacity value of the specified window.
   3747  *
   3748  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3749  *  GLFW_PLATFORM_ERROR.
   3750  *
   3751  *  @thread_safety This function must only be called from the main thread.
   3752  *
   3753  *  @sa @ref window_transparency
   3754  *  @sa @ref glfwSetWindowOpacity
   3755  *
   3756  *  @since Added in version 3.3.
   3757  *
   3758  *  @ingroup window
   3759  */
   3760 GLFWAPI float glfwGetWindowOpacity(GLFWwindow* window);
   3761 
   3762 /*! @brief Sets the opacity of the whole window.
   3763  *
   3764  *  This function sets the opacity of the window, including any decorations.
   3765  *
   3766  *  The opacity (or alpha) value is a positive finite number between zero and
   3767  *  one, where zero is fully transparent and one is fully opaque.
   3768  *
   3769  *  The initial opacity value for newly created windows is one.
   3770  *
   3771  *  A window created with framebuffer transparency may not use whole window
   3772  *  transparency.  The results of doing this are undefined.
   3773  *
   3774  *  @param[in] window The window to set the opacity for.
   3775  *  @param[in] opacity The desired opacity of the specified window.
   3776  *
   3777  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   3778  *  GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
   3779  *
   3780  *  @remark @wayland There is no way to set an opacity factor for a window.
   3781  *  This function will emit @ref GLFW_FEATURE_UNAVAILABLE.
   3782  *
   3783  *  @thread_safety This function must only be called from the main thread.
   3784  *
   3785  *  @sa @ref window_transparency
   3786  *  @sa @ref glfwGetWindowOpacity
   3787  *
   3788  *  @since Added in version 3.3.
   3789  *
   3790  *  @ingroup window
   3791  */
   3792 GLFWAPI void glfwSetWindowOpacity(GLFWwindow* window, float opacity);
   3793 
   3794 /*! @brief Iconifies the specified window.
   3795  *
   3796  *  This function iconifies (minimizes) the specified window if it was
   3797  *  previously restored.  If the window is already iconified, this function does
   3798  *  nothing.
   3799  *
   3800  *  If the specified window is a full screen window, GLFW restores the original
   3801  *  video mode of the monitor.  The window's desired video mode is set again
   3802  *  when the window is restored.
   3803  *
   3804  *  @param[in] window The window to iconify.
   3805  *
   3806  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3807  *  GLFW_PLATFORM_ERROR.
   3808  *
   3809  *  @remark @wayland Once a window is iconified, @ref glfwRestoreWindow won’t
   3810  *  be able to restore it.  This is a design decision of the xdg-shell
   3811  *  protocol.
   3812  *
   3813  *  @thread_safety This function must only be called from the main thread.
   3814  *
   3815  *  @sa @ref window_iconify
   3816  *  @sa @ref glfwRestoreWindow
   3817  *  @sa @ref glfwMaximizeWindow
   3818  *
   3819  *  @since Added in version 2.1.
   3820  *  @glfw3 Added window handle parameter.
   3821  *
   3822  *  @ingroup window
   3823  */
   3824 GLFWAPI void glfwIconifyWindow(GLFWwindow* window);
   3825 
   3826 /*! @brief Restores the specified window.
   3827  *
   3828  *  This function restores the specified window if it was previously iconified
   3829  *  (minimized) or maximized.  If the window is already restored, this function
   3830  *  does nothing.
   3831  *
   3832  *  If the specified window is an iconified full screen window, its desired
   3833  *  video mode is set again for its monitor when the window is restored.
   3834  *
   3835  *  @param[in] window The window to restore.
   3836  *
   3837  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3838  *  GLFW_PLATFORM_ERROR.
   3839  *
   3840  *  @thread_safety This function must only be called from the main thread.
   3841  *
   3842  *  @sa @ref window_iconify
   3843  *  @sa @ref glfwIconifyWindow
   3844  *  @sa @ref glfwMaximizeWindow
   3845  *
   3846  *  @since Added in version 2.1.
   3847  *  @glfw3 Added window handle parameter.
   3848  *
   3849  *  @ingroup window
   3850  */
   3851 GLFWAPI void glfwRestoreWindow(GLFWwindow* window);
   3852 
   3853 /*! @brief Maximizes the specified window.
   3854  *
   3855  *  This function maximizes the specified window if it was previously not
   3856  *  maximized.  If the window is already maximized, this function does nothing.
   3857  *
   3858  *  If the specified window is a full screen window, this function does nothing.
   3859  *
   3860  *  @param[in] window The window to maximize.
   3861  *
   3862  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3863  *  GLFW_PLATFORM_ERROR.
   3864  *
   3865  *  @par Thread Safety
   3866  *  This function may only be called from the main thread.
   3867  *
   3868  *  @sa @ref window_iconify
   3869  *  @sa @ref glfwIconifyWindow
   3870  *  @sa @ref glfwRestoreWindow
   3871  *
   3872  *  @since Added in GLFW 3.2.
   3873  *
   3874  *  @ingroup window
   3875  */
   3876 GLFWAPI void glfwMaximizeWindow(GLFWwindow* window);
   3877 
   3878 /*! @brief Makes the specified window visible.
   3879  *
   3880  *  This function makes the specified window visible if it was previously
   3881  *  hidden.  If the window is already visible or is in full screen mode, this
   3882  *  function does nothing.
   3883  *
   3884  *  By default, windowed mode windows are focused when shown
   3885  *  Set the [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint
   3886  *  to change this behavior for all newly created windows, or change the
   3887  *  behavior for an existing window with @ref glfwSetWindowAttrib.
   3888  *
   3889  *  @param[in] window The window to make visible.
   3890  *
   3891  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3892  *  GLFW_PLATFORM_ERROR.
   3893  *
   3894  *  @remark @wayland Because Wayland wants every frame of the desktop to be
   3895  *  complete, this function does not immediately make the window visible.
   3896  *  Instead it will become visible the next time the window framebuffer is
   3897  *  updated after this call.
   3898  *
   3899  *  @thread_safety This function must only be called from the main thread.
   3900  *
   3901  *  @sa @ref window_hide
   3902  *  @sa @ref glfwHideWindow
   3903  *
   3904  *  @since Added in version 3.0.
   3905  *
   3906  *  @ingroup window
   3907  */
   3908 GLFWAPI void glfwShowWindow(GLFWwindow* window);
   3909 
   3910 /*! @brief Hides the specified window.
   3911  *
   3912  *  This function hides the specified window if it was previously visible.  If
   3913  *  the window is already hidden or is in full screen mode, this function does
   3914  *  nothing.
   3915  *
   3916  *  @param[in] window The window to hide.
   3917  *
   3918  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3919  *  GLFW_PLATFORM_ERROR.
   3920  *
   3921  *  @thread_safety This function must only be called from the main thread.
   3922  *
   3923  *  @sa @ref window_hide
   3924  *  @sa @ref glfwShowWindow
   3925  *
   3926  *  @since Added in version 3.0.
   3927  *
   3928  *  @ingroup window
   3929  */
   3930 GLFWAPI void glfwHideWindow(GLFWwindow* window);
   3931 
   3932 /*! @brief Brings the specified window to front and sets input focus.
   3933  *
   3934  *  This function brings the specified window to front and sets input focus.
   3935  *  The window should already be visible and not iconified.
   3936  *
   3937  *  By default, both windowed and full screen mode windows are focused when
   3938  *  initially created.  Set the [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) to
   3939  *  disable this behavior.
   3940  *
   3941  *  Also by default, windowed mode windows are focused when shown
   3942  *  with @ref glfwShowWindow. Set the
   3943  *  [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) to disable this behavior.
   3944  *
   3945  *  __Do not use this function__ to steal focus from other applications unless
   3946  *  you are certain that is what the user wants.  Focus stealing can be
   3947  *  extremely disruptive.
   3948  *
   3949  *  For a less disruptive way of getting the user's attention, see
   3950  *  [attention requests](@ref window_attention).
   3951  *
   3952  *  @param[in] window The window to give input focus.
   3953  *
   3954  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3955  *  GLFW_PLATFORM_ERROR.
   3956  *
   3957  *  @remark @wayland The compositor will likely ignore focus requests unless
   3958  *  another window created by the same application already has input focus.
   3959  *
   3960  *  @thread_safety This function must only be called from the main thread.
   3961  *
   3962  *  @sa @ref window_focus
   3963  *  @sa @ref window_attention
   3964  *
   3965  *  @since Added in version 3.2.
   3966  *
   3967  *  @ingroup window
   3968  */
   3969 GLFWAPI void glfwFocusWindow(GLFWwindow* window);
   3970 
   3971 /*! @brief Requests user attention to the specified window.
   3972  *
   3973  *  This function requests user attention to the specified window.  On
   3974  *  platforms where this is not supported, attention is requested to the
   3975  *  application as a whole.
   3976  *
   3977  *  Once the user has given attention, usually by focusing the window or
   3978  *  application, the system will end the request automatically.
   3979  *
   3980  *  @param[in] window The window to request attention to.
   3981  *
   3982  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   3983  *  GLFW_PLATFORM_ERROR.
   3984  *
   3985  *  @remark @macos Attention is requested to the application as a whole, not the
   3986  *  specific window.
   3987  *
   3988  *  @thread_safety This function must only be called from the main thread.
   3989  *
   3990  *  @sa @ref window_attention
   3991  *
   3992  *  @since Added in version 3.3.
   3993  *
   3994  *  @ingroup window
   3995  */
   3996 GLFWAPI void glfwRequestWindowAttention(GLFWwindow* window);
   3997 
   3998 /*! @brief Returns the monitor that the window uses for full screen mode.
   3999  *
   4000  *  This function returns the handle of the monitor that the specified window is
   4001  *  in full screen on.
   4002  *
   4003  *  @param[in] window The window to query.
   4004  *  @return The monitor, or `NULL` if the window is in windowed mode or an
   4005  *  [error](@ref error_handling) occurred.
   4006  *
   4007  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4008  *
   4009  *  @thread_safety This function must only be called from the main thread.
   4010  *
   4011  *  @sa @ref window_monitor
   4012  *  @sa @ref glfwSetWindowMonitor
   4013  *
   4014  *  @since Added in version 3.0.
   4015  *
   4016  *  @ingroup window
   4017  */
   4018 GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);
   4019 
   4020 /*! @brief Sets the mode, monitor, video mode and placement of a window.
   4021  *
   4022  *  This function sets the monitor that the window uses for full screen mode or,
   4023  *  if the monitor is `NULL`, makes it windowed mode.
   4024  *
   4025  *  When setting a monitor, this function updates the width, height and refresh
   4026  *  rate of the desired video mode and switches to the video mode closest to it.
   4027  *  The window position is ignored when setting a monitor.
   4028  *
   4029  *  When the monitor is `NULL`, the position, width and height are used to
   4030  *  place the window content area.  The refresh rate is ignored when no monitor
   4031  *  is specified.
   4032  *
   4033  *  If you only wish to update the resolution of a full screen window or the
   4034  *  size of a windowed mode window, see @ref glfwSetWindowSize.
   4035  *
   4036  *  When a window transitions from full screen to windowed mode, this function
   4037  *  restores any previous window settings such as whether it is decorated,
   4038  *  floating, resizable, has size or aspect ratio limits, etc.
   4039  *
   4040  *  @param[in] window The window whose monitor, size or video mode to set.
   4041  *  @param[in] monitor The desired monitor, or `NULL` to set windowed mode.
   4042  *  @param[in] xpos The desired x-coordinate of the upper-left corner of the
   4043  *  content area.
   4044  *  @param[in] ypos The desired y-coordinate of the upper-left corner of the
   4045  *  content area.
   4046  *  @param[in] width The desired with, in screen coordinates, of the content
   4047  *  area or video mode.
   4048  *  @param[in] height The desired height, in screen coordinates, of the content
   4049  *  area or video mode.
   4050  *  @param[in] refreshRate The desired refresh rate, in Hz, of the video mode,
   4051  *  or `GLFW_DONT_CARE`.
   4052  *
   4053  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4054  *  GLFW_PLATFORM_ERROR.
   4055  *
   4056  *  @remark The OpenGL or OpenGL ES context will not be destroyed or otherwise
   4057  *  affected by any resizing or mode switching, although you may need to update
   4058  *  your viewport if the framebuffer size has changed.
   4059  *
   4060  *  @remark @wayland The desired window position is ignored, as there is no way
   4061  *  for an application to set this property.
   4062  *
   4063  *  @thread_safety This function must only be called from the main thread.
   4064  *
   4065  *  @sa @ref window_monitor
   4066  *  @sa @ref window_full_screen
   4067  *  @sa @ref glfwGetWindowMonitor
   4068  *  @sa @ref glfwSetWindowSize
   4069  *
   4070  *  @since Added in version 3.2.
   4071  *
   4072  *  @ingroup window
   4073  */
   4074 GLFWAPI void glfwSetWindowMonitor(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate);
   4075 
   4076 /*! @brief Returns an attribute of the specified window.
   4077  *
   4078  *  This function returns the value of an attribute of the specified window or
   4079  *  its OpenGL or OpenGL ES context.
   4080  *
   4081  *  @param[in] window The window to query.
   4082  *  @param[in] attrib The [window attribute](@ref window_attribs) whose value to
   4083  *  return.
   4084  *  @return The value of the attribute, or zero if an
   4085  *  [error](@ref error_handling) occurred.
   4086  *
   4087  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4088  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   4089  *
   4090  *  @remark Framebuffer related hints are not window attributes.  See @ref
   4091  *  window_attribs_fb for more information.
   4092  *
   4093  *  @remark Zero is a valid value for many window and context related
   4094  *  attributes so you cannot use a return value of zero as an indication of
   4095  *  errors.  However, this function should not fail as long as it is passed
   4096  *  valid arguments and the library has been [initialized](@ref intro_init).
   4097  *
   4098  *  @remark @wayland The Wayland protocol provides no way to check whether a
   4099  *  window is iconfied, so @ref GLFW_ICONIFIED always returns `GLFW_FALSE`.
   4100  *
   4101  *  @thread_safety This function must only be called from the main thread.
   4102  *
   4103  *  @sa @ref window_attribs
   4104  *  @sa @ref glfwSetWindowAttrib
   4105  *
   4106  *  @since Added in version 3.0.  Replaces `glfwGetWindowParam` and
   4107  *  `glfwGetGLVersion`.
   4108  *
   4109  *  @ingroup window
   4110  */
   4111 GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib);
   4112 
   4113 /*! @brief Sets an attribute of the specified window.
   4114  *
   4115  *  This function sets the value of an attribute of the specified window.
   4116  *
   4117  *  The supported attributes are [GLFW_DECORATED](@ref GLFW_DECORATED_attrib),
   4118  *  [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib),
   4119  *  [GLFW_FLOATING](@ref GLFW_FLOATING_attrib),
   4120  *  [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib) and
   4121  *  [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib).
   4122  *  [GLFW_MOUSE_PASSTHROUGH](@ref GLFW_MOUSE_PASSTHROUGH_attrib)
   4123  *
   4124  *  Some of these attributes are ignored for full screen windows.  The new
   4125  *  value will take effect if the window is later made windowed.
   4126  *
   4127  *  Some of these attributes are ignored for windowed mode windows.  The new
   4128  *  value will take effect if the window is later made full screen.
   4129  *
   4130  *  @param[in] window The window to set the attribute for.
   4131  *  @param[in] attrib A supported window attribute.
   4132  *  @param[in] value `GLFW_TRUE` or `GLFW_FALSE`.
   4133  *
   4134  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4135  *  GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_PLATFORM_ERROR and @ref
   4136  *  GLFW_FEATURE_UNAVAILABLE (see remarks).
   4137  *
   4138  *  @remark Calling @ref glfwGetWindowAttrib will always return the latest
   4139  *  value, even if that value is ignored by the current mode of the window.
   4140  *
   4141  *  @remark @wayland The [GLFW_FLOATING](@ref GLFW_FLOATING_attrib) window attribute is
   4142  *  not supported.  Setting this will emit @ref GLFW_FEATURE_UNAVAILABLE.
   4143  *
   4144  *  @thread_safety This function must only be called from the main thread.
   4145  *
   4146  *  @sa @ref window_attribs
   4147  *  @sa @ref glfwGetWindowAttrib
   4148  *
   4149  *  @since Added in version 3.3.
   4150  *
   4151  *  @ingroup window
   4152  */
   4153 GLFWAPI void glfwSetWindowAttrib(GLFWwindow* window, int attrib, int value);
   4154 
   4155 /*! @brief Sets the user pointer of the specified window.
   4156  *
   4157  *  This function sets the user-defined pointer of the specified window.  The
   4158  *  current value is retained until the window is destroyed.  The initial value
   4159  *  is `NULL`.
   4160  *
   4161  *  @param[in] window The window whose pointer to set.
   4162  *  @param[in] pointer The new value.
   4163  *
   4164  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4165  *
   4166  *  @thread_safety This function may be called from any thread.  Access is not
   4167  *  synchronized.
   4168  *
   4169  *  @sa @ref window_userptr
   4170  *  @sa @ref glfwGetWindowUserPointer
   4171  *
   4172  *  @since Added in version 3.0.
   4173  *
   4174  *  @ingroup window
   4175  */
   4176 GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer);
   4177 
   4178 /*! @brief Returns the user pointer of the specified window.
   4179  *
   4180  *  This function returns the current value of the user-defined pointer of the
   4181  *  specified window.  The initial value is `NULL`.
   4182  *
   4183  *  @param[in] window The window whose pointer to return.
   4184  *
   4185  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4186  *
   4187  *  @thread_safety This function may be called from any thread.  Access is not
   4188  *  synchronized.
   4189  *
   4190  *  @sa @ref window_userptr
   4191  *  @sa @ref glfwSetWindowUserPointer
   4192  *
   4193  *  @since Added in version 3.0.
   4194  *
   4195  *  @ingroup window
   4196  */
   4197 GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window);
   4198 
   4199 /*! @brief Sets the position callback for the specified window.
   4200  *
   4201  *  This function sets the position callback of the specified window, which is
   4202  *  called when the window is moved.  The callback is provided with the
   4203  *  position, in screen coordinates, of the upper-left corner of the content
   4204  *  area of the window.
   4205  *
   4206  *  @param[in] window The window whose callback to set.
   4207  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   4208  *  callback.
   4209  *  @return The previously set callback, or `NULL` if no callback was set or the
   4210  *  library had not been [initialized](@ref intro_init).
   4211  *
   4212  *  @callback_signature
   4213  *  @code
   4214  *  void function_name(GLFWwindow* window, int xpos, int ypos)
   4215  *  @endcode
   4216  *  For more information about the callback parameters, see the
   4217  *  [function pointer type](@ref GLFWwindowposfun).
   4218  *
   4219  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4220  *
   4221  *  @remark @wayland This callback will never be called, as there is no way for
   4222  *  an application to know its global position.
   4223  *
   4224  *  @thread_safety This function must only be called from the main thread.
   4225  *
   4226  *  @sa @ref window_pos
   4227  *
   4228  *  @since Added in version 3.0.
   4229  *
   4230  *  @ingroup window
   4231  */
   4232 GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun callback);
   4233 
   4234 /*! @brief Sets the size callback for the specified window.
   4235  *
   4236  *  This function sets the size callback of the specified window, which is
   4237  *  called when the window is resized.  The callback is provided with the size,
   4238  *  in screen coordinates, of the content area of the window.
   4239  *
   4240  *  @param[in] window The window whose callback to set.
   4241  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   4242  *  callback.
   4243  *  @return The previously set callback, or `NULL` if no callback was set or the
   4244  *  library had not been [initialized](@ref intro_init).
   4245  *
   4246  *  @callback_signature
   4247  *  @code
   4248  *  void function_name(GLFWwindow* window, int width, int height)
   4249  *  @endcode
   4250  *  For more information about the callback parameters, see the
   4251  *  [function pointer type](@ref GLFWwindowsizefun).
   4252  *
   4253  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4254  *
   4255  *  @thread_safety This function must only be called from the main thread.
   4256  *
   4257  *  @sa @ref window_size
   4258  *
   4259  *  @since Added in version 1.0.
   4260  *  @glfw3 Added window handle parameter and return value.
   4261  *
   4262  *  @ingroup window
   4263  */
   4264 GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun callback);
   4265 
   4266 /*! @brief Sets the close callback for the specified window.
   4267  *
   4268  *  This function sets the close callback of the specified window, which is
   4269  *  called when the user attempts to close the window, for example by clicking
   4270  *  the close widget in the title bar.
   4271  *
   4272  *  The close flag is set before this callback is called, but you can modify it
   4273  *  at any time with @ref glfwSetWindowShouldClose.
   4274  *
   4275  *  The close callback is not triggered by @ref glfwDestroyWindow.
   4276  *
   4277  *  @param[in] window The window whose callback to set.
   4278  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   4279  *  callback.
   4280  *  @return The previously set callback, or `NULL` if no callback was set or the
   4281  *  library had not been [initialized](@ref intro_init).
   4282  *
   4283  *  @callback_signature
   4284  *  @code
   4285  *  void function_name(GLFWwindow* window)
   4286  *  @endcode
   4287  *  For more information about the callback parameters, see the
   4288  *  [function pointer type](@ref GLFWwindowclosefun).
   4289  *
   4290  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4291  *
   4292  *  @remark @macos Selecting Quit from the application menu will trigger the
   4293  *  close callback for all windows.
   4294  *
   4295  *  @thread_safety This function must only be called from the main thread.
   4296  *
   4297  *  @sa @ref window_close
   4298  *
   4299  *  @since Added in version 2.5.
   4300  *  @glfw3 Added window handle parameter and return value.
   4301  *
   4302  *  @ingroup window
   4303  */
   4304 GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun callback);
   4305 
   4306 /*! @brief Sets the refresh callback for the specified window.
   4307  *
   4308  *  This function sets the refresh callback of the specified window, which is
   4309  *  called when the content area of the window needs to be redrawn, for example
   4310  *  if the window has been exposed after having been covered by another window.
   4311  *
   4312  *  On compositing window systems such as Aero, Compiz, Aqua or Wayland, where
   4313  *  the window contents are saved off-screen, this callback may be called only
   4314  *  very infrequently or never at all.
   4315  *
   4316  *  @param[in] window The window whose callback to set.
   4317  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   4318  *  callback.
   4319  *  @return The previously set callback, or `NULL` if no callback was set or the
   4320  *  library had not been [initialized](@ref intro_init).
   4321  *
   4322  *  @callback_signature
   4323  *  @code
   4324  *  void function_name(GLFWwindow* window);
   4325  *  @endcode
   4326  *  For more information about the callback parameters, see the
   4327  *  [function pointer type](@ref GLFWwindowrefreshfun).
   4328  *
   4329  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4330  *
   4331  *  @thread_safety This function must only be called from the main thread.
   4332  *
   4333  *  @sa @ref window_refresh
   4334  *
   4335  *  @since Added in version 2.5.
   4336  *  @glfw3 Added window handle parameter and return value.
   4337  *
   4338  *  @ingroup window
   4339  */
   4340 GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun callback);
   4341 
   4342 /*! @brief Sets the focus callback for the specified window.
   4343  *
   4344  *  This function sets the focus callback of the specified window, which is
   4345  *  called when the window gains or loses input focus.
   4346  *
   4347  *  After the focus callback is called for a window that lost input focus,
   4348  *  synthetic key and mouse button release events will be generated for all such
   4349  *  that had been pressed.  For more information, see @ref glfwSetKeyCallback
   4350  *  and @ref glfwSetMouseButtonCallback.
   4351  *
   4352  *  @param[in] window The window whose callback to set.
   4353  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   4354  *  callback.
   4355  *  @return The previously set callback, or `NULL` if no callback was set or the
   4356  *  library had not been [initialized](@ref intro_init).
   4357  *
   4358  *  @callback_signature
   4359  *  @code
   4360  *  void function_name(GLFWwindow* window, int focused)
   4361  *  @endcode
   4362  *  For more information about the callback parameters, see the
   4363  *  [function pointer type](@ref GLFWwindowfocusfun).
   4364  *
   4365  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4366  *
   4367  *  @thread_safety This function must only be called from the main thread.
   4368  *
   4369  *  @sa @ref window_focus
   4370  *
   4371  *  @since Added in version 3.0.
   4372  *
   4373  *  @ingroup window
   4374  */
   4375 GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun callback);
   4376 
   4377 /*! @brief Sets the iconify callback for the specified window.
   4378  *
   4379  *  This function sets the iconification callback of the specified window, which
   4380  *  is called when the window is iconified or restored.
   4381  *
   4382  *  @param[in] window The window whose callback to set.
   4383  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   4384  *  callback.
   4385  *  @return The previously set callback, or `NULL` if no callback was set or the
   4386  *  library had not been [initialized](@ref intro_init).
   4387  *
   4388  *  @callback_signature
   4389  *  @code
   4390  *  void function_name(GLFWwindow* window, int iconified)
   4391  *  @endcode
   4392  *  For more information about the callback parameters, see the
   4393  *  [function pointer type](@ref GLFWwindowiconifyfun).
   4394  *
   4395  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4396  *
   4397  *  @thread_safety This function must only be called from the main thread.
   4398  *
   4399  *  @sa @ref window_iconify
   4400  *
   4401  *  @since Added in version 3.0.
   4402  *
   4403  *  @ingroup window
   4404  */
   4405 GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun callback);
   4406 
   4407 /*! @brief Sets the maximize callback for the specified window.
   4408  *
   4409  *  This function sets the maximization callback of the specified window, which
   4410  *  is called when the window is maximized or restored.
   4411  *
   4412  *  @param[in] window The window whose callback to set.
   4413  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   4414  *  callback.
   4415  *  @return The previously set callback, or `NULL` if no callback was set or the
   4416  *  library had not been [initialized](@ref intro_init).
   4417  *
   4418  *  @callback_signature
   4419  *  @code
   4420  *  void function_name(GLFWwindow* window, int maximized)
   4421  *  @endcode
   4422  *  For more information about the callback parameters, see the
   4423  *  [function pointer type](@ref GLFWwindowmaximizefun).
   4424  *
   4425  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4426  *
   4427  *  @thread_safety This function must only be called from the main thread.
   4428  *
   4429  *  @sa @ref window_maximize
   4430  *
   4431  *  @since Added in version 3.3.
   4432  *
   4433  *  @ingroup window
   4434  */
   4435 GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun callback);
   4436 
   4437 /*! @brief Sets the framebuffer resize callback for the specified window.
   4438  *
   4439  *  This function sets the framebuffer resize callback of the specified window,
   4440  *  which is called when the framebuffer of the specified window is resized.
   4441  *
   4442  *  @param[in] window The window whose callback to set.
   4443  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   4444  *  callback.
   4445  *  @return The previously set callback, or `NULL` if no callback was set or the
   4446  *  library had not been [initialized](@ref intro_init).
   4447  *
   4448  *  @callback_signature
   4449  *  @code
   4450  *  void function_name(GLFWwindow* window, int width, int height)
   4451  *  @endcode
   4452  *  For more information about the callback parameters, see the
   4453  *  [function pointer type](@ref GLFWframebuffersizefun).
   4454  *
   4455  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4456  *
   4457  *  @thread_safety This function must only be called from the main thread.
   4458  *
   4459  *  @sa @ref window_fbsize
   4460  *
   4461  *  @since Added in version 3.0.
   4462  *
   4463  *  @ingroup window
   4464  */
   4465 GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun callback);
   4466 
   4467 /*! @brief Sets the window content scale callback for the specified window.
   4468  *
   4469  *  This function sets the window content scale callback of the specified window,
   4470  *  which is called when the content scale of the specified window changes.
   4471  *
   4472  *  @param[in] window The window whose callback to set.
   4473  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   4474  *  callback.
   4475  *  @return The previously set callback, or `NULL` if no callback was set or the
   4476  *  library had not been [initialized](@ref intro_init).
   4477  *
   4478  *  @callback_signature
   4479  *  @code
   4480  *  void function_name(GLFWwindow* window, float xscale, float yscale)
   4481  *  @endcode
   4482  *  For more information about the callback parameters, see the
   4483  *  [function pointer type](@ref GLFWwindowcontentscalefun).
   4484  *
   4485  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4486  *
   4487  *  @thread_safety This function must only be called from the main thread.
   4488  *
   4489  *  @sa @ref window_scale
   4490  *  @sa @ref glfwGetWindowContentScale
   4491  *
   4492  *  @since Added in version 3.3.
   4493  *
   4494  *  @ingroup window
   4495  */
   4496 GLFWAPI GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* window, GLFWwindowcontentscalefun callback);
   4497 
   4498 /*! @brief Processes all pending events.
   4499  *
   4500  *  This function processes only those events that are already in the event
   4501  *  queue and then returns immediately.  Processing events will cause the window
   4502  *  and input callbacks associated with those events to be called.
   4503  *
   4504  *  On some platforms, a window move, resize or menu operation will cause event
   4505  *  processing to block.  This is due to how event processing is designed on
   4506  *  those platforms.  You can use the
   4507  *  [window refresh callback](@ref window_refresh) to redraw the contents of
   4508  *  your window when necessary during such operations.
   4509  *
   4510  *  Do not assume that callbacks you set will _only_ be called in response to
   4511  *  event processing functions like this one.  While it is necessary to poll for
   4512  *  events, window systems that require GLFW to register callbacks of its own
   4513  *  can pass events to GLFW in response to many window system function calls.
   4514  *  GLFW will pass those events on to the application callbacks before
   4515  *  returning.
   4516  *
   4517  *  Event processing is not required for joystick input to work.
   4518  *
   4519  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4520  *  GLFW_PLATFORM_ERROR.
   4521  *
   4522  *  @reentrancy This function must not be called from a callback.
   4523  *
   4524  *  @thread_safety This function must only be called from the main thread.
   4525  *
   4526  *  @sa @ref events
   4527  *  @sa @ref glfwWaitEvents
   4528  *  @sa @ref glfwWaitEventsTimeout
   4529  *
   4530  *  @since Added in version 1.0.
   4531  *
   4532  *  @ingroup window
   4533  */
   4534 GLFWAPI void glfwPollEvents(void);
   4535 
   4536 /*! @brief Waits until events are queued and processes them.
   4537  *
   4538  *  This function puts the calling thread to sleep until at least one event is
   4539  *  available in the event queue.  Once one or more events are available,
   4540  *  it behaves exactly like @ref glfwPollEvents, i.e. the events in the queue
   4541  *  are processed and the function then returns immediately.  Processing events
   4542  *  will cause the window and input callbacks associated with those events to be
   4543  *  called.
   4544  *
   4545  *  Since not all events are associated with callbacks, this function may return
   4546  *  without a callback having been called even if you are monitoring all
   4547  *  callbacks.
   4548  *
   4549  *  On some platforms, a window move, resize or menu operation will cause event
   4550  *  processing to block.  This is due to how event processing is designed on
   4551  *  those platforms.  You can use the
   4552  *  [window refresh callback](@ref window_refresh) to redraw the contents of
   4553  *  your window when necessary during such operations.
   4554  *
   4555  *  Do not assume that callbacks you set will _only_ be called in response to
   4556  *  event processing functions like this one.  While it is necessary to poll for
   4557  *  events, window systems that require GLFW to register callbacks of its own
   4558  *  can pass events to GLFW in response to many window system function calls.
   4559  *  GLFW will pass those events on to the application callbacks before
   4560  *  returning.
   4561  *
   4562  *  Event processing is not required for joystick input to work.
   4563  *
   4564  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4565  *  GLFW_PLATFORM_ERROR.
   4566  *
   4567  *  @reentrancy This function must not be called from a callback.
   4568  *
   4569  *  @thread_safety This function must only be called from the main thread.
   4570  *
   4571  *  @sa @ref events
   4572  *  @sa @ref glfwPollEvents
   4573  *  @sa @ref glfwWaitEventsTimeout
   4574  *
   4575  *  @since Added in version 2.5.
   4576  *
   4577  *  @ingroup window
   4578  */
   4579 GLFWAPI void glfwWaitEvents(void);
   4580 
   4581 /*! @brief Waits with timeout until events are queued and processes them.
   4582  *
   4583  *  This function puts the calling thread to sleep until at least one event is
   4584  *  available in the event queue, or until the specified timeout is reached.  If
   4585  *  one or more events are available, it behaves exactly like @ref
   4586  *  glfwPollEvents, i.e. the events in the queue are processed and the function
   4587  *  then returns immediately.  Processing events will cause the window and input
   4588  *  callbacks associated with those events to be called.
   4589  *
   4590  *  The timeout value must be a positive finite number.
   4591  *
   4592  *  Since not all events are associated with callbacks, this function may return
   4593  *  without a callback having been called even if you are monitoring all
   4594  *  callbacks.
   4595  *
   4596  *  On some platforms, a window move, resize or menu operation will cause event
   4597  *  processing to block.  This is due to how event processing is designed on
   4598  *  those platforms.  You can use the
   4599  *  [window refresh callback](@ref window_refresh) to redraw the contents of
   4600  *  your window when necessary during such operations.
   4601  *
   4602  *  Do not assume that callbacks you set will _only_ be called in response to
   4603  *  event processing functions like this one.  While it is necessary to poll for
   4604  *  events, window systems that require GLFW to register callbacks of its own
   4605  *  can pass events to GLFW in response to many window system function calls.
   4606  *  GLFW will pass those events on to the application callbacks before
   4607  *  returning.
   4608  *
   4609  *  Event processing is not required for joystick input to work.
   4610  *
   4611  *  @param[in] timeout The maximum amount of time, in seconds, to wait.
   4612  *
   4613  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4614  *  GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
   4615  *
   4616  *  @reentrancy This function must not be called from a callback.
   4617  *
   4618  *  @thread_safety This function must only be called from the main thread.
   4619  *
   4620  *  @sa @ref events
   4621  *  @sa @ref glfwPollEvents
   4622  *  @sa @ref glfwWaitEvents
   4623  *
   4624  *  @since Added in version 3.2.
   4625  *
   4626  *  @ingroup window
   4627  */
   4628 GLFWAPI void glfwWaitEventsTimeout(double timeout);
   4629 
   4630 /*! @brief Posts an empty event to the event queue.
   4631  *
   4632  *  This function posts an empty event from the current thread to the event
   4633  *  queue, causing @ref glfwWaitEvents or @ref glfwWaitEventsTimeout to return.
   4634  *
   4635  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4636  *  GLFW_PLATFORM_ERROR.
   4637  *
   4638  *  @thread_safety This function may be called from any thread.
   4639  *
   4640  *  @sa @ref events
   4641  *  @sa @ref glfwWaitEvents
   4642  *  @sa @ref glfwWaitEventsTimeout
   4643  *
   4644  *  @since Added in version 3.1.
   4645  *
   4646  *  @ingroup window
   4647  */
   4648 GLFWAPI void glfwPostEmptyEvent(void);
   4649 
   4650 /*! @brief Returns the value of an input option for the specified window.
   4651  *
   4652  *  This function returns the value of an input option for the specified window.
   4653  *  The mode must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS,
   4654  *  @ref GLFW_STICKY_MOUSE_BUTTONS, @ref GLFW_LOCK_KEY_MODS or
   4655  *  @ref GLFW_RAW_MOUSE_MOTION.
   4656  *
   4657  *  @param[in] window The window to query.
   4658  *  @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS`,
   4659  *  `GLFW_STICKY_MOUSE_BUTTONS`, `GLFW_LOCK_KEY_MODS` or
   4660  *  `GLFW_RAW_MOUSE_MOTION`.
   4661  *
   4662  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4663  *  GLFW_INVALID_ENUM.
   4664  *
   4665  *  @thread_safety This function must only be called from the main thread.
   4666  *
   4667  *  @sa @ref glfwSetInputMode
   4668  *
   4669  *  @since Added in version 3.0.
   4670  *
   4671  *  @ingroup input
   4672  */
   4673 GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);
   4674 
   4675 /*! @brief Sets an input option for the specified window.
   4676  *
   4677  *  This function sets an input mode option for the specified window.  The mode
   4678  *  must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS,
   4679  *  @ref GLFW_STICKY_MOUSE_BUTTONS, @ref GLFW_LOCK_KEY_MODS or
   4680  *  @ref GLFW_RAW_MOUSE_MOTION.
   4681  *
   4682  *  If the mode is `GLFW_CURSOR`, the value must be one of the following cursor
   4683  *  modes:
   4684  *  - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally.
   4685  *  - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the
   4686  *    content area of the window but does not restrict the cursor from leaving.
   4687  *  - `GLFW_CURSOR_DISABLED` hides and grabs the cursor, providing virtual
   4688  *    and unlimited cursor movement.  This is useful for implementing for
   4689  *    example 3D camera controls.
   4690  *  - `GLFW_CURSOR_CAPTURED` makes the cursor visible and confines it to the
   4691  *    content area of the window.
   4692  *
   4693  *  If the mode is `GLFW_STICKY_KEYS`, the value must be either `GLFW_TRUE` to
   4694  *  enable sticky keys, or `GLFW_FALSE` to disable it.  If sticky keys are
   4695  *  enabled, a key press will ensure that @ref glfwGetKey returns `GLFW_PRESS`
   4696  *  the next time it is called even if the key had been released before the
   4697  *  call.  This is useful when you are only interested in whether keys have been
   4698  *  pressed but not when or in which order.
   4699  *
   4700  *  If the mode is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either
   4701  *  `GLFW_TRUE` to enable sticky mouse buttons, or `GLFW_FALSE` to disable it.
   4702  *  If sticky mouse buttons are enabled, a mouse button press will ensure that
   4703  *  @ref glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even
   4704  *  if the mouse button had been released before the call.  This is useful when
   4705  *  you are only interested in whether mouse buttons have been pressed but not
   4706  *  when or in which order.
   4707  *
   4708  *  If the mode is `GLFW_LOCK_KEY_MODS`, the value must be either `GLFW_TRUE` to
   4709  *  enable lock key modifier bits, or `GLFW_FALSE` to disable them.  If enabled,
   4710  *  callbacks that receive modifier bits will also have the @ref
   4711  *  GLFW_MOD_CAPS_LOCK bit set when the event was generated with Caps Lock on,
   4712  *  and the @ref GLFW_MOD_NUM_LOCK bit when Num Lock was on.
   4713  *
   4714  *  If the mode is `GLFW_RAW_MOUSE_MOTION`, the value must be either `GLFW_TRUE`
   4715  *  to enable raw (unscaled and unaccelerated) mouse motion when the cursor is
   4716  *  disabled, or `GLFW_FALSE` to disable it.  If raw motion is not supported,
   4717  *  attempting to set this will emit @ref GLFW_FEATURE_UNAVAILABLE.  Call @ref
   4718  *  glfwRawMouseMotionSupported to check for support.
   4719  *
   4720  *  @param[in] window The window whose input mode to set.
   4721  *  @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS`,
   4722  *  `GLFW_STICKY_MOUSE_BUTTONS`, `GLFW_LOCK_KEY_MODS` or
   4723  *  `GLFW_RAW_MOUSE_MOTION`.
   4724  *  @param[in] value The new value of the specified input mode.
   4725  *
   4726  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4727  *  GLFW_INVALID_ENUM, @ref GLFW_PLATFORM_ERROR and @ref
   4728  *  GLFW_FEATURE_UNAVAILABLE (see above).
   4729  *
   4730  *  @thread_safety This function must only be called from the main thread.
   4731  *
   4732  *  @sa @ref glfwGetInputMode
   4733  *
   4734  *  @since Added in version 3.0.  Replaces `glfwEnable` and `glfwDisable`.
   4735  *
   4736  *  @ingroup input
   4737  */
   4738 GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value);
   4739 
   4740 /*! @brief Returns whether raw mouse motion is supported.
   4741  *
   4742  *  This function returns whether raw mouse motion is supported on the current
   4743  *  system.  This status does not change after GLFW has been initialized so you
   4744  *  only need to check this once.  If you attempt to enable raw motion on
   4745  *  a system that does not support it, @ref GLFW_PLATFORM_ERROR will be emitted.
   4746  *
   4747  *  Raw mouse motion is closer to the actual motion of the mouse across
   4748  *  a surface.  It is not affected by the scaling and acceleration applied to
   4749  *  the motion of the desktop cursor.  That processing is suitable for a cursor
   4750  *  while raw motion is better for controlling for example a 3D camera.  Because
   4751  *  of this, raw mouse motion is only provided when the cursor is disabled.
   4752  *
   4753  *  @return `GLFW_TRUE` if raw mouse motion is supported on the current machine,
   4754  *  or `GLFW_FALSE` otherwise.
   4755  *
   4756  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   4757  *
   4758  *  @thread_safety This function must only be called from the main thread.
   4759  *
   4760  *  @sa @ref raw_mouse_motion
   4761  *  @sa @ref glfwSetInputMode
   4762  *
   4763  *  @since Added in version 3.3.
   4764  *
   4765  *  @ingroup input
   4766  */
   4767 GLFWAPI int glfwRawMouseMotionSupported(void);
   4768 
   4769 /*! @brief Returns the layout-specific name of the specified printable key.
   4770  *
   4771  *  This function returns the name of the specified printable key, encoded as
   4772  *  UTF-8.  This is typically the character that key would produce without any
   4773  *  modifier keys, intended for displaying key bindings to the user.  For dead
   4774  *  keys, it is typically the diacritic it would add to a character.
   4775  *
   4776  *  __Do not use this function__ for [text input](@ref input_char).  You will
   4777  *  break text input for many languages even if it happens to work for yours.
   4778  *
   4779  *  If the key is `GLFW_KEY_UNKNOWN`, the scancode is used to identify the key,
   4780  *  otherwise the scancode is ignored.  If you specify a non-printable key, or
   4781  *  `GLFW_KEY_UNKNOWN` and a scancode that maps to a non-printable key, this
   4782  *  function returns `NULL` but does not emit an error.
   4783  *
   4784  *  This behavior allows you to always pass in the arguments in the
   4785  *  [key callback](@ref input_key) without modification.
   4786  *
   4787  *  The printable keys are:
   4788  *  - `GLFW_KEY_APOSTROPHE`
   4789  *  - `GLFW_KEY_COMMA`
   4790  *  - `GLFW_KEY_MINUS`
   4791  *  - `GLFW_KEY_PERIOD`
   4792  *  - `GLFW_KEY_SLASH`
   4793  *  - `GLFW_KEY_SEMICOLON`
   4794  *  - `GLFW_KEY_EQUAL`
   4795  *  - `GLFW_KEY_LEFT_BRACKET`
   4796  *  - `GLFW_KEY_RIGHT_BRACKET`
   4797  *  - `GLFW_KEY_BACKSLASH`
   4798  *  - `GLFW_KEY_WORLD_1`
   4799  *  - `GLFW_KEY_WORLD_2`
   4800  *  - `GLFW_KEY_0` to `GLFW_KEY_9`
   4801  *  - `GLFW_KEY_A` to `GLFW_KEY_Z`
   4802  *  - `GLFW_KEY_KP_0` to `GLFW_KEY_KP_9`
   4803  *  - `GLFW_KEY_KP_DECIMAL`
   4804  *  - `GLFW_KEY_KP_DIVIDE`
   4805  *  - `GLFW_KEY_KP_MULTIPLY`
   4806  *  - `GLFW_KEY_KP_SUBTRACT`
   4807  *  - `GLFW_KEY_KP_ADD`
   4808  *  - `GLFW_KEY_KP_EQUAL`
   4809  *
   4810  *  Names for printable keys depend on keyboard layout, while names for
   4811  *  non-printable keys are the same across layouts but depend on the application
   4812  *  language and should be localized along with other user interface text.
   4813  *
   4814  *  @param[in] key The key to query, or `GLFW_KEY_UNKNOWN`.
   4815  *  @param[in] scancode The scancode of the key to query.
   4816  *  @return The UTF-8 encoded, layout-specific name of the key, or `NULL`.
   4817  *
   4818  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4819  *  GLFW_INVALID_VALUE, @ref GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   4820  *
   4821  *  @remark The contents of the returned string may change when a keyboard
   4822  *  layout change event is received.
   4823  *
   4824  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   4825  *  should not free it yourself.  It is valid until the library is terminated.
   4826  *
   4827  *  @thread_safety This function must only be called from the main thread.
   4828  *
   4829  *  @sa @ref input_key_name
   4830  *
   4831  *  @since Added in version 3.2.
   4832  *
   4833  *  @ingroup input
   4834  */
   4835 GLFWAPI const char* glfwGetKeyName(int key, int scancode);
   4836 
   4837 /*! @brief Returns the platform-specific scancode of the specified key.
   4838  *
   4839  *  This function returns the platform-specific scancode of the specified key.
   4840  *
   4841  *  If the specified [key token](@ref keys) corresponds to a physical key not
   4842  *  supported on the current platform then this method will return `-1`.
   4843  *  Calling this function with anything other than a key token will return `-1`
   4844  *  and generate a @ref GLFW_INVALID_ENUM error.
   4845  *
   4846  *  @param[in] key Any [key token](@ref keys).
   4847  *  @return The platform-specific scancode for the key, or `-1` if the key is
   4848  *  not supported on the current platform or an [error](@ref error_handling)
   4849  *  occurred.
   4850  *
   4851  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4852  *  GLFW_INVALID_ENUM.
   4853  *
   4854  *  @thread_safety This function may be called from any thread.
   4855  *
   4856  *  @sa @ref input_key
   4857  *
   4858  *  @since Added in version 3.3.
   4859  *
   4860  *  @ingroup input
   4861  */
   4862 GLFWAPI int glfwGetKeyScancode(int key);
   4863 
   4864 /*! @brief Returns the last reported state of a keyboard key for the specified
   4865  *  window.
   4866  *
   4867  *  This function returns the last state reported for the specified key to the
   4868  *  specified window.  The returned state is one of `GLFW_PRESS` or
   4869  *  `GLFW_RELEASE`.  The action `GLFW_REPEAT` is only reported to the key callback.
   4870  *
   4871  *  If the @ref GLFW_STICKY_KEYS input mode is enabled, this function returns
   4872  *  `GLFW_PRESS` the first time you call it for a key that was pressed, even if
   4873  *  that key has already been released.
   4874  *
   4875  *  The key functions deal with physical keys, with [key tokens](@ref keys)
   4876  *  named after their use on the standard US keyboard layout.  If you want to
   4877  *  input text, use the Unicode character callback instead.
   4878  *
   4879  *  The [modifier key bit masks](@ref mods) are not key tokens and cannot be
   4880  *  used with this function.
   4881  *
   4882  *  __Do not use this function__ to implement [text input](@ref input_char).
   4883  *
   4884  *  @param[in] window The desired window.
   4885  *  @param[in] key The desired [keyboard key](@ref keys).  `GLFW_KEY_UNKNOWN` is
   4886  *  not a valid key for this function.
   4887  *  @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
   4888  *
   4889  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4890  *  GLFW_INVALID_ENUM.
   4891  *
   4892  *  @thread_safety This function must only be called from the main thread.
   4893  *
   4894  *  @sa @ref input_key
   4895  *
   4896  *  @since Added in version 1.0.
   4897  *  @glfw3 Added window handle parameter.
   4898  *
   4899  *  @ingroup input
   4900  */
   4901 GLFWAPI int glfwGetKey(GLFWwindow* window, int key);
   4902 
   4903 /*! @brief Returns the last reported state of a mouse button for the specified
   4904  *  window.
   4905  *
   4906  *  This function returns the last state reported for the specified mouse button
   4907  *  to the specified window.  The returned state is one of `GLFW_PRESS` or
   4908  *  `GLFW_RELEASE`.
   4909  *
   4910  *  If the @ref GLFW_STICKY_MOUSE_BUTTONS input mode is enabled, this function
   4911  *  returns `GLFW_PRESS` the first time you call it for a mouse button that was
   4912  *  pressed, even if that mouse button has already been released.
   4913  *
   4914  *  @param[in] window The desired window.
   4915  *  @param[in] button The desired [mouse button](@ref buttons).
   4916  *  @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
   4917  *
   4918  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4919  *  GLFW_INVALID_ENUM.
   4920  *
   4921  *  @thread_safety This function must only be called from the main thread.
   4922  *
   4923  *  @sa @ref input_mouse_button
   4924  *
   4925  *  @since Added in version 1.0.
   4926  *  @glfw3 Added window handle parameter.
   4927  *
   4928  *  @ingroup input
   4929  */
   4930 GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button);
   4931 
   4932 /*! @brief Retrieves the position of the cursor relative to the content area of
   4933  *  the window.
   4934  *
   4935  *  This function returns the position of the cursor, in screen coordinates,
   4936  *  relative to the upper-left corner of the content area of the specified
   4937  *  window.
   4938  *
   4939  *  If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor
   4940  *  position is unbounded and limited only by the minimum and maximum values of
   4941  *  a `double`.
   4942  *
   4943  *  The coordinate can be converted to their integer equivalents with the
   4944  *  `floor` function.  Casting directly to an integer type works for positive
   4945  *  coordinates, but fails for negative ones.
   4946  *
   4947  *  Any or all of the position arguments may be `NULL`.  If an error occurs, all
   4948  *  non-`NULL` position arguments will be set to zero.
   4949  *
   4950  *  @param[in] window The desired window.
   4951  *  @param[out] xpos Where to store the cursor x-coordinate, relative to the
   4952  *  left edge of the content area, or `NULL`.
   4953  *  @param[out] ypos Where to store the cursor y-coordinate, relative to the to
   4954  *  top edge of the content area, or `NULL`.
   4955  *
   4956  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   4957  *  GLFW_PLATFORM_ERROR.
   4958  *
   4959  *  @thread_safety This function must only be called from the main thread.
   4960  *
   4961  *  @sa @ref cursor_pos
   4962  *  @sa @ref glfwSetCursorPos
   4963  *
   4964  *  @since Added in version 3.0.  Replaces `glfwGetMousePos`.
   4965  *
   4966  *  @ingroup input
   4967  */
   4968 GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);
   4969 
   4970 /*! @brief Sets the position of the cursor, relative to the content area of the
   4971  *  window.
   4972  *
   4973  *  This function sets the position, in screen coordinates, of the cursor
   4974  *  relative to the upper-left corner of the content area of the specified
   4975  *  window.  The window must have input focus.  If the window does not have
   4976  *  input focus when this function is called, it fails silently.
   4977  *
   4978  *  __Do not use this function__ to implement things like camera controls.  GLFW
   4979  *  already provides the `GLFW_CURSOR_DISABLED` cursor mode that hides the
   4980  *  cursor, transparently re-centers it and provides unconstrained cursor
   4981  *  motion.  See @ref glfwSetInputMode for more information.
   4982  *
   4983  *  If the cursor mode is `GLFW_CURSOR_DISABLED` then the cursor position is
   4984  *  unconstrained and limited only by the minimum and maximum values of
   4985  *  a `double`.
   4986  *
   4987  *  @param[in] window The desired window.
   4988  *  @param[in] xpos The desired x-coordinate, relative to the left edge of the
   4989  *  content area.
   4990  *  @param[in] ypos The desired y-coordinate, relative to the top edge of the
   4991  *  content area.
   4992  *
   4993  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   4994  *  GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
   4995  *
   4996  *  @remark @wayland This function will only work when the cursor mode is
   4997  *  `GLFW_CURSOR_DISABLED`, otherwise it will emit @ref GLFW_FEATURE_UNAVAILABLE.
   4998  *
   4999  *  @thread_safety This function must only be called from the main thread.
   5000  *
   5001  *  @sa @ref cursor_pos
   5002  *  @sa @ref glfwGetCursorPos
   5003  *
   5004  *  @since Added in version 3.0.  Replaces `glfwSetMousePos`.
   5005  *
   5006  *  @ingroup input
   5007  */
   5008 GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);
   5009 
   5010 /*! @brief Creates a custom cursor.
   5011  *
   5012  *  Creates a new custom cursor image that can be set for a window with @ref
   5013  *  glfwSetCursor.  The cursor can be destroyed with @ref glfwDestroyCursor.
   5014  *  Any remaining cursors are destroyed by @ref glfwTerminate.
   5015  *
   5016  *  The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight
   5017  *  bits per channel with the red channel first.  They are arranged canonically
   5018  *  as packed sequential rows, starting from the top-left corner.
   5019  *
   5020  *  The cursor hotspot is specified in pixels, relative to the upper-left corner
   5021  *  of the cursor image.  Like all other coordinate systems in GLFW, the X-axis
   5022  *  points to the right and the Y-axis points down.
   5023  *
   5024  *  @param[in] image The desired cursor image.
   5025  *  @param[in] xhot The desired x-coordinate, in pixels, of the cursor hotspot.
   5026  *  @param[in] yhot The desired y-coordinate, in pixels, of the cursor hotspot.
   5027  *  @return The handle of the created cursor, or `NULL` if an
   5028  *  [error](@ref error_handling) occurred.
   5029  *
   5030  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   5031  *  GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
   5032  *
   5033  *  @pointer_lifetime The specified image data is copied before this function
   5034  *  returns.
   5035  *
   5036  *  @thread_safety This function must only be called from the main thread.
   5037  *
   5038  *  @sa @ref cursor_object
   5039  *  @sa @ref glfwDestroyCursor
   5040  *  @sa @ref glfwCreateStandardCursor
   5041  *
   5042  *  @since Added in version 3.1.
   5043  *
   5044  *  @ingroup input
   5045  */
   5046 GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot);
   5047 
   5048 /*! @brief Creates a cursor with a standard shape.
   5049  *
   5050  *  Returns a cursor with a standard shape, that can be set for a window with
   5051  *  @ref glfwSetCursor.  The images for these cursors come from the system
   5052  *  cursor theme and their exact appearance will vary between platforms.
   5053  *
   5054  *  Most of these shapes are guaranteed to exist on every supported platform but
   5055  *  a few may not be present.  See the table below for details.
   5056  *
   5057  *  Cursor shape                   | Windows | macOS | X11    | Wayland
   5058  *  ------------------------------ | ------- | ----- | ------ | -------
   5059  *  @ref GLFW_ARROW_CURSOR         | Yes     | Yes   | Yes    | Yes
   5060  *  @ref GLFW_IBEAM_CURSOR         | Yes     | Yes   | Yes    | Yes
   5061  *  @ref GLFW_CROSSHAIR_CURSOR     | Yes     | Yes   | Yes    | Yes
   5062  *  @ref GLFW_POINTING_HAND_CURSOR | Yes     | Yes   | Yes    | Yes
   5063  *  @ref GLFW_RESIZE_EW_CURSOR     | Yes     | Yes   | Yes    | Yes
   5064  *  @ref GLFW_RESIZE_NS_CURSOR     | Yes     | Yes   | Yes    | Yes
   5065  *  @ref GLFW_RESIZE_NWSE_CURSOR   | Yes     | Yes<sup>1</sup> | Maybe<sup>2</sup> | Maybe<sup>2</sup>
   5066  *  @ref GLFW_RESIZE_NESW_CURSOR   | Yes     | Yes<sup>1</sup> | Maybe<sup>2</sup> | Maybe<sup>2</sup>
   5067  *  @ref GLFW_RESIZE_ALL_CURSOR    | Yes     | Yes   | Yes    | Yes
   5068  *  @ref GLFW_NOT_ALLOWED_CURSOR   | Yes     | Yes   | Maybe<sup>2</sup> | Maybe<sup>2</sup>
   5069  *
   5070  *  1) This uses a private system API and may fail in the future.
   5071  *
   5072  *  2) This uses a newer standard that not all cursor themes support.
   5073  *
   5074  *  If the requested shape is not available, this function emits a @ref
   5075  *  GLFW_CURSOR_UNAVAILABLE error and returns `NULL`.
   5076  *
   5077  *  @param[in] shape One of the [standard shapes](@ref shapes).
   5078  *  @return A new cursor ready to use or `NULL` if an
   5079  *  [error](@ref error_handling) occurred.
   5080  *
   5081  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   5082  *  GLFW_INVALID_ENUM, @ref GLFW_CURSOR_UNAVAILABLE and @ref
   5083  *  GLFW_PLATFORM_ERROR.
   5084  *
   5085  *  @thread_safety This function must only be called from the main thread.
   5086  *
   5087  *  @sa @ref cursor_standard
   5088  *  @sa @ref glfwCreateCursor
   5089  *
   5090  *  @since Added in version 3.1.
   5091  *
   5092  *  @ingroup input
   5093  */
   5094 GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape);
   5095 
   5096 /*! @brief Destroys a cursor.
   5097  *
   5098  *  This function destroys a cursor previously created with @ref
   5099  *  glfwCreateCursor.  Any remaining cursors will be destroyed by @ref
   5100  *  glfwTerminate.
   5101  *
   5102  *  If the specified cursor is current for any window, that window will be
   5103  *  reverted to the default cursor.  This does not affect the cursor mode.
   5104  *
   5105  *  @param[in] cursor The cursor object to destroy.
   5106  *
   5107  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   5108  *  GLFW_PLATFORM_ERROR.
   5109  *
   5110  *  @reentrancy This function must not be called from a callback.
   5111  *
   5112  *  @thread_safety This function must only be called from the main thread.
   5113  *
   5114  *  @sa @ref cursor_object
   5115  *  @sa @ref glfwCreateCursor
   5116  *
   5117  *  @since Added in version 3.1.
   5118  *
   5119  *  @ingroup input
   5120  */
   5121 GLFWAPI void glfwDestroyCursor(GLFWcursor* cursor);
   5122 
   5123 /*! @brief Sets the cursor for the window.
   5124  *
   5125  *  This function sets the cursor image to be used when the cursor is over the
   5126  *  content area of the specified window.  The set cursor will only be visible
   5127  *  when the [cursor mode](@ref cursor_mode) of the window is
   5128  *  `GLFW_CURSOR_NORMAL`.
   5129  *
   5130  *  On some platforms, the set cursor may not be visible unless the window also
   5131  *  has input focus.
   5132  *
   5133  *  @param[in] window The window to set the cursor for.
   5134  *  @param[in] cursor The cursor to set, or `NULL` to switch back to the default
   5135  *  arrow cursor.
   5136  *
   5137  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   5138  *  GLFW_PLATFORM_ERROR.
   5139  *
   5140  *  @thread_safety This function must only be called from the main thread.
   5141  *
   5142  *  @sa @ref cursor_object
   5143  *
   5144  *  @since Added in version 3.1.
   5145  *
   5146  *  @ingroup input
   5147  */
   5148 GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
   5149 
   5150 /*! @brief Sets the key callback.
   5151  *
   5152  *  This function sets the key callback of the specified window, which is called
   5153  *  when a key is pressed, repeated or released.
   5154  *
   5155  *  The key functions deal with physical keys, with layout independent
   5156  *  [key tokens](@ref keys) named after their values in the standard US keyboard
   5157  *  layout.  If you want to input text, use the
   5158  *  [character callback](@ref glfwSetCharCallback) instead.
   5159  *
   5160  *  When a window loses input focus, it will generate synthetic key release
   5161  *  events for all pressed keys with associated key tokens.  You can tell these
   5162  *  events from user-generated events by the fact that the synthetic ones are
   5163  *  generated after the focus loss event has been processed, i.e. after the
   5164  *  [window focus callback](@ref glfwSetWindowFocusCallback) has been called.
   5165  *
   5166  *  The scancode of a key is specific to that platform or sometimes even to that
   5167  *  machine.  Scancodes are intended to allow users to bind keys that don't have
   5168  *  a GLFW key token.  Such keys have `key` set to `GLFW_KEY_UNKNOWN`, their
   5169  *  state is not saved and so it cannot be queried with @ref glfwGetKey.
   5170  *
   5171  *  Sometimes GLFW needs to generate synthetic key events, in which case the
   5172  *  scancode may be zero.
   5173  *
   5174  *  @param[in] window The window whose callback to set.
   5175  *  @param[in] callback The new key callback, or `NULL` to remove the currently
   5176  *  set callback.
   5177  *  @return The previously set callback, or `NULL` if no callback was set or the
   5178  *  library had not been [initialized](@ref intro_init).
   5179  *
   5180  *  @callback_signature
   5181  *  @code
   5182  *  void function_name(GLFWwindow* window, int key, int scancode, int action, int mods)
   5183  *  @endcode
   5184  *  For more information about the callback parameters, see the
   5185  *  [function pointer type](@ref GLFWkeyfun).
   5186  *
   5187  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   5188  *
   5189  *  @thread_safety This function must only be called from the main thread.
   5190  *
   5191  *  @sa @ref input_key
   5192  *
   5193  *  @since Added in version 1.0.
   5194  *  @glfw3 Added window handle parameter and return value.
   5195  *
   5196  *  @ingroup input
   5197  */
   5198 GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun callback);
   5199 
   5200 /*! @brief Sets the Unicode character callback.
   5201  *
   5202  *  This function sets the character callback of the specified window, which is
   5203  *  called when a Unicode character is input.
   5204  *
   5205  *  The character callback is intended for Unicode text input.  As it deals with
   5206  *  characters, it is keyboard layout dependent, whereas the
   5207  *  [key callback](@ref glfwSetKeyCallback) is not.  Characters do not map 1:1
   5208  *  to physical keys, as a key may produce zero, one or more characters.  If you
   5209  *  want to know whether a specific physical key was pressed or released, see
   5210  *  the key callback instead.
   5211  *
   5212  *  The character callback behaves as system text input normally does and will
   5213  *  not be called if modifier keys are held down that would prevent normal text
   5214  *  input on that platform, for example a Super (Command) key on macOS or Alt key
   5215  *  on Windows.
   5216  *
   5217  *  @param[in] window The window whose callback to set.
   5218  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   5219  *  callback.
   5220  *  @return The previously set callback, or `NULL` if no callback was set or the
   5221  *  library had not been [initialized](@ref intro_init).
   5222  *
   5223  *  @callback_signature
   5224  *  @code
   5225  *  void function_name(GLFWwindow* window, unsigned int codepoint)
   5226  *  @endcode
   5227  *  For more information about the callback parameters, see the
   5228  *  [function pointer type](@ref GLFWcharfun).
   5229  *
   5230  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   5231  *
   5232  *  @thread_safety This function must only be called from the main thread.
   5233  *
   5234  *  @sa @ref input_char
   5235  *
   5236  *  @since Added in version 2.4.
   5237  *  @glfw3 Added window handle parameter and return value.
   5238  *
   5239  *  @ingroup input
   5240  */
   5241 GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun callback);
   5242 
   5243 /*! @brief Sets the Unicode character with modifiers callback.
   5244  *
   5245  *  This function sets the character with modifiers callback of the specified
   5246  *  window, which is called when a Unicode character is input regardless of what
   5247  *  modifier keys are used.
   5248  *
   5249  *  The character with modifiers callback is intended for implementing custom
   5250  *  Unicode character input.  For regular Unicode text input, see the
   5251  *  [character callback](@ref glfwSetCharCallback).  Like the character
   5252  *  callback, the character with modifiers callback deals with characters and is
   5253  *  keyboard layout dependent.  Characters do not map 1:1 to physical keys, as
   5254  *  a key may produce zero, one or more characters.  If you want to know whether
   5255  *  a specific physical key was pressed or released, see the
   5256  *  [key callback](@ref glfwSetKeyCallback) instead.
   5257  *
   5258  *  @param[in] window The window whose callback to set.
   5259  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   5260  *  callback.
   5261  *  @return The previously set callback, or `NULL` if no callback was set or an
   5262  *  [error](@ref error_handling) occurred.
   5263  *
   5264  *  @callback_signature
   5265  *  @code
   5266  *  void function_name(GLFWwindow* window, unsigned int codepoint, int mods)
   5267  *  @endcode
   5268  *  For more information about the callback parameters, see the
   5269  *  [function pointer type](@ref GLFWcharmodsfun).
   5270  *
   5271  *  @deprecated Scheduled for removal in version 4.0.
   5272  *
   5273  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   5274  *
   5275  *  @thread_safety This function must only be called from the main thread.
   5276  *
   5277  *  @sa @ref input_char
   5278  *
   5279  *  @since Added in version 3.1.
   5280  *
   5281  *  @ingroup input
   5282  */
   5283 GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun callback);
   5284 
   5285 /*! @brief Sets the mouse button callback.
   5286  *
   5287  *  This function sets the mouse button callback of the specified window, which
   5288  *  is called when a mouse button is pressed or released.
   5289  *
   5290  *  When a window loses input focus, it will generate synthetic mouse button
   5291  *  release events for all pressed mouse buttons.  You can tell these events
   5292  *  from user-generated events by the fact that the synthetic ones are generated
   5293  *  after the focus loss event has been processed, i.e. after the
   5294  *  [window focus callback](@ref glfwSetWindowFocusCallback) has been called.
   5295  *
   5296  *  @param[in] window The window whose callback to set.
   5297  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   5298  *  callback.
   5299  *  @return The previously set callback, or `NULL` if no callback was set or the
   5300  *  library had not been [initialized](@ref intro_init).
   5301  *
   5302  *  @callback_signature
   5303  *  @code
   5304  *  void function_name(GLFWwindow* window, int button, int action, int mods)
   5305  *  @endcode
   5306  *  For more information about the callback parameters, see the
   5307  *  [function pointer type](@ref GLFWmousebuttonfun).
   5308  *
   5309  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   5310  *
   5311  *  @thread_safety This function must only be called from the main thread.
   5312  *
   5313  *  @sa @ref input_mouse_button
   5314  *
   5315  *  @since Added in version 1.0.
   5316  *  @glfw3 Added window handle parameter and return value.
   5317  *
   5318  *  @ingroup input
   5319  */
   5320 GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun callback);
   5321 
   5322 /*! @brief Sets the cursor position callback.
   5323  *
   5324  *  This function sets the cursor position callback of the specified window,
   5325  *  which is called when the cursor is moved.  The callback is provided with the
   5326  *  position, in screen coordinates, relative to the upper-left corner of the
   5327  *  content area of the window.
   5328  *
   5329  *  @param[in] window The window whose callback to set.
   5330  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   5331  *  callback.
   5332  *  @return The previously set callback, or `NULL` if no callback was set or the
   5333  *  library had not been [initialized](@ref intro_init).
   5334  *
   5335  *  @callback_signature
   5336  *  @code
   5337  *  void function_name(GLFWwindow* window, double xpos, double ypos);
   5338  *  @endcode
   5339  *  For more information about the callback parameters, see the
   5340  *  [function pointer type](@ref GLFWcursorposfun).
   5341  *
   5342  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   5343  *
   5344  *  @thread_safety This function must only be called from the main thread.
   5345  *
   5346  *  @sa @ref cursor_pos
   5347  *
   5348  *  @since Added in version 3.0.  Replaces `glfwSetMousePosCallback`.
   5349  *
   5350  *  @ingroup input
   5351  */
   5352 GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun callback);
   5353 
   5354 /*! @brief Sets the cursor enter/leave callback.
   5355  *
   5356  *  This function sets the cursor boundary crossing callback of the specified
   5357  *  window, which is called when the cursor enters or leaves the content area of
   5358  *  the window.
   5359  *
   5360  *  @param[in] window The window whose callback to set.
   5361  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   5362  *  callback.
   5363  *  @return The previously set callback, or `NULL` if no callback was set or the
   5364  *  library had not been [initialized](@ref intro_init).
   5365  *
   5366  *  @callback_signature
   5367  *  @code
   5368  *  void function_name(GLFWwindow* window, int entered)
   5369  *  @endcode
   5370  *  For more information about the callback parameters, see the
   5371  *  [function pointer type](@ref GLFWcursorenterfun).
   5372  *
   5373  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   5374  *
   5375  *  @thread_safety This function must only be called from the main thread.
   5376  *
   5377  *  @sa @ref cursor_enter
   5378  *
   5379  *  @since Added in version 3.0.
   5380  *
   5381  *  @ingroup input
   5382  */
   5383 GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun callback);
   5384 
   5385 /*! @brief Sets the scroll callback.
   5386  *
   5387  *  This function sets the scroll callback of the specified window, which is
   5388  *  called when a scrolling device is used, such as a mouse wheel or scrolling
   5389  *  area of a touchpad.
   5390  *
   5391  *  The scroll callback receives all scrolling input, like that from a mouse
   5392  *  wheel or a touchpad scrolling area.
   5393  *
   5394  *  @param[in] window The window whose callback to set.
   5395  *  @param[in] callback The new scroll callback, or `NULL` to remove the
   5396  *  currently set callback.
   5397  *  @return The previously set callback, or `NULL` if no callback was set or the
   5398  *  library had not been [initialized](@ref intro_init).
   5399  *
   5400  *  @callback_signature
   5401  *  @code
   5402  *  void function_name(GLFWwindow* window, double xoffset, double yoffset)
   5403  *  @endcode
   5404  *  For more information about the callback parameters, see the
   5405  *  [function pointer type](@ref GLFWscrollfun).
   5406  *
   5407  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   5408  *
   5409  *  @thread_safety This function must only be called from the main thread.
   5410  *
   5411  *  @sa @ref scrolling
   5412  *
   5413  *  @since Added in version 3.0.  Replaces `glfwSetMouseWheelCallback`.
   5414  *
   5415  *  @ingroup input
   5416  */
   5417 GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun callback);
   5418 
   5419 /*! @brief Sets the path drop callback.
   5420  *
   5421  *  This function sets the path drop callback of the specified window, which is
   5422  *  called when one or more dragged paths are dropped on the window.
   5423  *
   5424  *  Because the path array and its strings may have been generated specifically
   5425  *  for that event, they are not guaranteed to be valid after the callback has
   5426  *  returned.  If you wish to use them after the callback returns, you need to
   5427  *  make a deep copy.
   5428  *
   5429  *  @param[in] window The window whose callback to set.
   5430  *  @param[in] callback The new file drop callback, or `NULL` to remove the
   5431  *  currently set callback.
   5432  *  @return The previously set callback, or `NULL` if no callback was set or the
   5433  *  library had not been [initialized](@ref intro_init).
   5434  *
   5435  *  @callback_signature
   5436  *  @code
   5437  *  void function_name(GLFWwindow* window, int path_count, const char* paths[])
   5438  *  @endcode
   5439  *  For more information about the callback parameters, see the
   5440  *  [function pointer type](@ref GLFWdropfun).
   5441  *
   5442  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   5443  *
   5444  *  @thread_safety This function must only be called from the main thread.
   5445  *
   5446  *  @sa @ref path_drop
   5447  *
   5448  *  @since Added in version 3.1.
   5449  *
   5450  *  @ingroup input
   5451  */
   5452 GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun callback);
   5453 
   5454 /*! @brief Returns whether the specified joystick is present.
   5455  *
   5456  *  This function returns whether the specified joystick is present.
   5457  *
   5458  *  There is no need to call this function before other functions that accept
   5459  *  a joystick ID, as they all check for presence before performing any other
   5460  *  work.
   5461  *
   5462  *  @param[in] jid The [joystick](@ref joysticks) to query.
   5463  *  @return `GLFW_TRUE` if the joystick is present, or `GLFW_FALSE` otherwise.
   5464  *
   5465  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   5466  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   5467  *
   5468  *  @thread_safety This function must only be called from the main thread.
   5469  *
   5470  *  @sa @ref joystick
   5471  *
   5472  *  @since Added in version 3.0.  Replaces `glfwGetJoystickParam`.
   5473  *
   5474  *  @ingroup input
   5475  */
   5476 GLFWAPI int glfwJoystickPresent(int jid);
   5477 
   5478 /*! @brief Returns the values of all axes of the specified joystick.
   5479  *
   5480  *  This function returns the values of all axes of the specified joystick.
   5481  *  Each element in the array is a value between -1.0 and 1.0.
   5482  *
   5483  *  If the specified joystick is not present this function will return `NULL`
   5484  *  but will not generate an error.  This can be used instead of first calling
   5485  *  @ref glfwJoystickPresent.
   5486  *
   5487  *  @param[in] jid The [joystick](@ref joysticks) to query.
   5488  *  @param[out] count Where to store the number of axis values in the returned
   5489  *  array.  This is set to zero if the joystick is not present or an error
   5490  *  occurred.
   5491  *  @return An array of axis values, or `NULL` if the joystick is not present or
   5492  *  an [error](@ref error_handling) occurred.
   5493  *
   5494  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   5495  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   5496  *
   5497  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   5498  *  should not free it yourself.  It is valid until the specified joystick is
   5499  *  disconnected or the library is terminated.
   5500  *
   5501  *  @thread_safety This function must only be called from the main thread.
   5502  *
   5503  *  @sa @ref joystick_axis
   5504  *
   5505  *  @since Added in version 3.0.  Replaces `glfwGetJoystickPos`.
   5506  *
   5507  *  @ingroup input
   5508  */
   5509 GLFWAPI const float* glfwGetJoystickAxes(int jid, int* count);
   5510 
   5511 /*! @brief Returns the state of all buttons of the specified joystick.
   5512  *
   5513  *  This function returns the state of all buttons of the specified joystick.
   5514  *  Each element in the array is either `GLFW_PRESS` or `GLFW_RELEASE`.
   5515  *
   5516  *  For backward compatibility with earlier versions that did not have @ref
   5517  *  glfwGetJoystickHats, the button array also includes all hats, each
   5518  *  represented as four buttons.  The hats are in the same order as returned by
   5519  *  __glfwGetJoystickHats__ and are in the order _up_, _right_, _down_ and
   5520  *  _left_.  To disable these extra buttons, set the @ref
   5521  *  GLFW_JOYSTICK_HAT_BUTTONS init hint before initialization.
   5522  *
   5523  *  If the specified joystick is not present this function will return `NULL`
   5524  *  but will not generate an error.  This can be used instead of first calling
   5525  *  @ref glfwJoystickPresent.
   5526  *
   5527  *  @param[in] jid The [joystick](@ref joysticks) to query.
   5528  *  @param[out] count Where to store the number of button states in the returned
   5529  *  array.  This is set to zero if the joystick is not present or an error
   5530  *  occurred.
   5531  *  @return An array of button states, or `NULL` if the joystick is not present
   5532  *  or an [error](@ref error_handling) occurred.
   5533  *
   5534  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   5535  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   5536  *
   5537  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   5538  *  should not free it yourself.  It is valid until the specified joystick is
   5539  *  disconnected or the library is terminated.
   5540  *
   5541  *  @thread_safety This function must only be called from the main thread.
   5542  *
   5543  *  @sa @ref joystick_button
   5544  *
   5545  *  @since Added in version 2.2.
   5546  *  @glfw3 Changed to return a dynamic array.
   5547  *
   5548  *  @ingroup input
   5549  */
   5550 GLFWAPI const unsigned char* glfwGetJoystickButtons(int jid, int* count);
   5551 
   5552 /*! @brief Returns the state of all hats of the specified joystick.
   5553  *
   5554  *  This function returns the state of all hats of the specified joystick.
   5555  *  Each element in the array is one of the following values:
   5556  *
   5557  *  Name                  | Value
   5558  *  ----                  | -----
   5559  *  `GLFW_HAT_CENTERED`   | 0
   5560  *  `GLFW_HAT_UP`         | 1
   5561  *  `GLFW_HAT_RIGHT`      | 2
   5562  *  `GLFW_HAT_DOWN`       | 4
   5563  *  `GLFW_HAT_LEFT`       | 8
   5564  *  `GLFW_HAT_RIGHT_UP`   | `GLFW_HAT_RIGHT` \| `GLFW_HAT_UP`
   5565  *  `GLFW_HAT_RIGHT_DOWN` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_DOWN`
   5566  *  `GLFW_HAT_LEFT_UP`    | `GLFW_HAT_LEFT` \| `GLFW_HAT_UP`
   5567  *  `GLFW_HAT_LEFT_DOWN`  | `GLFW_HAT_LEFT` \| `GLFW_HAT_DOWN`
   5568  *
   5569  *  The diagonal directions are bitwise combinations of the primary (up, right,
   5570  *  down and left) directions and you can test for these individually by ANDing
   5571  *  it with the corresponding direction.
   5572  *
   5573  *  @code
   5574  *  if (hats[2] & GLFW_HAT_RIGHT)
   5575  *  {
   5576  *      // State of hat 2 could be right-up, right or right-down
   5577  *  }
   5578  *  @endcode
   5579  *
   5580  *  If the specified joystick is not present this function will return `NULL`
   5581  *  but will not generate an error.  This can be used instead of first calling
   5582  *  @ref glfwJoystickPresent.
   5583  *
   5584  *  @param[in] jid The [joystick](@ref joysticks) to query.
   5585  *  @param[out] count Where to store the number of hat states in the returned
   5586  *  array.  This is set to zero if the joystick is not present or an error
   5587  *  occurred.
   5588  *  @return An array of hat states, or `NULL` if the joystick is not present
   5589  *  or an [error](@ref error_handling) occurred.
   5590  *
   5591  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   5592  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   5593  *
   5594  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   5595  *  should not free it yourself.  It is valid until the specified joystick is
   5596  *  disconnected, this function is called again for that joystick or the library
   5597  *  is terminated.
   5598  *
   5599  *  @thread_safety This function must only be called from the main thread.
   5600  *
   5601  *  @sa @ref joystick_hat
   5602  *
   5603  *  @since Added in version 3.3.
   5604  *
   5605  *  @ingroup input
   5606  */
   5607 GLFWAPI const unsigned char* glfwGetJoystickHats(int jid, int* count);
   5608 
   5609 /*! @brief Returns the name of the specified joystick.
   5610  *
   5611  *  This function returns the name, encoded as UTF-8, of the specified joystick.
   5612  *  The returned string is allocated and freed by GLFW.  You should not free it
   5613  *  yourself.
   5614  *
   5615  *  If the specified joystick is not present this function will return `NULL`
   5616  *  but will not generate an error.  This can be used instead of first calling
   5617  *  @ref glfwJoystickPresent.
   5618  *
   5619  *  @param[in] jid The [joystick](@ref joysticks) to query.
   5620  *  @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick
   5621  *  is not present or an [error](@ref error_handling) occurred.
   5622  *
   5623  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   5624  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   5625  *
   5626  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   5627  *  should not free it yourself.  It is valid until the specified joystick is
   5628  *  disconnected or the library is terminated.
   5629  *
   5630  *  @thread_safety This function must only be called from the main thread.
   5631  *
   5632  *  @sa @ref joystick_name
   5633  *
   5634  *  @since Added in version 3.0.
   5635  *
   5636  *  @ingroup input
   5637  */
   5638 GLFWAPI const char* glfwGetJoystickName(int jid);
   5639 
   5640 /*! @brief Returns the SDL compatible GUID of the specified joystick.
   5641  *
   5642  *  This function returns the SDL compatible GUID, as a UTF-8 encoded
   5643  *  hexadecimal string, of the specified joystick.  The returned string is
   5644  *  allocated and freed by GLFW.  You should not free it yourself.
   5645  *
   5646  *  The GUID is what connects a joystick to a gamepad mapping.  A connected
   5647  *  joystick will always have a GUID even if there is no gamepad mapping
   5648  *  assigned to it.
   5649  *
   5650  *  If the specified joystick is not present this function will return `NULL`
   5651  *  but will not generate an error.  This can be used instead of first calling
   5652  *  @ref glfwJoystickPresent.
   5653  *
   5654  *  The GUID uses the format introduced in SDL 2.0.5.  This GUID tries to
   5655  *  uniquely identify the make and model of a joystick but does not identify
   5656  *  a specific unit, e.g. all wired Xbox 360 controllers will have the same
   5657  *  GUID on that platform.  The GUID for a unit may vary between platforms
   5658  *  depending on what hardware information the platform specific APIs provide.
   5659  *
   5660  *  @param[in] jid The [joystick](@ref joysticks) to query.
   5661  *  @return The UTF-8 encoded GUID of the joystick, or `NULL` if the joystick
   5662  *  is not present or an [error](@ref error_handling) occurred.
   5663  *
   5664  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   5665  *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
   5666  *
   5667  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   5668  *  should not free it yourself.  It is valid until the specified joystick is
   5669  *  disconnected or the library is terminated.
   5670  *
   5671  *  @thread_safety This function must only be called from the main thread.
   5672  *
   5673  *  @sa @ref gamepad
   5674  *
   5675  *  @since Added in version 3.3.
   5676  *
   5677  *  @ingroup input
   5678  */
   5679 GLFWAPI const char* glfwGetJoystickGUID(int jid);
   5680 
   5681 /*! @brief Sets the user pointer of the specified joystick.
   5682  *
   5683  *  This function sets the user-defined pointer of the specified joystick.  The
   5684  *  current value is retained until the joystick is disconnected.  The initial
   5685  *  value is `NULL`.
   5686  *
   5687  *  This function may be called from the joystick callback, even for a joystick
   5688  *  that is being disconnected.
   5689  *
   5690  *  @param[in] jid The joystick whose pointer to set.
   5691  *  @param[in] pointer The new value.
   5692  *
   5693  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   5694  *
   5695  *  @thread_safety This function may be called from any thread.  Access is not
   5696  *  synchronized.
   5697  *
   5698  *  @sa @ref joystick_userptr
   5699  *  @sa @ref glfwGetJoystickUserPointer
   5700  *
   5701  *  @since Added in version 3.3.
   5702  *
   5703  *  @ingroup input
   5704  */
   5705 GLFWAPI void glfwSetJoystickUserPointer(int jid, void* pointer);
   5706 
   5707 /*! @brief Returns the user pointer of the specified joystick.
   5708  *
   5709  *  This function returns the current value of the user-defined pointer of the
   5710  *  specified joystick.  The initial value is `NULL`.
   5711  *
   5712  *  This function may be called from the joystick callback, even for a joystick
   5713  *  that is being disconnected.
   5714  *
   5715  *  @param[in] jid The joystick whose pointer to return.
   5716  *
   5717  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   5718  *
   5719  *  @thread_safety This function may be called from any thread.  Access is not
   5720  *  synchronized.
   5721  *
   5722  *  @sa @ref joystick_userptr
   5723  *  @sa @ref glfwSetJoystickUserPointer
   5724  *
   5725  *  @since Added in version 3.3.
   5726  *
   5727  *  @ingroup input
   5728  */
   5729 GLFWAPI void* glfwGetJoystickUserPointer(int jid);
   5730 
   5731 /*! @brief Returns whether the specified joystick has a gamepad mapping.
   5732  *
   5733  *  This function returns whether the specified joystick is both present and has
   5734  *  a gamepad mapping.
   5735  *
   5736  *  If the specified joystick is present but does not have a gamepad mapping
   5737  *  this function will return `GLFW_FALSE` but will not generate an error.  Call
   5738  *  @ref glfwJoystickPresent to check if a joystick is present regardless of
   5739  *  whether it has a mapping.
   5740  *
   5741  *  @param[in] jid The [joystick](@ref joysticks) to query.
   5742  *  @return `GLFW_TRUE` if a joystick is both present and has a gamepad mapping,
   5743  *  or `GLFW_FALSE` otherwise.
   5744  *
   5745  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   5746  *  GLFW_INVALID_ENUM.
   5747  *
   5748  *  @thread_safety This function must only be called from the main thread.
   5749  *
   5750  *  @sa @ref gamepad
   5751  *  @sa @ref glfwGetGamepadState
   5752  *
   5753  *  @since Added in version 3.3.
   5754  *
   5755  *  @ingroup input
   5756  */
   5757 GLFWAPI int glfwJoystickIsGamepad(int jid);
   5758 
   5759 /*! @brief Sets the joystick configuration callback.
   5760  *
   5761  *  This function sets the joystick configuration callback, or removes the
   5762  *  currently set callback.  This is called when a joystick is connected to or
   5763  *  disconnected from the system.
   5764  *
   5765  *  For joystick connection and disconnection events to be delivered on all
   5766  *  platforms, you need to call one of the [event processing](@ref events)
   5767  *  functions.  Joystick disconnection may also be detected and the callback
   5768  *  called by joystick functions.  The function will then return whatever it
   5769  *  returns if the joystick is not present.
   5770  *
   5771  *  @param[in] callback The new callback, or `NULL` to remove the currently set
   5772  *  callback.
   5773  *  @return The previously set callback, or `NULL` if no callback was set or the
   5774  *  library had not been [initialized](@ref intro_init).
   5775  *
   5776  *  @callback_signature
   5777  *  @code
   5778  *  void function_name(int jid, int event)
   5779  *  @endcode
   5780  *  For more information about the callback parameters, see the
   5781  *  [function pointer type](@ref GLFWjoystickfun).
   5782  *
   5783  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   5784  *
   5785  *  @thread_safety This function must only be called from the main thread.
   5786  *
   5787  *  @sa @ref joystick_event
   5788  *
   5789  *  @since Added in version 3.2.
   5790  *
   5791  *  @ingroup input
   5792  */
   5793 GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback);
   5794 
   5795 /*! @brief Adds the specified SDL_GameControllerDB gamepad mappings.
   5796  *
   5797  *  This function parses the specified ASCII encoded string and updates the
   5798  *  internal list with any gamepad mappings it finds.  This string may
   5799  *  contain either a single gamepad mapping or many mappings separated by
   5800  *  newlines.  The parser supports the full format of the `gamecontrollerdb.txt`
   5801  *  source file including empty lines and comments.
   5802  *
   5803  *  See @ref gamepad_mapping for a description of the format.
   5804  *
   5805  *  If there is already a gamepad mapping for a given GUID in the internal list,
   5806  *  it will be replaced by the one passed to this function.  If the library is
   5807  *  terminated and re-initialized the internal list will revert to the built-in
   5808  *  default.
   5809  *
   5810  *  @param[in] string The string containing the gamepad mappings.
   5811  *  @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
   5812  *  [error](@ref error_handling) occurred.
   5813  *
   5814  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   5815  *  GLFW_INVALID_VALUE.
   5816  *
   5817  *  @thread_safety This function must only be called from the main thread.
   5818  *
   5819  *  @sa @ref gamepad
   5820  *  @sa @ref glfwJoystickIsGamepad
   5821  *  @sa @ref glfwGetGamepadName
   5822  *
   5823  *  @since Added in version 3.3.
   5824  *
   5825  *  @ingroup input
   5826  */
   5827 GLFWAPI int glfwUpdateGamepadMappings(const char* string);
   5828 
   5829 /*! @brief Returns the human-readable gamepad name for the specified joystick.
   5830  *
   5831  *  This function returns the human-readable name of the gamepad from the
   5832  *  gamepad mapping assigned to the specified joystick.
   5833  *
   5834  *  If the specified joystick is not present or does not have a gamepad mapping
   5835  *  this function will return `NULL` but will not generate an error.  Call
   5836  *  @ref glfwJoystickPresent to check whether it is present regardless of
   5837  *  whether it has a mapping.
   5838  *
   5839  *  @param[in] jid The [joystick](@ref joysticks) to query.
   5840  *  @return The UTF-8 encoded name of the gamepad, or `NULL` if the
   5841  *  joystick is not present, does not have a mapping or an
   5842  *  [error](@ref error_handling) occurred.
   5843  *
   5844  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref GLFW_INVALID_ENUM.
   5845  *
   5846  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   5847  *  should not free it yourself.  It is valid until the specified joystick is
   5848  *  disconnected, the gamepad mappings are updated or the library is terminated.
   5849  *
   5850  *  @thread_safety This function must only be called from the main thread.
   5851  *
   5852  *  @sa @ref gamepad
   5853  *  @sa @ref glfwJoystickIsGamepad
   5854  *
   5855  *  @since Added in version 3.3.
   5856  *
   5857  *  @ingroup input
   5858  */
   5859 GLFWAPI const char* glfwGetGamepadName(int jid);
   5860 
   5861 /*! @brief Retrieves the state of the specified joystick remapped as a gamepad.
   5862  *
   5863  *  This function retrieves the state of the specified joystick remapped to
   5864  *  an Xbox-like gamepad.
   5865  *
   5866  *  If the specified joystick is not present or does not have a gamepad mapping
   5867  *  this function will return `GLFW_FALSE` but will not generate an error.  Call
   5868  *  @ref glfwJoystickPresent to check whether it is present regardless of
   5869  *  whether it has a mapping.
   5870  *
   5871  *  The Guide button may not be available for input as it is often hooked by the
   5872  *  system or the Steam client.
   5873  *
   5874  *  Not all devices have all the buttons or axes provided by @ref
   5875  *  GLFWgamepadstate.  Unavailable buttons and axes will always report
   5876  *  `GLFW_RELEASE` and 0.0 respectively.
   5877  *
   5878  *  @param[in] jid The [joystick](@ref joysticks) to query.
   5879  *  @param[out] state The gamepad input state of the joystick.
   5880  *  @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if no joystick is
   5881  *  connected, it has no gamepad mapping or an [error](@ref error_handling)
   5882  *  occurred.
   5883  *
   5884  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   5885  *  GLFW_INVALID_ENUM.
   5886  *
   5887  *  @thread_safety This function must only be called from the main thread.
   5888  *
   5889  *  @sa @ref gamepad
   5890  *  @sa @ref glfwUpdateGamepadMappings
   5891  *  @sa @ref glfwJoystickIsGamepad
   5892  *
   5893  *  @since Added in version 3.3.
   5894  *
   5895  *  @ingroup input
   5896  */
   5897 GLFWAPI int glfwGetGamepadState(int jid, GLFWgamepadstate* state);
   5898 
   5899 /*! @brief Sets the clipboard to the specified string.
   5900  *
   5901  *  This function sets the system clipboard to the specified, UTF-8 encoded
   5902  *  string.
   5903  *
   5904  *  @param[in] window Deprecated.  Any valid window or `NULL`.
   5905  *  @param[in] string A UTF-8 encoded string.
   5906  *
   5907  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   5908  *  GLFW_PLATFORM_ERROR.
   5909  *
   5910  *  @remark @win32 The clipboard on Windows has a single global lock for reading and
   5911  *  writing.  GLFW tries to acquire it a few times, which is almost always enough.  If it
   5912  *  cannot acquire the lock then this function emits @ref GLFW_PLATFORM_ERROR and returns.
   5913  *  It is safe to try this multiple times.
   5914  *
   5915  *  @pointer_lifetime The specified string is copied before this function
   5916  *  returns.
   5917  *
   5918  *  @thread_safety This function must only be called from the main thread.
   5919  *
   5920  *  @sa @ref clipboard
   5921  *  @sa @ref glfwGetClipboardString
   5922  *
   5923  *  @since Added in version 3.0.
   5924  *
   5925  *  @ingroup input
   5926  */
   5927 GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string);
   5928 
   5929 /*! @brief Returns the contents of the clipboard as a string.
   5930  *
   5931  *  This function returns the contents of the system clipboard, if it contains
   5932  *  or is convertible to a UTF-8 encoded string.  If the clipboard is empty or
   5933  *  if its contents cannot be converted, `NULL` is returned and a @ref
   5934  *  GLFW_FORMAT_UNAVAILABLE error is generated.
   5935  *
   5936  *  @param[in] window Deprecated.  Any valid window or `NULL`.
   5937  *  @return The contents of the clipboard as a UTF-8 encoded string, or `NULL`
   5938  *  if an [error](@ref error_handling) occurred.
   5939  *
   5940  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   5941  *  GLFW_FORMAT_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
   5942  *
   5943  *  @remark @win32 The clipboard on Windows has a single global lock for reading and
   5944  *  writing.  GLFW tries to acquire it a few times, which is almost always enough.  If it
   5945  *  cannot acquire the lock then this function emits @ref GLFW_PLATFORM_ERROR and returns.
   5946  *  It is safe to try this multiple times.
   5947  *
   5948  *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
   5949  *  should not free it yourself.  It is valid until the next call to @ref
   5950  *  glfwGetClipboardString or @ref glfwSetClipboardString, or until the library
   5951  *  is terminated.
   5952  *
   5953  *  @thread_safety This function must only be called from the main thread.
   5954  *
   5955  *  @sa @ref clipboard
   5956  *  @sa @ref glfwSetClipboardString
   5957  *
   5958  *  @since Added in version 3.0.
   5959  *
   5960  *  @ingroup input
   5961  */
   5962 GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window);
   5963 
   5964 /*! @brief Returns the GLFW time.
   5965  *
   5966  *  This function returns the current GLFW time, in seconds.  Unless the time
   5967  *  has been set using @ref glfwSetTime it measures time elapsed since GLFW was
   5968  *  initialized.
   5969  *
   5970  *  This function and @ref glfwSetTime are helper functions on top of @ref
   5971  *  glfwGetTimerFrequency and @ref glfwGetTimerValue.
   5972  *
   5973  *  The resolution of the timer is system dependent, but is usually on the order
   5974  *  of a few micro- or nanoseconds.  It uses the highest-resolution monotonic
   5975  *  time source on each operating system.
   5976  *
   5977  *  @return The current time, in seconds, or zero if an
   5978  *  [error](@ref error_handling) occurred.
   5979  *
   5980  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   5981  *
   5982  *  @thread_safety This function may be called from any thread.  Reading and
   5983  *  writing of the internal base time is not atomic, so it needs to be
   5984  *  externally synchronized with calls to @ref glfwSetTime.
   5985  *
   5986  *  @sa @ref time
   5987  *
   5988  *  @since Added in version 1.0.
   5989  *
   5990  *  @ingroup input
   5991  */
   5992 GLFWAPI double glfwGetTime(void);
   5993 
   5994 /*! @brief Sets the GLFW time.
   5995  *
   5996  *  This function sets the current GLFW time, in seconds.  The value must be
   5997  *  a positive finite number less than or equal to 18446744073.0, which is
   5998  *  approximately 584.5 years.
   5999  *
   6000  *  This function and @ref glfwGetTime are helper functions on top of @ref
   6001  *  glfwGetTimerFrequency and @ref glfwGetTimerValue.
   6002  *
   6003  *  @param[in] time The new value, in seconds.
   6004  *
   6005  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   6006  *  GLFW_INVALID_VALUE.
   6007  *
   6008  *  @remark The upper limit of GLFW time is calculated as
   6009  *  floor((2<sup>64</sup> - 1) / 10<sup>9</sup>) and is due to implementations
   6010  *  storing nanoseconds in 64 bits.  The limit may be increased in the future.
   6011  *
   6012  *  @thread_safety This function may be called from any thread.  Reading and
   6013  *  writing of the internal base time is not atomic, so it needs to be
   6014  *  externally synchronized with calls to @ref glfwGetTime.
   6015  *
   6016  *  @sa @ref time
   6017  *
   6018  *  @since Added in version 2.2.
   6019  *
   6020  *  @ingroup input
   6021  */
   6022 GLFWAPI void glfwSetTime(double time);
   6023 
   6024 /*! @brief Returns the current value of the raw timer.
   6025  *
   6026  *  This function returns the current value of the raw timer, measured in
   6027  *  1&nbsp;/&nbsp;frequency seconds.  To get the frequency, call @ref
   6028  *  glfwGetTimerFrequency.
   6029  *
   6030  *  @return The value of the timer, or zero if an
   6031  *  [error](@ref error_handling) occurred.
   6032  *
   6033  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   6034  *
   6035  *  @thread_safety This function may be called from any thread.
   6036  *
   6037  *  @sa @ref time
   6038  *  @sa @ref glfwGetTimerFrequency
   6039  *
   6040  *  @since Added in version 3.2.
   6041  *
   6042  *  @ingroup input
   6043  */
   6044 GLFWAPI uint64_t glfwGetTimerValue(void);
   6045 
   6046 /*! @brief Returns the frequency, in Hz, of the raw timer.
   6047  *
   6048  *  This function returns the frequency, in Hz, of the raw timer.
   6049  *
   6050  *  @return The frequency of the timer, in Hz, or zero if an
   6051  *  [error](@ref error_handling) occurred.
   6052  *
   6053  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   6054  *
   6055  *  @thread_safety This function may be called from any thread.
   6056  *
   6057  *  @sa @ref time
   6058  *  @sa @ref glfwGetTimerValue
   6059  *
   6060  *  @since Added in version 3.2.
   6061  *
   6062  *  @ingroup input
   6063  */
   6064 GLFWAPI uint64_t glfwGetTimerFrequency(void);
   6065 
   6066 /*! @brief Makes the context of the specified window current for the calling
   6067  *  thread.
   6068  *
   6069  *  This function makes the OpenGL or OpenGL ES context of the specified window
   6070  *  current on the calling thread.  It can also detach the current context from
   6071  *  the calling thread without making a new one current by passing in `NULL`.
   6072  *
   6073  *  A context must only be made current on a single thread at a time and each
   6074  *  thread can have only a single current context at a time.  Making a context
   6075  *  current detaches any previously current context on the calling thread.
   6076  *
   6077  *  When moving a context between threads, you must detach it (make it
   6078  *  non-current) on the old thread before making it current on the new one.
   6079  *
   6080  *  By default, making a context non-current implicitly forces a pipeline flush.
   6081  *  On machines that support `GL_KHR_context_flush_control`, you can control
   6082  *  whether a context performs this flush by setting the
   6083  *  [GLFW_CONTEXT_RELEASE_BEHAVIOR](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_hint)
   6084  *  hint.
   6085  *
   6086  *  The specified window must have an OpenGL or OpenGL ES context.  Specifying
   6087  *  a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT
   6088  *  error.
   6089  *
   6090  *  @param[in] window The window whose context to make current, or `NULL` to
   6091  *  detach the current context.
   6092  *
   6093  *  @remarks If the previously current context was created via a different
   6094  *  context creation API than the one passed to this function, GLFW will still
   6095  *  detach the previous one from its API before making the new one current.
   6096  *
   6097  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   6098  *  GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
   6099  *
   6100  *  @thread_safety This function may be called from any thread.
   6101  *
   6102  *  @sa @ref context_current
   6103  *  @sa @ref glfwGetCurrentContext
   6104  *
   6105  *  @since Added in version 3.0.
   6106  *
   6107  *  @ingroup context
   6108  */
   6109 GLFWAPI void glfwMakeContextCurrent(GLFWwindow* window);
   6110 
   6111 /*! @brief Returns the window whose context is current on the calling thread.
   6112  *
   6113  *  This function returns the window whose OpenGL or OpenGL ES context is
   6114  *  current on the calling thread.
   6115  *
   6116  *  @return The window whose context is current, or `NULL` if no window's
   6117  *  context is current.
   6118  *
   6119  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   6120  *
   6121  *  @thread_safety This function may be called from any thread.
   6122  *
   6123  *  @sa @ref context_current
   6124  *  @sa @ref glfwMakeContextCurrent
   6125  *
   6126  *  @since Added in version 3.0.
   6127  *
   6128  *  @ingroup context
   6129  */
   6130 GLFWAPI GLFWwindow* glfwGetCurrentContext(void);
   6131 
   6132 /*! @brief Swaps the front and back buffers of the specified window.
   6133  *
   6134  *  This function swaps the front and back buffers of the specified window when
   6135  *  rendering with OpenGL or OpenGL ES.  If the swap interval is greater than
   6136  *  zero, the GPU driver waits the specified number of screen updates before
   6137  *  swapping the buffers.
   6138  *
   6139  *  The specified window must have an OpenGL or OpenGL ES context.  Specifying
   6140  *  a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT
   6141  *  error.
   6142  *
   6143  *  This function does not apply to Vulkan.  If you are rendering with Vulkan,
   6144  *  see `vkQueuePresentKHR` instead.
   6145  *
   6146  *  @param[in] window The window whose buffers to swap.
   6147  *
   6148  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   6149  *  GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
   6150  *
   6151  *  @remark __EGL:__ The context of the specified window must be current on the
   6152  *  calling thread.
   6153  *
   6154  *  @thread_safety This function may be called from any thread.
   6155  *
   6156  *  @sa @ref buffer_swap
   6157  *  @sa @ref glfwSwapInterval
   6158  *
   6159  *  @since Added in version 1.0.
   6160  *  @glfw3 Added window handle parameter.
   6161  *
   6162  *  @ingroup window
   6163  */
   6164 GLFWAPI void glfwSwapBuffers(GLFWwindow* window);
   6165 
   6166 /*! @brief Sets the swap interval for the current context.
   6167  *
   6168  *  This function sets the swap interval for the current OpenGL or OpenGL ES
   6169  *  context, i.e. the number of screen updates to wait from the time @ref
   6170  *  glfwSwapBuffers was called before swapping the buffers and returning.  This
   6171  *  is sometimes called _vertical synchronization_, _vertical retrace
   6172  *  synchronization_ or just _vsync_.
   6173  *
   6174  *  A context that supports either of the `WGL_EXT_swap_control_tear` and
   6175  *  `GLX_EXT_swap_control_tear` extensions also accepts _negative_ swap
   6176  *  intervals, which allows the driver to swap immediately even if a frame
   6177  *  arrives a little bit late.  You can check for these extensions with @ref
   6178  *  glfwExtensionSupported.
   6179  *
   6180  *  A context must be current on the calling thread.  Calling this function
   6181  *  without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
   6182  *
   6183  *  This function does not apply to Vulkan.  If you are rendering with Vulkan,
   6184  *  see the present mode of your swapchain instead.
   6185  *
   6186  *  @param[in] interval The minimum number of screen updates to wait for
   6187  *  until the buffers are swapped by @ref glfwSwapBuffers.
   6188  *
   6189  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   6190  *  GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR.
   6191  *
   6192  *  @remark This function is not called during context creation, leaving the
   6193  *  swap interval set to whatever is the default for that API.  This is done
   6194  *  because some swap interval extensions used by GLFW do not allow the swap
   6195  *  interval to be reset to zero once it has been set to a non-zero value.
   6196  *
   6197  *  @remark Some GPU drivers do not honor the requested swap interval, either
   6198  *  because of a user setting that overrides the application's request or due to
   6199  *  bugs in the driver.
   6200  *
   6201  *  @thread_safety This function may be called from any thread.
   6202  *
   6203  *  @sa @ref buffer_swap
   6204  *  @sa @ref glfwSwapBuffers
   6205  *
   6206  *  @since Added in version 1.0.
   6207  *
   6208  *  @ingroup context
   6209  */
   6210 GLFWAPI void glfwSwapInterval(int interval);
   6211 
   6212 /*! @brief Returns whether the specified extension is available.
   6213  *
   6214  *  This function returns whether the specified
   6215  *  [API extension](@ref context_glext) is supported by the current OpenGL or
   6216  *  OpenGL ES context.  It searches both for client API extension and context
   6217  *  creation API extensions.
   6218  *
   6219  *  A context must be current on the calling thread.  Calling this function
   6220  *  without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
   6221  *
   6222  *  As this functions retrieves and searches one or more extension strings each
   6223  *  call, it is recommended that you cache its results if it is going to be used
   6224  *  frequently.  The extension strings will not change during the lifetime of
   6225  *  a context, so there is no danger in doing this.
   6226  *
   6227  *  This function does not apply to Vulkan.  If you are using Vulkan, see @ref
   6228  *  glfwGetRequiredInstanceExtensions, `vkEnumerateInstanceExtensionProperties`
   6229  *  and `vkEnumerateDeviceExtensionProperties` instead.
   6230  *
   6231  *  @param[in] extension The ASCII encoded name of the extension.
   6232  *  @return `GLFW_TRUE` if the extension is available, or `GLFW_FALSE`
   6233  *  otherwise.
   6234  *
   6235  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   6236  *  GLFW_NO_CURRENT_CONTEXT, @ref GLFW_INVALID_VALUE and @ref
   6237  *  GLFW_PLATFORM_ERROR.
   6238  *
   6239  *  @thread_safety This function may be called from any thread.
   6240  *
   6241  *  @sa @ref context_glext
   6242  *  @sa @ref glfwGetProcAddress
   6243  *
   6244  *  @since Added in version 1.0.
   6245  *
   6246  *  @ingroup context
   6247  */
   6248 GLFWAPI int glfwExtensionSupported(const char* extension);
   6249 
   6250 /*! @brief Returns the address of the specified function for the current
   6251  *  context.
   6252  *
   6253  *  This function returns the address of the specified OpenGL or OpenGL ES
   6254  *  [core or extension function](@ref context_glext), if it is supported
   6255  *  by the current context.
   6256  *
   6257  *  A context must be current on the calling thread.  Calling this function
   6258  *  without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
   6259  *
   6260  *  This function does not apply to Vulkan.  If you are rendering with Vulkan,
   6261  *  see @ref glfwGetInstanceProcAddress, `vkGetInstanceProcAddr` and
   6262  *  `vkGetDeviceProcAddr` instead.
   6263  *
   6264  *  @param[in] procname The ASCII encoded name of the function.
   6265  *  @return The address of the function, or `NULL` if an
   6266  *  [error](@ref error_handling) occurred.
   6267  *
   6268  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   6269  *  GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR.
   6270  *
   6271  *  @remark The address of a given function is not guaranteed to be the same
   6272  *  between contexts.
   6273  *
   6274  *  @remark This function may return a non-`NULL` address despite the
   6275  *  associated version or extension not being available.  Always check the
   6276  *  context version or extension string first.
   6277  *
   6278  *  @pointer_lifetime The returned function pointer is valid until the context
   6279  *  is destroyed or the library is terminated.
   6280  *
   6281  *  @thread_safety This function may be called from any thread.
   6282  *
   6283  *  @sa @ref context_glext
   6284  *  @sa @ref glfwExtensionSupported
   6285  *
   6286  *  @since Added in version 1.0.
   6287  *
   6288  *  @ingroup context
   6289  */
   6290 GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname);
   6291 
   6292 /*! @brief Returns whether the Vulkan loader and an ICD have been found.
   6293  *
   6294  *  This function returns whether the Vulkan loader and any minimally functional
   6295  *  ICD have been found.
   6296  *
   6297  *  The availability of a Vulkan loader and even an ICD does not by itself guarantee that
   6298  *  surface creation or even instance creation is possible.  Call @ref
   6299  *  glfwGetRequiredInstanceExtensions to check whether the extensions necessary for Vulkan
   6300  *  surface creation are available and @ref glfwGetPhysicalDevicePresentationSupport to
   6301  *  check whether a queue family of a physical device supports image presentation.
   6302  *
   6303  *  @return `GLFW_TRUE` if Vulkan is minimally available, or `GLFW_FALSE`
   6304  *  otherwise.
   6305  *
   6306  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
   6307  *
   6308  *  @thread_safety This function may be called from any thread.
   6309  *
   6310  *  @sa @ref vulkan_support
   6311  *
   6312  *  @since Added in version 3.2.
   6313  *
   6314  *  @ingroup vulkan
   6315  */
   6316 GLFWAPI int glfwVulkanSupported(void);
   6317 
   6318 /*! @brief Returns the Vulkan instance extensions required by GLFW.
   6319  *
   6320  *  This function returns an array of names of Vulkan instance extensions required
   6321  *  by GLFW for creating Vulkan surfaces for GLFW windows.  If successful, the
   6322  *  list will always contain `VK_KHR_surface`, so if you don't require any
   6323  *  additional extensions you can pass this list directly to the
   6324  *  `VkInstanceCreateInfo` struct.
   6325  *
   6326  *  If Vulkan is not available on the machine, this function returns `NULL` and
   6327  *  generates a @ref GLFW_API_UNAVAILABLE error.  Call @ref glfwVulkanSupported
   6328  *  to check whether Vulkan is at least minimally available.
   6329  *
   6330  *  If Vulkan is available but no set of extensions allowing window surface
   6331  *  creation was found, this function returns `NULL`.  You may still use Vulkan
   6332  *  for off-screen rendering and compute work.
   6333  *
   6334  *  @param[out] count Where to store the number of extensions in the returned
   6335  *  array.  This is set to zero if an error occurred.
   6336  *  @return An array of ASCII encoded extension names, or `NULL` if an
   6337  *  [error](@ref error_handling) occurred.
   6338  *
   6339  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   6340  *  GLFW_API_UNAVAILABLE.
   6341  *
   6342  *  @remark Additional extensions may be required by future versions of GLFW.
   6343  *  You should check if any extensions you wish to enable are already in the
   6344  *  returned array, as it is an error to specify an extension more than once in
   6345  *  the `VkInstanceCreateInfo` struct.
   6346  *
   6347  *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
   6348  *  should not free it yourself.  It is guaranteed to be valid only until the
   6349  *  library is terminated.
   6350  *
   6351  *  @thread_safety This function may be called from any thread.
   6352  *
   6353  *  @sa @ref vulkan_ext
   6354  *  @sa @ref glfwCreateWindowSurface
   6355  *
   6356  *  @since Added in version 3.2.
   6357  *
   6358  *  @ingroup vulkan
   6359  */
   6360 GLFWAPI const char** glfwGetRequiredInstanceExtensions(uint32_t* count);
   6361 
   6362 #if defined(VK_VERSION_1_0)
   6363 
   6364 /*! @brief Returns the address of the specified Vulkan instance function.
   6365  *
   6366  *  This function returns the address of the specified Vulkan core or extension
   6367  *  function for the specified instance.  If instance is set to `NULL` it can
   6368  *  return any function exported from the Vulkan loader, including at least the
   6369  *  following functions:
   6370  *
   6371  *  - `vkEnumerateInstanceExtensionProperties`
   6372  *  - `vkEnumerateInstanceLayerProperties`
   6373  *  - `vkCreateInstance`
   6374  *  - `vkGetInstanceProcAddr`
   6375  *
   6376  *  If Vulkan is not available on the machine, this function returns `NULL` and
   6377  *  generates a @ref GLFW_API_UNAVAILABLE error.  Call @ref glfwVulkanSupported
   6378  *  to check whether Vulkan is at least minimally available.
   6379  *
   6380  *  This function is equivalent to calling `vkGetInstanceProcAddr` with
   6381  *  a platform-specific query of the Vulkan loader as a fallback.
   6382  *
   6383  *  @param[in] instance The Vulkan instance to query, or `NULL` to retrieve
   6384  *  functions related to instance creation.
   6385  *  @param[in] procname The ASCII encoded name of the function.
   6386  *  @return The address of the function, or `NULL` if an
   6387  *  [error](@ref error_handling) occurred.
   6388  *
   6389  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
   6390  *  GLFW_API_UNAVAILABLE.
   6391  *
   6392  *  @pointer_lifetime The returned function pointer is valid until the library
   6393  *  is terminated.
   6394  *
   6395  *  @thread_safety This function may be called from any thread.
   6396  *
   6397  *  @sa @ref vulkan_proc
   6398  *
   6399  *  @since Added in version 3.2.
   6400  *
   6401  *  @ingroup vulkan
   6402  */
   6403 GLFWAPI GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, const char* procname);
   6404 
   6405 /*! @brief Returns whether the specified queue family can present images.
   6406  *
   6407  *  This function returns whether the specified queue family of the specified
   6408  *  physical device supports presentation to the platform GLFW was built for.
   6409  *
   6410  *  If Vulkan or the required window surface creation instance extensions are
   6411  *  not available on the machine, or if the specified instance was not created
   6412  *  with the required extensions, this function returns `GLFW_FALSE` and
   6413  *  generates a @ref GLFW_API_UNAVAILABLE error.  Call @ref glfwVulkanSupported
   6414  *  to check whether Vulkan is at least minimally available and @ref
   6415  *  glfwGetRequiredInstanceExtensions to check what instance extensions are
   6416  *  required.
   6417  *
   6418  *  @param[in] instance The instance that the physical device belongs to.
   6419  *  @param[in] device The physical device that the queue family belongs to.
   6420  *  @param[in] queuefamily The index of the queue family to query.
   6421  *  @return `GLFW_TRUE` if the queue family supports presentation, or
   6422  *  `GLFW_FALSE` otherwise.
   6423  *
   6424  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   6425  *  GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
   6426  *
   6427  *  @remark @macos This function currently always returns `GLFW_TRUE`, as the
   6428  *  `VK_MVK_macos_surface` and `VK_EXT_metal_surface` extensions do not provide
   6429  *  a `vkGetPhysicalDevice*PresentationSupport` type function.
   6430  *
   6431  *  @thread_safety This function may be called from any thread.  For
   6432  *  synchronization details of Vulkan objects, see the Vulkan specification.
   6433  *
   6434  *  @sa @ref vulkan_present
   6435  *
   6436  *  @since Added in version 3.2.
   6437  *
   6438  *  @ingroup vulkan
   6439  */
   6440 GLFWAPI int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily);
   6441 
   6442 /*! @brief Creates a Vulkan surface for the specified window.
   6443  *
   6444  *  This function creates a Vulkan surface for the specified window.
   6445  *
   6446  *  If the Vulkan loader or at least one minimally functional ICD were not found,
   6447  *  this function returns `VK_ERROR_INITIALIZATION_FAILED` and generates a @ref
   6448  *  GLFW_API_UNAVAILABLE error.  Call @ref glfwVulkanSupported to check whether
   6449  *  Vulkan is at least minimally available.
   6450  *
   6451  *  If the required window surface creation instance extensions are not
   6452  *  available or if the specified instance was not created with these extensions
   6453  *  enabled, this function returns `VK_ERROR_EXTENSION_NOT_PRESENT` and
   6454  *  generates a @ref GLFW_API_UNAVAILABLE error.  Call @ref
   6455  *  glfwGetRequiredInstanceExtensions to check what instance extensions are
   6456  *  required.
   6457  *
   6458  *  The window surface cannot be shared with another API so the window must
   6459  *  have been created with the [client api hint](@ref GLFW_CLIENT_API_attrib)
   6460  *  set to `GLFW_NO_API` otherwise it generates a @ref GLFW_INVALID_VALUE error
   6461  *  and returns `VK_ERROR_NATIVE_WINDOW_IN_USE_KHR`.
   6462  *
   6463  *  The window surface must be destroyed before the specified Vulkan instance.
   6464  *  It is the responsibility of the caller to destroy the window surface.  GLFW
   6465  *  does not destroy it for you.  Call `vkDestroySurfaceKHR` to destroy the
   6466  *  surface.
   6467  *
   6468  *  @param[in] instance The Vulkan instance to create the surface in.
   6469  *  @param[in] window The window to create the surface for.
   6470  *  @param[in] allocator The allocator to use, or `NULL` to use the default
   6471  *  allocator.
   6472  *  @param[out] surface Where to store the handle of the surface.  This is set
   6473  *  to `VK_NULL_HANDLE` if an error occurred.
   6474  *  @return `VK_SUCCESS` if successful, or a Vulkan error code if an
   6475  *  [error](@ref error_handling) occurred.
   6476  *
   6477  *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
   6478  *  GLFW_API_UNAVAILABLE, @ref GLFW_PLATFORM_ERROR and @ref GLFW_INVALID_VALUE
   6479  *
   6480  *  @remark If an error occurs before the creation call is made, GLFW returns
   6481  *  the Vulkan error code most appropriate for the error.  Appropriate use of
   6482  *  @ref glfwVulkanSupported and @ref glfwGetRequiredInstanceExtensions should
   6483  *  eliminate almost all occurrences of these errors.
   6484  *
   6485  *  @remark @macos GLFW prefers the `VK_EXT_metal_surface` extension, with the
   6486  *  `VK_MVK_macos_surface` extension as a fallback.  The name of the selected
   6487  *  extension, if any, is included in the array returned by @ref
   6488  *  glfwGetRequiredInstanceExtensions.
   6489  *
   6490  *  @remark @macos This function creates and sets a `CAMetalLayer` instance for
   6491  *  the window content view, which is required for MoltenVK to function.
   6492  *
   6493  *  @remark @x11 By default GLFW prefers the `VK_KHR_xcb_surface` extension,
   6494  *  with the `VK_KHR_xlib_surface` extension as a fallback.  You can make
   6495  *  `VK_KHR_xlib_surface` the preferred extension by setting the
   6496  *  [GLFW_X11_XCB_VULKAN_SURFACE](@ref GLFW_X11_XCB_VULKAN_SURFACE_hint) init
   6497  *  hint.  The name of the selected extension, if any, is included in the array
   6498  *  returned by @ref glfwGetRequiredInstanceExtensions.
   6499  *
   6500  *  @thread_safety This function may be called from any thread.  For
   6501  *  synchronization details of Vulkan objects, see the Vulkan specification.
   6502  *
   6503  *  @sa @ref vulkan_surface
   6504  *  @sa @ref glfwGetRequiredInstanceExtensions
   6505  *
   6506  *  @since Added in version 3.2.
   6507  *
   6508  *  @ingroup vulkan
   6509  */
   6510 GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface);
   6511 
   6512 #endif /*VK_VERSION_1_0*/
   6513 
   6514 
   6515 /*************************************************************************
   6516  * Global definition cleanup
   6517  *************************************************************************/
   6518 
   6519 /* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */
   6520 
   6521 #ifdef GLFW_WINGDIAPI_DEFINED
   6522  #undef WINGDIAPI
   6523  #undef GLFW_WINGDIAPI_DEFINED
   6524 #endif
   6525 
   6526 #ifdef GLFW_CALLBACK_DEFINED
   6527  #undef CALLBACK
   6528  #undef GLFW_CALLBACK_DEFINED
   6529 #endif
   6530 
   6531 /* Some OpenGL related headers need GLAPIENTRY, but it is unconditionally
   6532  * defined by some gl.h variants (OpenBSD) so define it after if needed.
   6533  */
   6534 #ifndef GLAPIENTRY
   6535  #define GLAPIENTRY APIENTRY
   6536  #define GLFW_GLAPIENTRY_DEFINED
   6537 #endif
   6538 
   6539 /* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */
   6540 
   6541 
   6542 #ifdef __cplusplus
   6543 }
   6544 #endif
   6545 
   6546 #endif /* _glfw3_h_ */
   6547