Camilla Berglund | 2955cd3 | 2010-11-17 15:42:55 +0100 | [diff] [blame] | 1 | /************************************************************************* |
Camilla Berglund | 53fafad | 2016-08-18 23:42:15 +0200 | [diff] [blame] | 2 | * GLFW 3.3 - www.glfw.org |
Camilla Berglund | 3cfc400 | 2013-07-29 20:53:17 +0200 | [diff] [blame] | 3 | * A library for OpenGL, window and input |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 4 | *------------------------------------------------------------------------ |
| 5 | * Copyright (c) 2002-2006 Marcus Geelnard |
Camilla Berglund | 757eea2 | 2016-06-01 16:17:06 +0200 | [diff] [blame] | 6 | * Copyright (c) 2006-2016 Camilla Berglund <elmindreda@glfw.org> |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 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 | |
Camilla Berglund | f8df91d | 2013-01-15 01:59:56 +0100 | [diff] [blame] | 29 | #ifndef _glfw3_h_ |
| 30 | #define _glfw3_h_ |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 31 | |
| 32 | #ifdef __cplusplus |
| 33 | extern "C" { |
| 34 | #endif |
| 35 | |
| 36 | |
| 37 | /************************************************************************* |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 38 | * Doxygen documentation |
| 39 | *************************************************************************/ |
| 40 | |
Camilla Berglund | 318e8ac | 2015-10-24 20:48:46 +0200 | [diff] [blame] | 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 | */ |
Camilla Berglund | 80c203f | 2016-02-19 10:29:13 +0100 | [diff] [blame] | 49 | /*! @defgroup context Context reference |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 50 | * |
Camilla Berglund | 80c203f | 2016-02-19 10:29:13 +0100 | [diff] [blame] | 51 | * This is the reference documentation for OpenGL and OpenGL ES context related |
| 52 | * functions. For more task-oriented information, see the @ref context_guide. |
Camilla Berglund | 3f5843f | 2012-12-13 02:22:39 +0100 | [diff] [blame] | 53 | */ |
Camilla Berglund | 80c203f | 2016-02-19 10:29:13 +0100 | [diff] [blame] | 54 | /*! @defgroup vulkan Vulkan reference |
Camilla Berglund | 9b75bff | 2015-08-10 20:19:04 +0200 | [diff] [blame] | 55 | * |
Camilla Berglund | 80c203f | 2016-02-19 10:29:13 +0100 | [diff] [blame] | 56 | * This is the reference documentation for Vulkan related functions and types. |
| 57 | * For more task-oriented information, see the @ref vulkan_guide. |
Camilla Berglund | 9b75bff | 2015-08-10 20:19:04 +0200 | [diff] [blame] | 58 | */ |
Camilla Berglund | 80c203f | 2016-02-19 10:29:13 +0100 | [diff] [blame] | 59 | /*! @defgroup init Initialization, version and error reference |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 60 | * |
| 61 | * This is the reference documentation for initialization and termination of |
Camilla Berglund | 80c203f | 2016-02-19 10:29:13 +0100 | [diff] [blame] | 62 | * the library, version management and error handling. For more task-oriented |
| 63 | * information, see the @ref intro_guide. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 64 | */ |
Camilla Berglund | 80c203f | 2016-02-19 10:29:13 +0100 | [diff] [blame] | 65 | /*! @defgroup input Input reference |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 66 | * |
| 67 | * This is the reference documentation for input related functions and types. |
Camilla Berglund | 80c203f | 2016-02-19 10:29:13 +0100 | [diff] [blame] | 68 | * For more task-oriented information, see the @ref input_guide. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 69 | */ |
Camilla Berglund | 80c203f | 2016-02-19 10:29:13 +0100 | [diff] [blame] | 70 | /*! @defgroup monitor Monitor reference |
Camilla Berglund | f5f55e3 | 2013-06-17 12:56:36 +0200 | [diff] [blame] | 71 | * |
| 72 | * This is the reference documentation for monitor related functions and types. |
Camilla Berglund | 80c203f | 2016-02-19 10:29:13 +0100 | [diff] [blame] | 73 | * For more task-oriented information, see the @ref monitor_guide. |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 74 | */ |
Camilla Berglund | 80c203f | 2016-02-19 10:29:13 +0100 | [diff] [blame] | 75 | /*! @defgroup window Window reference |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 76 | * |
Camilla Berglund | f5f55e3 | 2013-06-17 12:56:36 +0200 | [diff] [blame] | 77 | * This is the reference documentation for window related functions and types, |
Camilla Berglund | 80c203f | 2016-02-19 10:29:13 +0100 | [diff] [blame] | 78 | * including creation, deletion and event polling. For more task-oriented |
| 79 | * information, see the @ref window_guide. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 80 | */ |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 81 | |
| 82 | |
| 83 | /************************************************************************* |
Camilla Berglund | 8d910d7 | 2015-02-22 18:35:10 +0100 | [diff] [blame] | 84 | * Compiler- and platform-specific preprocessor work |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 85 | *************************************************************************/ |
| 86 | |
Camilla Berglund | 8d910d7 | 2015-02-22 18:35:10 +0100 | [diff] [blame] | 87 | /* If we are we on Windows, we want a single define for it. |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 88 | */ |
Camilla Berglund | e8ce4ab | 2015-02-22 18:18:43 +0100 | [diff] [blame] | 89 | #if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)) |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 90 | #define _WIN32 |
| 91 | #endif /* _WIN32 */ |
| 92 | |
Camilla Berglund | 8d910d7 | 2015-02-22 18:35:10 +0100 | [diff] [blame] | 93 | /* It is customary to use APIENTRY for OpenGL function pointer declarations on |
| 94 | * all platforms. Additionally, the Windows OpenGL header needs APIENTRY. |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 95 | */ |
| 96 | #ifndef APIENTRY |
| 97 | #ifdef _WIN32 |
| 98 | #define APIENTRY __stdcall |
| 99 | #else |
| 100 | #define APIENTRY |
| 101 | #endif |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 102 | #endif /* APIENTRY */ |
| 103 | |
Camilla Berglund | 8d910d7 | 2015-02-22 18:35:10 +0100 | [diff] [blame] | 104 | /* Some Windows OpenGL headers need this. |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 105 | */ |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 106 | #if !defined(WINGDIAPI) && defined(_WIN32) |
Camilla Berglund | c535364 | 2015-02-22 18:14:30 +0100 | [diff] [blame] | 107 | #define WINGDIAPI __declspec(dllimport) |
Camilla Berglund | 4afc67c | 2011-07-27 17:09:17 +0200 | [diff] [blame] | 108 | #define GLFW_WINGDIAPI_DEFINED |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 109 | #endif /* WINGDIAPI */ |
| 110 | |
Camilla Berglund | 8d910d7 | 2015-02-22 18:35:10 +0100 | [diff] [blame] | 111 | /* Some Windows GLU headers need this. |
| 112 | */ |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 113 | #if !defined(CALLBACK) && defined(_WIN32) |
Camilla Berglund | d586fe6 | 2015-02-22 18:17:34 +0100 | [diff] [blame] | 114 | #define CALLBACK __stdcall |
Camilla Berglund | 4afc67c | 2011-07-27 17:09:17 +0200 | [diff] [blame] | 115 | #define GLFW_CALLBACK_DEFINED |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 116 | #endif /* CALLBACK */ |
| 117 | |
Camilla Berglund | 70423af | 2016-07-21 00:15:07 +0200 | [diff] [blame] | 118 | /* Include because most Windows GLU headers need wchar_t and |
| 119 | * the OS X OpenGL header blocks the definition of ptrdiff_t by glext.h. |
Camilla Berglund | 8221aad | 2016-03-06 09:40:16 +0100 | [diff] [blame] | 120 | * Include it unconditionally to avoid surprising side-effects. |
Camilla Berglund | 8d910d7 | 2015-02-22 18:35:10 +0100 | [diff] [blame] | 121 | */ |
Camilla Berglund | 8221aad | 2016-03-06 09:40:16 +0100 | [diff] [blame] | 122 | #include <stddef.h> |
Camilla Berglund | 70423af | 2016-07-21 00:15:07 +0200 | [diff] [blame] | 123 | |
| 124 | /* Include because it is needed by Vulkan and related functions. |
| 125 | */ |
Camilla Berglund | 5661d03 | 2016-03-23 10:09:07 +0100 | [diff] [blame] | 126 | #include <stdint.h> |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 127 | |
Camilla Berglund | c93b120 | 2013-09-08 16:07:34 +0200 | [diff] [blame] | 128 | /* Include the chosen client API headers. |
| 129 | */ |
Camilla Berglund | db49aa6 | 2016-02-22 13:16:43 +0100 | [diff] [blame] | 130 | #if defined(__APPLE__) |
Camilla Berglund | 1591caa | 2015-01-08 06:56:17 +0100 | [diff] [blame] | 131 | #if defined(GLFW_INCLUDE_GLCOREARB) |
| 132 | #include <OpenGL/gl3.h> |
| 133 | #if defined(GLFW_INCLUDE_GLEXT) |
| 134 | #include <OpenGL/gl3ext.h> |
Camilla Berglund | c93b120 | 2013-09-08 16:07:34 +0200 | [diff] [blame] | 135 | #endif |
Camilla Berglund | 1591caa | 2015-01-08 06:56:17 +0100 | [diff] [blame] | 136 | #elif !defined(GLFW_INCLUDE_NONE) |
| 137 | #if !defined(GLFW_INCLUDE_GLEXT) |
| 138 | #define GL_GLEXT_LEGACY |
Camilla Berglund | c93b120 | 2013-09-08 16:07:34 +0200 | [diff] [blame] | 139 | #endif |
Camilla Berglund | 1591caa | 2015-01-08 06:56:17 +0100 | [diff] [blame] | 140 | #include <OpenGL/gl.h> |
| 141 | #endif |
| 142 | #if defined(GLFW_INCLUDE_GLU) |
| 143 | #include <OpenGL/glu.h> |
| 144 | #endif |
Camilla Berglund | c93b120 | 2013-09-08 16:07:34 +0200 | [diff] [blame] | 145 | #else |
Camilla Berglund | 1591caa | 2015-01-08 06:56:17 +0100 | [diff] [blame] | 146 | #if defined(GLFW_INCLUDE_GLCOREARB) |
| 147 | #include <GL/glcorearb.h> |
| 148 | #elif defined(GLFW_INCLUDE_ES1) |
| 149 | #include <GLES/gl.h> |
| 150 | #if defined(GLFW_INCLUDE_GLEXT) |
| 151 | #include <GLES/glext.h> |
Camilla Berglund | c93b120 | 2013-09-08 16:07:34 +0200 | [diff] [blame] | 152 | #endif |
Camilla Berglund | 1591caa | 2015-01-08 06:56:17 +0100 | [diff] [blame] | 153 | #elif defined(GLFW_INCLUDE_ES2) |
| 154 | #include <GLES2/gl2.h> |
| 155 | #if defined(GLFW_INCLUDE_GLEXT) |
| 156 | #include <GLES2/gl2ext.h> |
Camilla Berglund | c93b120 | 2013-09-08 16:07:34 +0200 | [diff] [blame] | 157 | #endif |
Camilla Berglund | 1591caa | 2015-01-08 06:56:17 +0100 | [diff] [blame] | 158 | #elif defined(GLFW_INCLUDE_ES3) |
| 159 | #include <GLES3/gl3.h> |
| 160 | #if defined(GLFW_INCLUDE_GLEXT) |
Camilla Berglund | ca21a5c | 2016-01-02 21:45:23 +0100 | [diff] [blame] | 161 | #include <GLES2/gl2ext.h> |
Camilla Berglund | 1591caa | 2015-01-08 06:56:17 +0100 | [diff] [blame] | 162 | #endif |
| 163 | #elif defined(GLFW_INCLUDE_ES31) |
| 164 | #include <GLES3/gl31.h> |
| 165 | #if defined(GLFW_INCLUDE_GLEXT) |
Camilla Berglund | ca21a5c | 2016-01-02 21:45:23 +0100 | [diff] [blame] | 166 | #include <GLES2/gl2ext.h> |
Camilla Berglund | 1591caa | 2015-01-08 06:56:17 +0100 | [diff] [blame] | 167 | #endif |
Camilla Berglund | 9b75bff | 2015-08-10 20:19:04 +0200 | [diff] [blame] | 168 | #elif defined(GLFW_INCLUDE_VULKAN) |
| 169 | #include <vulkan/vulkan.h> |
Camilla Berglund | 1591caa | 2015-01-08 06:56:17 +0100 | [diff] [blame] | 170 | #elif !defined(GLFW_INCLUDE_NONE) |
| 171 | #include <GL/gl.h> |
| 172 | #if defined(GLFW_INCLUDE_GLEXT) |
| 173 | #include <GL/glext.h> |
| 174 | #endif |
| 175 | #endif |
| 176 | #if defined(GLFW_INCLUDE_GLU) |
| 177 | #include <GL/glu.h> |
| 178 | #endif |
Camilla Berglund | c93b120 | 2013-09-08 16:07:34 +0200 | [diff] [blame] | 179 | #endif |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 180 | |
Camilla Berglund | cc5d7cd | 2012-03-25 17:43:02 +0200 | [diff] [blame] | 181 | #if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL) |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 182 | /* GLFW_DLL must be defined by applications that are linking against the DLL |
| 183 | * version of the GLFW library. _GLFW_BUILD_DLL is defined by the GLFW |
| 184 | * configuration header when compiling the DLL version of the library. |
Camilla Berglund | bd2d571 | 2013-07-23 01:59:27 +0200 | [diff] [blame] | 185 | */ |
Camilla Berglund | 0df4e06 | 2015-12-13 14:07:27 +0100 | [diff] [blame] | 186 | #error "You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined" |
Camilla Berglund | cc5d7cd | 2012-03-25 17:43:02 +0200 | [diff] [blame] | 187 | #endif |
| 188 | |
Camilla Berglund | 1591caa | 2015-01-08 06:56:17 +0100 | [diff] [blame] | 189 | /* GLFWAPI is used to declare public API functions for export |
| 190 | * from the DLL / shared library / dynamic library. |
| 191 | */ |
Camilla Berglund | 2588c9b | 2012-03-25 17:40:30 +0200 | [diff] [blame] | 192 | #if defined(_WIN32) && defined(_GLFW_BUILD_DLL) |
Camilla Berglund | 3afa831 | 2014-10-13 14:13:08 +0200 | [diff] [blame] | 193 | /* We are building GLFW as a Win32 DLL */ |
Camilla Berglund | 2955cd3 | 2010-11-17 15:42:55 +0100 | [diff] [blame] | 194 | #define GLFWAPI __declspec(dllexport) |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 195 | #elif defined(_WIN32) && defined(GLFW_DLL) |
Camilla Berglund | 3afa831 | 2014-10-13 14:13:08 +0200 | [diff] [blame] | 196 | /* We are calling GLFW as a Win32 DLL */ |
Camilla Berglund | 1247fc0 | 2015-02-22 18:10:20 +0100 | [diff] [blame] | 197 | #define GLFWAPI __declspec(dllimport) |
John Bartholomew | 93f4eff | 2013-05-01 13:08:09 +0100 | [diff] [blame] | 198 | #elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL) |
Camilla Berglund | 3afa831 | 2014-10-13 14:13:08 +0200 | [diff] [blame] | 199 | /* We are building GLFW as a shared / dynamic library */ |
John Bartholomew | 93f4eff | 2013-05-01 13:08:09 +0100 | [diff] [blame] | 200 | #define GLFWAPI __attribute__((visibility("default"))) |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 201 | #else |
Camilla Berglund | 3afa831 | 2014-10-13 14:13:08 +0200 | [diff] [blame] | 202 | /* We are building or calling GLFW as a static library */ |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 203 | #define GLFWAPI |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 204 | #endif |
| 205 | |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 206 | |
| 207 | /************************************************************************* |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 208 | * GLFW API tokens |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 209 | *************************************************************************/ |
| 210 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 211 | /*! @name GLFW version macros |
| 212 | * @{ */ |
| 213 | /*! @brief The major version number of the GLFW library. |
| 214 | * |
| 215 | * This is incremented when the API is changed in non-compatible ways. |
| 216 | * @ingroup init |
| 217 | */ |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 218 | #define GLFW_VERSION_MAJOR 3 |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 219 | /*! @brief The minor version number of the GLFW library. |
| 220 | * |
| 221 | * This is incremented when features are added to the API but it remains |
| 222 | * backward-compatible. |
| 223 | * @ingroup init |
| 224 | */ |
Camilla Berglund | 53fafad | 2016-08-18 23:42:15 +0200 | [diff] [blame] | 225 | #define GLFW_VERSION_MINOR 3 |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 226 | /*! @brief The revision number of the GLFW library. |
| 227 | * |
| 228 | * This is incremented when a bug fix release is made that does not contain any |
| 229 | * API changes. |
| 230 | * @ingroup init |
| 231 | */ |
Camilla Berglund | 53fafad | 2016-08-18 23:42:15 +0200 | [diff] [blame] | 232 | #define GLFW_VERSION_REVISION 0 |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 233 | /*! @} */ |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 234 | |
Camilla Berglund | 0eccf75 | 2015-08-23 19:30:04 +0200 | [diff] [blame] | 235 | /*! @name Boolean values |
| 236 | * @{ */ |
| 237 | /*! @brief One. |
| 238 | * |
| 239 | * One. Seriously. You don't _need_ to use this symbol in your code. It's |
| 240 | * just semantic sugar for the number 1. You can use `1` or `true` or `_True` |
| 241 | * or `GL_TRUE` or whatever you want. |
| 242 | */ |
| 243 | #define GLFW_TRUE 1 |
| 244 | /*! @brief Zero. |
| 245 | * |
| 246 | * Zero. Seriously. You don't _need_ to use this symbol in your code. It's |
| 247 | * just just semantic sugar for the number 0. You can use `0` or `false` or |
| 248 | * `_False` or `GL_FALSE` or whatever you want. |
| 249 | */ |
| 250 | #define GLFW_FALSE 0 |
| 251 | /*! @} */ |
| 252 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 253 | /*! @name Key and button actions |
| 254 | * @{ */ |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 255 | /*! @brief The key or mouse button was released. |
| 256 | * |
| 257 | * The key or mouse button was released. |
| 258 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 259 | * @ingroup input |
| 260 | */ |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 261 | #define GLFW_RELEASE 0 |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 262 | /*! @brief The key or mouse button was pressed. |
| 263 | * |
| 264 | * The key or mouse button was pressed. |
| 265 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 266 | * @ingroup input |
| 267 | */ |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 268 | #define GLFW_PRESS 1 |
Camilla Berglund | 253e0d6 | 2013-01-12 17:06:35 +0100 | [diff] [blame] | 269 | /*! @brief The key was held down until it repeated. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 270 | * |
| 271 | * The key was held down until it repeated. |
| 272 | * |
Camilla Berglund | 253e0d6 | 2013-01-12 17:06:35 +0100 | [diff] [blame] | 273 | * @ingroup input |
| 274 | */ |
| 275 | #define GLFW_REPEAT 2 |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 276 | /*! @} */ |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 277 | |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 278 | /*! @defgroup keys Keyboard keys |
| 279 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 280 | * See [key input](@ref input_key) for how these are used. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 281 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 282 | * These key codes are inspired by the _USB HID Usage Tables v1.12_ (p. 53-60), |
| 283 | * but re-arranged to map to 7-bit ASCII for printable keys (function keys are |
| 284 | * put in the 256+ range). |
| 285 | * |
| 286 | * The naming of the key codes follow these rules: |
| 287 | * - The US keyboard layout is used |
| 288 | * - Names of printable alpha-numeric characters are used (e.g. "A", "R", |
| 289 | * "3", etc.) |
| 290 | * - For non-alphanumeric characters, Unicode:ish names are used (e.g. |
| 291 | * "COMMA", "LEFT_SQUARE_BRACKET", etc.). Note that some names do not |
| 292 | * correspond to the Unicode standard (usually for brevity) |
| 293 | * - Keys that lack a clear US mapping are named "WORLD_x" |
| 294 | * - For non-printable keys, custom names are used (e.g. "F4", |
| 295 | * "BACKSPACE", etc.) |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 296 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 297 | * @ingroup input |
| 298 | * @{ |
| 299 | */ |
| 300 | |
Camilla Berglund | 11615fc | 2013-05-30 17:19:12 +0200 | [diff] [blame] | 301 | /* The unknown key */ |
| 302 | #define GLFW_KEY_UNKNOWN -1 |
| 303 | |
Marcus | c0cb4c2 | 2011-01-02 11:18:14 +0100 | [diff] [blame] | 304 | /* Printable keys */ |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 305 | #define GLFW_KEY_SPACE 32 |
| 306 | #define GLFW_KEY_APOSTROPHE 39 /* ' */ |
| 307 | #define GLFW_KEY_COMMA 44 /* , */ |
| 308 | #define GLFW_KEY_MINUS 45 /* - */ |
| 309 | #define GLFW_KEY_PERIOD 46 /* . */ |
| 310 | #define GLFW_KEY_SLASH 47 /* / */ |
| 311 | #define GLFW_KEY_0 48 |
| 312 | #define GLFW_KEY_1 49 |
| 313 | #define GLFW_KEY_2 50 |
| 314 | #define GLFW_KEY_3 51 |
| 315 | #define GLFW_KEY_4 52 |
| 316 | #define GLFW_KEY_5 53 |
| 317 | #define GLFW_KEY_6 54 |
| 318 | #define GLFW_KEY_7 55 |
| 319 | #define GLFW_KEY_8 56 |
| 320 | #define GLFW_KEY_9 57 |
| 321 | #define GLFW_KEY_SEMICOLON 59 /* ; */ |
| 322 | #define GLFW_KEY_EQUAL 61 /* = */ |
| 323 | #define GLFW_KEY_A 65 |
| 324 | #define GLFW_KEY_B 66 |
| 325 | #define GLFW_KEY_C 67 |
| 326 | #define GLFW_KEY_D 68 |
| 327 | #define GLFW_KEY_E 69 |
| 328 | #define GLFW_KEY_F 70 |
| 329 | #define GLFW_KEY_G 71 |
| 330 | #define GLFW_KEY_H 72 |
| 331 | #define GLFW_KEY_I 73 |
| 332 | #define GLFW_KEY_J 74 |
| 333 | #define GLFW_KEY_K 75 |
| 334 | #define GLFW_KEY_L 76 |
| 335 | #define GLFW_KEY_M 77 |
| 336 | #define GLFW_KEY_N 78 |
| 337 | #define GLFW_KEY_O 79 |
| 338 | #define GLFW_KEY_P 80 |
| 339 | #define GLFW_KEY_Q 81 |
| 340 | #define GLFW_KEY_R 82 |
| 341 | #define GLFW_KEY_S 83 |
| 342 | #define GLFW_KEY_T 84 |
| 343 | #define GLFW_KEY_U 85 |
| 344 | #define GLFW_KEY_V 86 |
| 345 | #define GLFW_KEY_W 87 |
| 346 | #define GLFW_KEY_X 88 |
| 347 | #define GLFW_KEY_Y 89 |
| 348 | #define GLFW_KEY_Z 90 |
| 349 | #define GLFW_KEY_LEFT_BRACKET 91 /* [ */ |
| 350 | #define GLFW_KEY_BACKSLASH 92 /* \ */ |
| 351 | #define GLFW_KEY_RIGHT_BRACKET 93 /* ] */ |
| 352 | #define GLFW_KEY_GRAVE_ACCENT 96 /* ` */ |
| 353 | #define GLFW_KEY_WORLD_1 161 /* non-US #1 */ |
| 354 | #define GLFW_KEY_WORLD_2 162 /* non-US #2 */ |
Marcus | c0cb4c2 | 2011-01-02 11:18:14 +0100 | [diff] [blame] | 355 | |
| 356 | /* Function keys */ |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 357 | #define GLFW_KEY_ESCAPE 256 |
| 358 | #define GLFW_KEY_ENTER 257 |
| 359 | #define GLFW_KEY_TAB 258 |
| 360 | #define GLFW_KEY_BACKSPACE 259 |
| 361 | #define GLFW_KEY_INSERT 260 |
| 362 | #define GLFW_KEY_DELETE 261 |
| 363 | #define GLFW_KEY_RIGHT 262 |
| 364 | #define GLFW_KEY_LEFT 263 |
| 365 | #define GLFW_KEY_DOWN 264 |
| 366 | #define GLFW_KEY_UP 265 |
| 367 | #define GLFW_KEY_PAGE_UP 266 |
| 368 | #define GLFW_KEY_PAGE_DOWN 267 |
| 369 | #define GLFW_KEY_HOME 268 |
| 370 | #define GLFW_KEY_END 269 |
| 371 | #define GLFW_KEY_CAPS_LOCK 280 |
| 372 | #define GLFW_KEY_SCROLL_LOCK 281 |
| 373 | #define GLFW_KEY_NUM_LOCK 282 |
| 374 | #define GLFW_KEY_PRINT_SCREEN 283 |
| 375 | #define GLFW_KEY_PAUSE 284 |
| 376 | #define GLFW_KEY_F1 290 |
| 377 | #define GLFW_KEY_F2 291 |
| 378 | #define GLFW_KEY_F3 292 |
| 379 | #define GLFW_KEY_F4 293 |
| 380 | #define GLFW_KEY_F5 294 |
| 381 | #define GLFW_KEY_F6 295 |
| 382 | #define GLFW_KEY_F7 296 |
| 383 | #define GLFW_KEY_F8 297 |
| 384 | #define GLFW_KEY_F9 298 |
| 385 | #define GLFW_KEY_F10 299 |
| 386 | #define GLFW_KEY_F11 300 |
| 387 | #define GLFW_KEY_F12 301 |
| 388 | #define GLFW_KEY_F13 302 |
| 389 | #define GLFW_KEY_F14 303 |
| 390 | #define GLFW_KEY_F15 304 |
| 391 | #define GLFW_KEY_F16 305 |
| 392 | #define GLFW_KEY_F17 306 |
| 393 | #define GLFW_KEY_F18 307 |
| 394 | #define GLFW_KEY_F19 308 |
| 395 | #define GLFW_KEY_F20 309 |
| 396 | #define GLFW_KEY_F21 310 |
| 397 | #define GLFW_KEY_F22 311 |
| 398 | #define GLFW_KEY_F23 312 |
| 399 | #define GLFW_KEY_F24 313 |
| 400 | #define GLFW_KEY_F25 314 |
| 401 | #define GLFW_KEY_KP_0 320 |
| 402 | #define GLFW_KEY_KP_1 321 |
| 403 | #define GLFW_KEY_KP_2 322 |
| 404 | #define GLFW_KEY_KP_3 323 |
| 405 | #define GLFW_KEY_KP_4 324 |
| 406 | #define GLFW_KEY_KP_5 325 |
| 407 | #define GLFW_KEY_KP_6 326 |
| 408 | #define GLFW_KEY_KP_7 327 |
| 409 | #define GLFW_KEY_KP_8 328 |
| 410 | #define GLFW_KEY_KP_9 329 |
| 411 | #define GLFW_KEY_KP_DECIMAL 330 |
| 412 | #define GLFW_KEY_KP_DIVIDE 331 |
| 413 | #define GLFW_KEY_KP_MULTIPLY 332 |
| 414 | #define GLFW_KEY_KP_SUBTRACT 333 |
| 415 | #define GLFW_KEY_KP_ADD 334 |
| 416 | #define GLFW_KEY_KP_ENTER 335 |
| 417 | #define GLFW_KEY_KP_EQUAL 336 |
| 418 | #define GLFW_KEY_LEFT_SHIFT 340 |
| 419 | #define GLFW_KEY_LEFT_CONTROL 341 |
| 420 | #define GLFW_KEY_LEFT_ALT 342 |
| 421 | #define GLFW_KEY_LEFT_SUPER 343 |
| 422 | #define GLFW_KEY_RIGHT_SHIFT 344 |
| 423 | #define GLFW_KEY_RIGHT_CONTROL 345 |
| 424 | #define GLFW_KEY_RIGHT_ALT 346 |
| 425 | #define GLFW_KEY_RIGHT_SUPER 347 |
| 426 | #define GLFW_KEY_MENU 348 |
Camilla Berglund | 9c31541 | 2015-07-02 14:24:50 +0200 | [diff] [blame] | 427 | |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 428 | #define GLFW_KEY_LAST GLFW_KEY_MENU |
Marcus | c0cb4c2 | 2011-01-02 11:18:14 +0100 | [diff] [blame] | 429 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 430 | /*! @} */ |
| 431 | |
Camilla Berglund | 98cbf6f | 2013-05-23 14:42:33 +0200 | [diff] [blame] | 432 | /*! @defgroup mods Modifier key flags |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 433 | * |
| 434 | * See [key input](@ref input_key) for how these are used. |
| 435 | * |
Camilla Berglund | 98cbf6f | 2013-05-23 14:42:33 +0200 | [diff] [blame] | 436 | * @ingroup input |
Camilla Berglund | 2d1b835 | 2012-12-09 19:19:00 +0100 | [diff] [blame] | 437 | * @{ */ |
| 438 | |
Camilla Berglund | 98cbf6f | 2013-05-23 14:42:33 +0200 | [diff] [blame] | 439 | /*! @brief If this bit is set one or more Shift keys were held down. |
Camilla Berglund | 2d1b835 | 2012-12-09 19:19:00 +0100 | [diff] [blame] | 440 | */ |
| 441 | #define GLFW_MOD_SHIFT 0x0001 |
Camilla Berglund | 98cbf6f | 2013-05-23 14:42:33 +0200 | [diff] [blame] | 442 | /*! @brief If this bit is set one or more Control keys were held down. |
Camilla Berglund | 2d1b835 | 2012-12-09 19:19:00 +0100 | [diff] [blame] | 443 | */ |
Camilla Berglund | 3bcffba | 2013-05-23 14:11:05 +0200 | [diff] [blame] | 444 | #define GLFW_MOD_CONTROL 0x0002 |
Camilla Berglund | 98cbf6f | 2013-05-23 14:42:33 +0200 | [diff] [blame] | 445 | /*! @brief If this bit is set one or more Alt keys were held down. |
Camilla Berglund | 2d1b835 | 2012-12-09 19:19:00 +0100 | [diff] [blame] | 446 | */ |
| 447 | #define GLFW_MOD_ALT 0x0004 |
Camilla Berglund | 98cbf6f | 2013-05-23 14:42:33 +0200 | [diff] [blame] | 448 | /*! @brief If this bit is set one or more Super keys were held down. |
Noel Cower | eff85f9 | 2013-05-23 13:22:27 +0200 | [diff] [blame] | 449 | */ |
| 450 | #define GLFW_MOD_SUPER 0x0008 |
Camilla Berglund | 2d1b835 | 2012-12-09 19:19:00 +0100 | [diff] [blame] | 451 | |
| 452 | /*! @} */ |
| 453 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 454 | /*! @defgroup buttons Mouse buttons |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 455 | * |
| 456 | * See [mouse button input](@ref input_mouse_button) for how these are used. |
| 457 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 458 | * @ingroup input |
| 459 | * @{ */ |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 460 | #define GLFW_MOUSE_BUTTON_1 0 |
| 461 | #define GLFW_MOUSE_BUTTON_2 1 |
| 462 | #define GLFW_MOUSE_BUTTON_3 2 |
| 463 | #define GLFW_MOUSE_BUTTON_4 3 |
| 464 | #define GLFW_MOUSE_BUTTON_5 4 |
| 465 | #define GLFW_MOUSE_BUTTON_6 5 |
| 466 | #define GLFW_MOUSE_BUTTON_7 6 |
| 467 | #define GLFW_MOUSE_BUTTON_8 7 |
| 468 | #define GLFW_MOUSE_BUTTON_LAST GLFW_MOUSE_BUTTON_8 |
| 469 | #define GLFW_MOUSE_BUTTON_LEFT GLFW_MOUSE_BUTTON_1 |
| 470 | #define GLFW_MOUSE_BUTTON_RIGHT GLFW_MOUSE_BUTTON_2 |
| 471 | #define GLFW_MOUSE_BUTTON_MIDDLE GLFW_MOUSE_BUTTON_3 |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 472 | /*! @} */ |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 473 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 474 | /*! @defgroup joysticks Joysticks |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 475 | * |
| 476 | * See [joystick input](@ref joystick) for how these are used. |
| 477 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 478 | * @ingroup input |
| 479 | * @{ */ |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 480 | #define GLFW_JOYSTICK_1 0 |
| 481 | #define GLFW_JOYSTICK_2 1 |
| 482 | #define GLFW_JOYSTICK_3 2 |
| 483 | #define GLFW_JOYSTICK_4 3 |
| 484 | #define GLFW_JOYSTICK_5 4 |
| 485 | #define GLFW_JOYSTICK_6 5 |
| 486 | #define GLFW_JOYSTICK_7 6 |
| 487 | #define GLFW_JOYSTICK_8 7 |
| 488 | #define GLFW_JOYSTICK_9 8 |
| 489 | #define GLFW_JOYSTICK_10 9 |
| 490 | #define GLFW_JOYSTICK_11 10 |
| 491 | #define GLFW_JOYSTICK_12 11 |
| 492 | #define GLFW_JOYSTICK_13 12 |
| 493 | #define GLFW_JOYSTICK_14 13 |
| 494 | #define GLFW_JOYSTICK_15 14 |
| 495 | #define GLFW_JOYSTICK_16 15 |
| 496 | #define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16 |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 497 | /*! @} */ |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 498 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 499 | /*! @defgroup errors Error codes |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 500 | * |
| 501 | * See [error handling](@ref error_handling) for how these are used. |
| 502 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 503 | * @ingroup init |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 504 | * @{ */ |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 505 | /*! @brief GLFW has not been initialized. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 506 | * |
Camilla Berglund | 0df4e06 | 2015-12-13 14:07:27 +0100 | [diff] [blame] | 507 | * This occurs if a GLFW function was called that must not be called unless the |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 508 | * library is [initialized](@ref intro_init). |
| 509 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 510 | * @analysis Application programmer error. Initialize GLFW before calling any |
| 511 | * function that requires initialization. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 512 | */ |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 513 | #define GLFW_NOT_INITIALIZED 0x00010001 |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 514 | /*! @brief No context is current for this thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 515 | * |
| 516 | * This occurs if a GLFW function was called that needs and operates on the |
| 517 | * current OpenGL or OpenGL ES context but no context is current on the calling |
| 518 | * thread. One such function is @ref glfwSwapInterval. |
| 519 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 520 | * @analysis Application programmer error. Ensure a context is current before |
| 521 | * calling functions that require a current context. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 522 | */ |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 523 | #define GLFW_NO_CURRENT_CONTEXT 0x00010002 |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 524 | /*! @brief One of the arguments to the function was an invalid enum value. |
| 525 | * |
| 526 | * One of the arguments to the function was an invalid enum value, for example |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 527 | * requesting [GLFW_RED_BITS](@ref window_hints_fb) with @ref |
| 528 | * glfwGetWindowAttrib. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 529 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 530 | * @analysis Application programmer error. Fix the offending call. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 531 | */ |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 532 | #define GLFW_INVALID_ENUM 0x00010003 |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 533 | /*! @brief One of the arguments to the function was an invalid value. |
| 534 | * |
| 535 | * One of the arguments to the function was an invalid value, for example |
| 536 | * requesting a non-existent OpenGL or OpenGL ES version like 2.7. |
| 537 | * |
| 538 | * Requesting a valid but unavailable OpenGL or OpenGL ES version will instead |
| 539 | * result in a @ref GLFW_VERSION_UNAVAILABLE error. |
| 540 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 541 | * @analysis Application programmer error. Fix the offending call. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 542 | */ |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 543 | #define GLFW_INVALID_VALUE 0x00010004 |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 544 | /*! @brief A memory allocation failed. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 545 | * |
| 546 | * A memory allocation failed. |
| 547 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 548 | * @analysis A bug in GLFW or the underlying operating system. Report the bug |
| 549 | * to our [issue tracker](https://github.com/glfw/glfw/issues). |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 550 | */ |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 551 | #define GLFW_OUT_OF_MEMORY 0x00010005 |
Camilla Berglund | 9b75bff | 2015-08-10 20:19:04 +0200 | [diff] [blame] | 552 | /*! @brief GLFW could not find support for the requested API on the system. |
Camilla Berglund | 2d13eb0 | 2014-10-13 16:00:11 +0200 | [diff] [blame] | 553 | * |
Camilla Berglund | 9b75bff | 2015-08-10 20:19:04 +0200 | [diff] [blame] | 554 | * GLFW could not find support for the requested API on the system. |
Camilla Berglund | 2d13eb0 | 2014-10-13 16:00:11 +0200 | [diff] [blame] | 555 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 556 | * @analysis The installed graphics driver does not support the requested |
Camilla Berglund | 9b75bff | 2015-08-10 20:19:04 +0200 | [diff] [blame] | 557 | * API, or does not support it via the chosen context creation backend. |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 558 | * Below are a few examples. |
Camilla Berglund | 2d13eb0 | 2014-10-13 16:00:11 +0200 | [diff] [blame] | 559 | * |
| 560 | * @par |
| 561 | * Some pre-installed Windows graphics drivers do not support OpenGL. AMD only |
Camilla Berglund | d95b79f | 2015-03-30 23:20:49 +0200 | [diff] [blame] | 562 | * supports OpenGL ES via EGL, while Nvidia and Intel only support it via |
Camilla Berglund | 2d13eb0 | 2014-10-13 16:00:11 +0200 | [diff] [blame] | 563 | * a WGL or GLX extension. OS X does not provide OpenGL ES at all. The Mesa |
Camilla Berglund | 138feb8 | 2015-01-05 16:46:04 +0100 | [diff] [blame] | 564 | * EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary |
Camilla Berglund | 9b75bff | 2015-08-10 20:19:04 +0200 | [diff] [blame] | 565 | * driver. Older graphics drivers do not support Vulkan. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 566 | */ |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 567 | #define GLFW_API_UNAVAILABLE 0x00010006 |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 568 | /*! @brief The requested OpenGL or OpenGL ES version is not available. |
| 569 | * |
Camilla Berglund | d493a82 | 2015-03-10 19:51:14 +0100 | [diff] [blame] | 570 | * The requested OpenGL or OpenGL ES version (including any requested context |
| 571 | * or framebuffer hints) is not available on this machine. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 572 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 573 | * @analysis The machine does not support your requirements. If your |
| 574 | * application is sufficiently flexible, downgrade your requirements and try |
| 575 | * again. Otherwise, inform the user that their machine does not match your |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 576 | * requirements. |
| 577 | * |
Camilla Berglund | 2d13eb0 | 2014-10-13 16:00:11 +0200 | [diff] [blame] | 578 | * @par |
| 579 | * Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 |
| 580 | * comes out before the 4.x series gets that far, also fail with this error and |
| 581 | * not @ref GLFW_INVALID_VALUE, because GLFW cannot know what future versions |
| 582 | * will exist. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 583 | */ |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 584 | #define GLFW_VERSION_UNAVAILABLE 0x00010007 |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 585 | /*! @brief A platform-specific error occurred that does not match any of the |
| 586 | * more specific categories. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 587 | * |
| 588 | * A platform-specific error occurred that does not match any of the more |
| 589 | * specific categories. |
| 590 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 591 | * @analysis A bug or configuration error in GLFW, the underlying operating |
| 592 | * system or its drivers, or a lack of required resources. Report the issue to |
| 593 | * our [issue tracker](https://github.com/glfw/glfw/issues). |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 594 | */ |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 595 | #define GLFW_PLATFORM_ERROR 0x00010008 |
Camilla Berglund | 2d13eb0 | 2014-10-13 16:00:11 +0200 | [diff] [blame] | 596 | /*! @brief The requested format is not supported or available. |
| 597 | * |
| 598 | * If emitted during window creation, the requested pixel format is not |
| 599 | * supported. |
| 600 | * |
| 601 | * If emitted when querying the clipboard, the contents of the clipboard could |
| 602 | * not be converted to the requested format. |
| 603 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 604 | * @analysis If emitted during window creation, one or more |
Camilla Berglund | 2d13eb0 | 2014-10-13 16:00:11 +0200 | [diff] [blame] | 605 | * [hard constraints](@ref window_hints_hard) did not match any of the |
| 606 | * available pixel formats. If your application is sufficiently flexible, |
| 607 | * downgrade your requirements and try again. Otherwise, inform the user that |
| 608 | * their machine does not match your requirements. |
| 609 | * |
| 610 | * @par |
| 611 | * If emitted when querying the clipboard, ignore the error or report it to |
| 612 | * the user, as appropriate. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 613 | */ |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 614 | #define GLFW_FORMAT_UNAVAILABLE 0x00010009 |
Camilla Berglund | 496f559 | 2015-06-18 14:03:02 +0200 | [diff] [blame] | 615 | /*! @brief The specified window does not have an OpenGL or OpenGL ES context. |
| 616 | * |
| 617 | * A window that does not have an OpenGL or OpenGL ES context was passed to |
| 618 | * a function that requires it to have one. |
| 619 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 620 | * @analysis Application programmer error. Fix the offending call. |
Camilla Berglund | 496f559 | 2015-06-18 14:03:02 +0200 | [diff] [blame] | 621 | */ |
| 622 | #define GLFW_NO_WINDOW_CONTEXT 0x0001000A |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 623 | /*! @} */ |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 624 | |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 625 | #define GLFW_FOCUSED 0x00020001 |
| 626 | #define GLFW_ICONIFIED 0x00020002 |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 627 | #define GLFW_RESIZABLE 0x00020003 |
| 628 | #define GLFW_VISIBLE 0x00020004 |
| 629 | #define GLFW_DECORATED 0x00020005 |
Camilla Berglund | 25e7ff1 | 2014-04-08 15:32:34 +0200 | [diff] [blame] | 630 | #define GLFW_AUTO_ICONIFY 0x00020006 |
Camilla Berglund | 3ce7bfe | 2014-05-23 14:01:02 +0200 | [diff] [blame] | 631 | #define GLFW_FLOATING 0x00020007 |
Camilla Berglund | a10caa4 | 2015-10-13 12:50:59 +0200 | [diff] [blame] | 632 | #define GLFW_MAXIMIZED 0x00020008 |
Camilla Berglund | 2c09157 | 2010-09-09 21:09:11 +0200 | [diff] [blame] | 633 | |
Camilla Berglund | 53b39a6 | 2013-05-30 18:55:45 +0200 | [diff] [blame] | 634 | #define GLFW_RED_BITS 0x00021001 |
| 635 | #define GLFW_GREEN_BITS 0x00021002 |
| 636 | #define GLFW_BLUE_BITS 0x00021003 |
| 637 | #define GLFW_ALPHA_BITS 0x00021004 |
| 638 | #define GLFW_DEPTH_BITS 0x00021005 |
| 639 | #define GLFW_STENCIL_BITS 0x00021006 |
| 640 | #define GLFW_ACCUM_RED_BITS 0x00021007 |
| 641 | #define GLFW_ACCUM_GREEN_BITS 0x00021008 |
| 642 | #define GLFW_ACCUM_BLUE_BITS 0x00021009 |
| 643 | #define GLFW_ACCUM_ALPHA_BITS 0x0002100A |
| 644 | #define GLFW_AUX_BUFFERS 0x0002100B |
| 645 | #define GLFW_STEREO 0x0002100C |
| 646 | #define GLFW_SAMPLES 0x0002100D |
| 647 | #define GLFW_SRGB_CAPABLE 0x0002100E |
Camilla Berglund | 2cd3438 | 2013-05-30 20:42:50 +0200 | [diff] [blame] | 648 | #define GLFW_REFRESH_RATE 0x0002100F |
Camilla Berglund | c980858 | 2014-04-24 19:21:10 +0200 | [diff] [blame] | 649 | #define GLFW_DOUBLEBUFFER 0x00021010 |
Camilla Berglund | deb0b3d | 2012-12-02 21:00:15 +0100 | [diff] [blame] | 650 | |
Camilla Berglund | 53b39a6 | 2013-05-30 18:55:45 +0200 | [diff] [blame] | 651 | #define GLFW_CLIENT_API 0x00022001 |
| 652 | #define GLFW_CONTEXT_VERSION_MAJOR 0x00022002 |
| 653 | #define GLFW_CONTEXT_VERSION_MINOR 0x00022003 |
| 654 | #define GLFW_CONTEXT_REVISION 0x00022004 |
| 655 | #define GLFW_CONTEXT_ROBUSTNESS 0x00022005 |
| 656 | #define GLFW_OPENGL_FORWARD_COMPAT 0x00022006 |
| 657 | #define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007 |
| 658 | #define GLFW_OPENGL_PROFILE 0x00022008 |
Camilla Berglund | 44c899c | 2014-08-21 19:21:45 +0200 | [diff] [blame] | 659 | #define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009 |
Camilla Berglund | 7be8209 | 2015-08-10 12:46:14 +0200 | [diff] [blame] | 660 | #define GLFW_CONTEXT_NO_ERROR 0x0002200A |
Camilla Berglund | ef80bea | 2016-03-28 13:19:31 +0200 | [diff] [blame] | 661 | #define GLFW_CONTEXT_CREATION_API 0x0002200B |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 662 | |
Camilla Berglund | 496f559 | 2015-06-18 14:03:02 +0200 | [diff] [blame] | 663 | #define GLFW_NO_API 0 |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 664 | #define GLFW_OPENGL_API 0x00030001 |
| 665 | #define GLFW_OPENGL_ES_API 0x00030002 |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 666 | |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 667 | #define GLFW_NO_ROBUSTNESS 0 |
| 668 | #define GLFW_NO_RESET_NOTIFICATION 0x00031001 |
| 669 | #define GLFW_LOSE_CONTEXT_ON_RESET 0x00031002 |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 670 | |
Camilla Berglund | 44e8401 | 2013-06-05 16:13:30 +0200 | [diff] [blame] | 671 | #define GLFW_OPENGL_ANY_PROFILE 0 |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 672 | #define GLFW_OPENGL_CORE_PROFILE 0x00032001 |
| 673 | #define GLFW_OPENGL_COMPAT_PROFILE 0x00032002 |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 674 | |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 675 | #define GLFW_CURSOR 0x00033001 |
| 676 | #define GLFW_STICKY_KEYS 0x00033002 |
| 677 | #define GLFW_STICKY_MOUSE_BUTTONS 0x00033003 |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 678 | |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 679 | #define GLFW_CURSOR_NORMAL 0x00034001 |
| 680 | #define GLFW_CURSOR_HIDDEN 0x00034002 |
| 681 | #define GLFW_CURSOR_DISABLED 0x00034003 |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 682 | |
Camilla Berglund | 44c899c | 2014-08-21 19:21:45 +0200 | [diff] [blame] | 683 | #define GLFW_ANY_RELEASE_BEHAVIOR 0 |
| 684 | #define GLFW_RELEASE_BEHAVIOR_FLUSH 0x00035001 |
| 685 | #define GLFW_RELEASE_BEHAVIOR_NONE 0x00035002 |
| 686 | |
Camilla Berglund | ef80bea | 2016-03-28 13:19:31 +0200 | [diff] [blame] | 687 | #define GLFW_NATIVE_CONTEXT_API 0x00036001 |
| 688 | #define GLFW_EGL_CONTEXT_API 0x00036002 |
| 689 | |
Camilla Berglund | 2a1375e | 2014-09-02 16:52:16 +0200 | [diff] [blame] | 690 | /*! @defgroup shapes Standard cursor shapes |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 691 | * |
| 692 | * See [standard cursor creation](@ref cursor_standard) for how these are used. |
| 693 | * |
Camilla Berglund | 2a1375e | 2014-09-02 16:52:16 +0200 | [diff] [blame] | 694 | * @ingroup input |
| 695 | * @{ */ |
| 696 | |
| 697 | /*! @brief The regular arrow cursor shape. |
| 698 | * |
| 699 | * The regular arrow cursor. |
| 700 | */ |
| 701 | #define GLFW_ARROW_CURSOR 0x00036001 |
| 702 | /*! @brief The text input I-beam cursor shape. |
| 703 | * |
| 704 | * The text input I-beam cursor shape. |
| 705 | */ |
| 706 | #define GLFW_IBEAM_CURSOR 0x00036002 |
| 707 | /*! @brief The crosshair shape. |
| 708 | * |
| 709 | * The crosshair shape. |
| 710 | */ |
| 711 | #define GLFW_CROSSHAIR_CURSOR 0x00036003 |
| 712 | /*! @brief The hand shape. |
| 713 | * |
| 714 | * The hand shape. |
| 715 | */ |
| 716 | #define GLFW_HAND_CURSOR 0x00036004 |
| 717 | /*! @brief The horizontal resize arrow shape. |
| 718 | * |
| 719 | * The horizontal resize arrow shape. |
| 720 | */ |
| 721 | #define GLFW_HRESIZE_CURSOR 0x00036005 |
| 722 | /*! @brief The vertical resize arrow shape. |
| 723 | * |
| 724 | * The vertical resize arrow shape. |
| 725 | */ |
| 726 | #define GLFW_VRESIZE_CURSOR 0x00036006 |
| 727 | /*! @} */ |
| 728 | |
Camilla Berglund | 393e439 | 2013-05-27 22:16:59 +0200 | [diff] [blame] | 729 | #define GLFW_CONNECTED 0x00040001 |
| 730 | #define GLFW_DISCONNECTED 0x00040002 |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 731 | |
Camilla Berglund | 2810130 | 2014-04-08 18:57:43 +0200 | [diff] [blame] | 732 | #define GLFW_DONT_CARE -1 |
| 733 | |
Camilla Berglund | 9738728 | 2011-10-06 23:28:56 +0200 | [diff] [blame] | 734 | |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 735 | /************************************************************************* |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 736 | * GLFW API types |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 737 | *************************************************************************/ |
| 738 | |
Camilla Berglund | 3f5843f | 2012-12-13 02:22:39 +0100 | [diff] [blame] | 739 | /*! @brief Client API function pointer type. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 740 | * |
| 741 | * Generic function pointer used for returning client API function pointers |
| 742 | * without forcing a cast from a regular pointer. |
| 743 | * |
Camilla Berglund | bce20c3 | 2015-11-05 13:58:52 +0100 | [diff] [blame] | 744 | * @sa @ref context_glext |
| 745 | * @sa glfwGetProcAddress |
| 746 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 747 | * @since Added in version 3.0. |
| 748 | |
Camilla Berglund | 3f5843f | 2012-12-13 02:22:39 +0100 | [diff] [blame] | 749 | * @ingroup context |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 750 | */ |
Camilla Berglund | bf42c3c | 2012-06-05 00:16:40 +0200 | [diff] [blame] | 751 | typedef void (*GLFWglproc)(void); |
| 752 | |
Camilla Berglund | 9b75bff | 2015-08-10 20:19:04 +0200 | [diff] [blame] | 753 | /*! @brief Vulkan API function pointer type. |
| 754 | * |
| 755 | * Generic function pointer used for returning Vulkan API function pointers |
| 756 | * without forcing a cast from a regular pointer. |
| 757 | * |
| 758 | * @sa @ref vulkan_proc |
| 759 | * @sa glfwGetInstanceProcAddress |
| 760 | * |
| 761 | * @since Added in version 3.2. |
| 762 | * |
| 763 | * @ingroup vulkan |
| 764 | */ |
| 765 | typedef void (*GLFWvkproc)(void); |
| 766 | |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 767 | /*! @brief Opaque monitor object. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 768 | * |
| 769 | * Opaque monitor object. |
| 770 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 771 | * @see @ref monitor_object |
| 772 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 773 | * @since Added in version 3.0. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 774 | * |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 775 | * @ingroup monitor |
| 776 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 777 | typedef struct GLFWmonitor GLFWmonitor; |
Camilla Berglund | e0ce920 | 2012-08-29 20:39:05 +0200 | [diff] [blame] | 778 | |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 779 | /*! @brief Opaque window object. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 780 | * |
| 781 | * Opaque window object. |
| 782 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 783 | * @see @ref window_object |
| 784 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 785 | * @since Added in version 3.0. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 786 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 787 | * @ingroup window |
| 788 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 789 | typedef struct GLFWwindow GLFWwindow; |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 790 | |
urraka | 40c04a7 | 2013-12-04 10:19:22 -0300 | [diff] [blame] | 791 | /*! @brief Opaque cursor object. |
| 792 | * |
| 793 | * Opaque cursor object. |
| 794 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 795 | * @see @ref cursor_object |
| 796 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 797 | * @since Added in version 3.1. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 798 | * |
urraka | 40c04a7 | 2013-12-04 10:19:22 -0300 | [diff] [blame] | 799 | * @ingroup cursor |
| 800 | */ |
| 801 | typedef struct GLFWcursor GLFWcursor; |
| 802 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 803 | /*! @brief The function signature for error callbacks. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 804 | * |
| 805 | * This is the function signature for error callback functions. |
| 806 | * |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 807 | * @param[in] error An [error code](@ref errors). |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 808 | * @param[in] description A UTF-8 encoded string describing the error. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 809 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 810 | * @sa @ref error_handling |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 811 | * @sa glfwSetErrorCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 812 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 813 | * @since Added in version 3.0. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 814 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 815 | * @ingroup init |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 816 | */ |
Camilla Berglund | 897558f | 2011-03-07 13:34:58 +0100 | [diff] [blame] | 817 | typedef void (* GLFWerrorfun)(int,const char*); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 818 | |
Camilla Berglund | 1a3d47d | 2012-11-30 13:56:42 +0100 | [diff] [blame] | 819 | /*! @brief The function signature for window position callbacks. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 820 | * |
| 821 | * This is the function signature for window position callback functions. |
| 822 | * |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 823 | * @param[in] window The window that was moved. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 824 | * @param[in] xpos The new x-coordinate, in screen coordinates, of the |
| 825 | * upper-left corner of the client area of the window. |
| 826 | * @param[in] ypos The new y-coordinate, in screen coordinates, of the |
| 827 | * upper-left corner of the client area of the window. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 828 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 829 | * @sa @ref window_pos |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 830 | * @sa glfwSetWindowPosCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 831 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 832 | * @since Added in version 3.0. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 833 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 834 | * @ingroup window |
Camilla Berglund | 1a3d47d | 2012-11-30 13:56:42 +0100 | [diff] [blame] | 835 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 836 | typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); |
Camilla Berglund | 1a3d47d | 2012-11-30 13:56:42 +0100 | [diff] [blame] | 837 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 838 | /*! @brief The function signature for window resize callbacks. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 839 | * |
| 840 | * This is the function signature for window size callback functions. |
| 841 | * |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 842 | * @param[in] window The window that was resized. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 843 | * @param[in] width The new width, in screen coordinates, of the window. |
| 844 | * @param[in] height The new height, in screen coordinates, of the window. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 845 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 846 | * @sa @ref window_size |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 847 | * @sa glfwSetWindowSizeCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 848 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 849 | * @since Added in version 1.0. |
| 850 | * @glfw3 Added window handle parameter. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 851 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 852 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 853 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 854 | typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 855 | |
| 856 | /*! @brief The function signature for window close callbacks. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 857 | * |
| 858 | * This is the function signature for window close callback functions. |
| 859 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 860 | * @param[in] window The window that the user attempted to close. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 861 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 862 | * @sa @ref window_close |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 863 | * @sa glfwSetWindowCloseCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 864 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 865 | * @since Added in version 2.5. |
| 866 | * @glfw3 Added window handle parameter. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 867 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 868 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 869 | */ |
Camilla Berglund | 64afb19 | 2013-03-06 23:29:37 +0100 | [diff] [blame] | 870 | typedef void (* GLFWwindowclosefun)(GLFWwindow*); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 871 | |
| 872 | /*! @brief The function signature for window content refresh callbacks. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 873 | * |
| 874 | * This is the function signature for window refresh callback functions. |
| 875 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 876 | * @param[in] window The window whose content needs to be refreshed. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 877 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 878 | * @sa @ref window_refresh |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 879 | * @sa glfwSetWindowRefreshCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 880 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 881 | * @since Added in version 2.5. |
| 882 | * @glfw3 Added window handle parameter. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 883 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 884 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 885 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 886 | typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 887 | |
| 888 | /*! @brief The function signature for window focus/defocus callbacks. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 889 | * |
| 890 | * This is the function signature for window focus callback functions. |
| 891 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 892 | * @param[in] window The window that gained or lost input focus. |
Camilla Berglund | 0eccf75 | 2015-08-23 19:30:04 +0200 | [diff] [blame] | 893 | * @param[in] focused `GLFW_TRUE` if the window was given input focus, or |
| 894 | * `GLFW_FALSE` if it lost it. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 895 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 896 | * @sa @ref window_focus |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 897 | * @sa glfwSetWindowFocusCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 898 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 899 | * @since Added in version 3.0. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 900 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 901 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 902 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 903 | typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 904 | |
Camilla Berglund | 06e7a96 | 2012-11-22 19:14:27 +0100 | [diff] [blame] | 905 | /*! @brief The function signature for window iconify/restore callbacks. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 906 | * |
| 907 | * This is the function signature for window iconify/restore callback |
| 908 | * functions. |
| 909 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 910 | * @param[in] window The window that was iconified or restored. |
Camilla Berglund | 0eccf75 | 2015-08-23 19:30:04 +0200 | [diff] [blame] | 911 | * @param[in] iconified `GLFW_TRUE` if the window was iconified, or |
| 912 | * `GLFW_FALSE` if it was restored. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 913 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 914 | * @sa @ref window_iconify |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 915 | * @sa glfwSetWindowIconifyCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 916 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 917 | * @since Added in version 3.0. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 918 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 919 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 920 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 921 | typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 922 | |
Camilla Berglund | 3498163 | 2013-06-03 12:51:57 +0200 | [diff] [blame] | 923 | /*! @brief The function signature for framebuffer resize callbacks. |
| 924 | * |
| 925 | * This is the function signature for framebuffer resize callback |
| 926 | * functions. |
| 927 | * |
| 928 | * @param[in] window The window whose framebuffer was resized. |
| 929 | * @param[in] width The new width, in pixels, of the framebuffer. |
| 930 | * @param[in] height The new height, in pixels, of the framebuffer. |
| 931 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 932 | * @sa @ref window_fbsize |
Camilla Berglund | 3498163 | 2013-06-03 12:51:57 +0200 | [diff] [blame] | 933 | * @sa glfwSetFramebufferSizeCallback |
| 934 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 935 | * @since Added in version 3.0. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 936 | * |
Camilla Berglund | 3498163 | 2013-06-03 12:51:57 +0200 | [diff] [blame] | 937 | * @ingroup window |
| 938 | */ |
| 939 | typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int); |
| 940 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 941 | /*! @brief The function signature for mouse button callbacks. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 942 | * |
| 943 | * This is the function signature for mouse button callback functions. |
| 944 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 945 | * @param[in] window The window that received the event. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 946 | * @param[in] button The [mouse button](@ref buttons) that was pressed or |
| 947 | * released. |
| 948 | * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`. |
Camilla Berglund | 98cbf6f | 2013-05-23 14:42:33 +0200 | [diff] [blame] | 949 | * @param[in] mods Bit field describing which [modifier keys](@ref mods) were |
| 950 | * held down. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 951 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 952 | * @sa @ref input_mouse_button |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 953 | * @sa glfwSetMouseButtonCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 954 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 955 | * @since Added in version 1.0. |
| 956 | * @glfw3 Added window handle and modifier mask parameters. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 957 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 958 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 959 | */ |
Camilla Berglund | 2d1b835 | 2012-12-09 19:19:00 +0100 | [diff] [blame] | 960 | typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 961 | |
| 962 | /*! @brief The function signature for cursor position callbacks. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 963 | * |
| 964 | * This is the function signature for cursor position callback functions. |
| 965 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 966 | * @param[in] window The window that received the event. |
Camilla Berglund | 95c44ab | 2016-02-17 14:52:01 +0100 | [diff] [blame] | 967 | * @param[in] xpos The new cursor x-coordinate, relative to the left edge of |
| 968 | * the client area. |
| 969 | * @param[in] ypos The new cursor y-coordinate, relative to the top edge of the |
| 970 | * client area. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 971 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 972 | * @sa @ref cursor_pos |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 973 | * @sa glfwSetCursorPosCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 974 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 975 | * @since Added in version 3.0. Replaces `GLFWmouseposfun`. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 976 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 977 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 978 | */ |
Camilla Berglund | 129e94d | 2013-04-04 16:16:21 +0200 | [diff] [blame] | 979 | typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 980 | |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 981 | /*! @brief The function signature for cursor enter/leave callbacks. |
| 982 | * |
| 983 | * This is the function signature for cursor enter/leave callback functions. |
| 984 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 985 | * @param[in] window The window that received the event. |
Camilla Berglund | 0eccf75 | 2015-08-23 19:30:04 +0200 | [diff] [blame] | 986 | * @param[in] entered `GLFW_TRUE` if the cursor entered the window's client |
| 987 | * area, or `GLFW_FALSE` if it left it. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 988 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 989 | * @sa @ref cursor_enter |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 990 | * @sa glfwSetCursorEnterCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 991 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 992 | * @since Added in version 3.0. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 993 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 994 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 995 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 996 | typedef void (* GLFWcursorenterfun)(GLFWwindow*,int); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 997 | |
| 998 | /*! @brief The function signature for scroll callbacks. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 999 | * |
| 1000 | * This is the function signature for scroll callback functions. |
| 1001 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1002 | * @param[in] window The window that received the event. |
mewmew | cf2d260 | 2013-06-06 19:49:23 +0200 | [diff] [blame] | 1003 | * @param[in] xoffset The scroll offset along the x-axis. |
| 1004 | * @param[in] yoffset The scroll offset along the y-axis. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1005 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 1006 | * @sa @ref scrolling |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1007 | * @sa glfwSetScrollCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 1008 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1009 | * @since Added in version 3.0. Replaces `GLFWmousewheelfun`. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 1010 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 1011 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1012 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 1013 | typedef void (* GLFWscrollfun)(GLFWwindow*,double,double); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1014 | |
| 1015 | /*! @brief The function signature for keyboard key callbacks. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 1016 | * |
| 1017 | * This is the function signature for keyboard key callback functions. |
| 1018 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1019 | * @param[in] window The window that received the event. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 1020 | * @param[in] key The [keyboard key](@ref keys) that was pressed or released. |
Camilla Berglund | 11615fc | 2013-05-30 17:19:12 +0200 | [diff] [blame] | 1021 | * @param[in] scancode The system-specific scancode of the key. |
Camilla Berglund | 95654cf | 2014-10-02 17:35:10 +0200 | [diff] [blame] | 1022 | * @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`. |
Camilla Berglund | 98cbf6f | 2013-05-23 14:42:33 +0200 | [diff] [blame] | 1023 | * @param[in] mods Bit field describing which [modifier keys](@ref mods) were |
| 1024 | * held down. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1025 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 1026 | * @sa @ref input_key |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1027 | * @sa glfwSetKeyCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 1028 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1029 | * @since Added in version 1.0. |
| 1030 | * @glfw3 Added window handle, scancode and modifier mask parameters. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 1031 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 1032 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1033 | */ |
Camilla Berglund | 11615fc | 2013-05-30 17:19:12 +0200 | [diff] [blame] | 1034 | typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1035 | |
| 1036 | /*! @brief The function signature for Unicode character callbacks. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 1037 | * |
| 1038 | * This is the function signature for Unicode character callback functions. |
| 1039 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1040 | * @param[in] window The window that received the event. |
Camilla Berglund | 2c920fb | 2013-10-10 19:41:56 +0200 | [diff] [blame] | 1041 | * @param[in] codepoint The Unicode code point of the character. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1042 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 1043 | * @sa @ref input_char |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1044 | * @sa glfwSetCharCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 1045 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1046 | * @since Added in version 2.4. |
| 1047 | * @glfw3 Added window handle parameter. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 1048 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 1049 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1050 | */ |
Camilla Berglund | 182e0af | 2013-02-25 17:02:28 +0100 | [diff] [blame] | 1051 | typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int); |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1052 | |
Camilla Berglund | 96b12ee | 2014-06-12 23:04:20 +0200 | [diff] [blame] | 1053 | /*! @brief The function signature for Unicode character with modifiers |
| 1054 | * callbacks. |
| 1055 | * |
| 1056 | * This is the function signature for Unicode character with modifiers callback |
| 1057 | * functions. It is called for each input character, regardless of what |
| 1058 | * modifier keys are held down. |
| 1059 | * |
| 1060 | * @param[in] window The window that received the event. |
| 1061 | * @param[in] codepoint The Unicode code point of the character. |
| 1062 | * @param[in] mods Bit field describing which [modifier keys](@ref mods) were |
| 1063 | * held down. |
| 1064 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 1065 | * @sa @ref input_char |
Camilla Berglund | 96b12ee | 2014-06-12 23:04:20 +0200 | [diff] [blame] | 1066 | * @sa glfwSetCharModsCallback |
| 1067 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1068 | * @since Added in version 3.1. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 1069 | * |
Camilla Berglund | 96b12ee | 2014-06-12 23:04:20 +0200 | [diff] [blame] | 1070 | * @ingroup input |
| 1071 | */ |
| 1072 | typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int); |
| 1073 | |
Camilla Berglund | 5c8121e | 2014-03-29 21:35:21 +0100 | [diff] [blame] | 1074 | /*! @brief The function signature for file drop callbacks. |
arturo | 89d0723 | 2013-07-10 11:42:14 +0200 | [diff] [blame] | 1075 | * |
Camilla Berglund | 5c8121e | 2014-03-29 21:35:21 +0100 | [diff] [blame] | 1076 | * This is the function signature for file drop callbacks. |
arturo | 89d0723 | 2013-07-10 11:42:14 +0200 | [diff] [blame] | 1077 | * |
| 1078 | * @param[in] window The window that received the event. |
Camilla Berglund | 5c8121e | 2014-03-29 21:35:21 +0100 | [diff] [blame] | 1079 | * @param[in] count The number of dropped files. |
Camilla Berglund | 93855ae | 2015-01-27 23:04:22 +0100 | [diff] [blame] | 1080 | * @param[in] paths The UTF-8 encoded file and/or directory path names. |
arturo | 89d0723 | 2013-07-10 11:42:14 +0200 | [diff] [blame] | 1081 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 1082 | * @sa @ref path_drop |
arturo | 89d0723 | 2013-07-10 11:42:14 +0200 | [diff] [blame] | 1083 | * @sa glfwSetDropCallback |
| 1084 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1085 | * @since Added in version 3.1. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 1086 | * |
arturo | 89d0723 | 2013-07-10 11:42:14 +0200 | [diff] [blame] | 1087 | * @ingroup input |
| 1088 | */ |
Camilla Berglund | 8f349e8 | 2013-12-22 19:28:46 +0100 | [diff] [blame] | 1089 | typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**); |
arturo | 89d0723 | 2013-07-10 11:42:14 +0200 | [diff] [blame] | 1090 | |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1091 | /*! @brief The function signature for monitor configuration callbacks. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 1092 | * |
| 1093 | * This is the function signature for monitor configuration callback functions. |
| 1094 | * |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1095 | * @param[in] monitor The monitor that was connected or disconnected. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 1096 | * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1097 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 1098 | * @sa @ref monitor_event |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1099 | * @sa glfwSetMonitorCallback |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 1100 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1101 | * @since Added in version 3.0. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 1102 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 1103 | * @ingroup monitor |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1104 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 1105 | typedef void (* GLFWmonitorfun)(GLFWmonitor*,int); |
Camilla Berglund | 897558f | 2011-03-07 13:34:58 +0100 | [diff] [blame] | 1106 | |
Camilla Berglund | 8a7fa30 | 2015-12-13 17:38:50 +0100 | [diff] [blame] | 1107 | /*! @brief The function signature for joystick configuration callbacks. |
| 1108 | * |
| 1109 | * This is the function signature for joystick configuration callback |
| 1110 | * functions. |
| 1111 | * |
| 1112 | * @param[in] joy The joystick that was connected or disconnected. |
| 1113 | * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. |
| 1114 | * |
| 1115 | * @sa @ref joystick_event |
| 1116 | * @sa glfwSetJoystickCallback |
| 1117 | * |
| 1118 | * @since Added in version 3.2. |
| 1119 | * |
| 1120 | * @ingroup input |
| 1121 | */ |
| 1122 | typedef void (* GLFWjoystickfun)(int,int); |
| 1123 | |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 1124 | /*! @brief Video mode type. |
| 1125 | * |
| 1126 | * This describes a single video mode. |
| 1127 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 1128 | * @sa @ref monitor_modes |
| 1129 | * @sa glfwGetVideoMode glfwGetVideoModes |
| 1130 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1131 | * @since Added in version 1.0. |
| 1132 | * @glfw3 Added refresh rate member. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 1133 | * |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 1134 | * @ingroup monitor |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1135 | */ |
Systemcluster | d0a0e37 | 2013-08-29 06:15:55 +0200 | [diff] [blame] | 1136 | typedef struct GLFWvidmode |
Camilla Berglund | 5fd3fc7 | 2010-09-09 19:44:43 +0200 | [diff] [blame] | 1137 | { |
Camilla Berglund | 95835af | 2013-05-30 13:53:25 +0200 | [diff] [blame] | 1138 | /*! The width, in screen coordinates, of the video mode. |
Camilla Berglund | c159411 | 2013-05-27 22:29:06 +0200 | [diff] [blame] | 1139 | */ |
Camilla Berglund | 5fd3fc7 | 2010-09-09 19:44:43 +0200 | [diff] [blame] | 1140 | int width; |
Camilla Berglund | 95835af | 2013-05-30 13:53:25 +0200 | [diff] [blame] | 1141 | /*! The height, in screen coordinates, of the video mode. |
Camilla Berglund | c159411 | 2013-05-27 22:29:06 +0200 | [diff] [blame] | 1142 | */ |
Camilla Berglund | 5fd3fc7 | 2010-09-09 19:44:43 +0200 | [diff] [blame] | 1143 | int height; |
Camilla Berglund | c159411 | 2013-05-27 22:29:06 +0200 | [diff] [blame] | 1144 | /*! The bit depth of the red channel of the video mode. |
| 1145 | */ |
Camilla Berglund | 5fd3fc7 | 2010-09-09 19:44:43 +0200 | [diff] [blame] | 1146 | int redBits; |
Camilla Berglund | c159411 | 2013-05-27 22:29:06 +0200 | [diff] [blame] | 1147 | /*! The bit depth of the green channel of the video mode. |
| 1148 | */ |
Camilla Berglund | 5fd3fc7 | 2010-09-09 19:44:43 +0200 | [diff] [blame] | 1149 | int greenBits; |
Camilla Berglund | c159411 | 2013-05-27 22:29:06 +0200 | [diff] [blame] | 1150 | /*! The bit depth of the blue channel of the video mode. |
| 1151 | */ |
Camilla Berglund | 2e8446f | 2013-04-11 01:31:00 +0200 | [diff] [blame] | 1152 | int blueBits; |
Camilla Berglund | 731812c | 2013-05-30 15:52:42 +0200 | [diff] [blame] | 1153 | /*! The refresh rate, in Hz, of the video mode. |
| 1154 | */ |
| 1155 | int refreshRate; |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 1156 | } GLFWvidmode; |
| 1157 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1158 | /*! @brief Gamma ramp. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 1159 | * |
| 1160 | * This describes the gamma ramp for a monitor. |
| 1161 | * |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 1162 | * @sa @ref monitor_gamma |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 1163 | * @sa glfwGetGammaRamp glfwSetGammaRamp |
| 1164 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1165 | * @since Added in version 3.0. |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 1166 | * |
Camilla Berglund | f5f55e3 | 2013-06-17 12:56:36 +0200 | [diff] [blame] | 1167 | * @ingroup monitor |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1168 | */ |
Systemcluster | d0a0e37 | 2013-08-29 06:15:55 +0200 | [diff] [blame] | 1169 | typedef struct GLFWgammaramp |
Camilla Berglund | 2630d49 | 2010-10-13 04:04:43 +0200 | [diff] [blame] | 1170 | { |
Camilla Berglund | c159411 | 2013-05-27 22:29:06 +0200 | [diff] [blame] | 1171 | /*! An array of value describing the response of the red channel. |
| 1172 | */ |
Camilla Berglund | 5d308db | 2013-05-19 15:46:44 +0200 | [diff] [blame] | 1173 | unsigned short* red; |
Camilla Berglund | c159411 | 2013-05-27 22:29:06 +0200 | [diff] [blame] | 1174 | /*! An array of value describing the response of the green channel. |
| 1175 | */ |
Camilla Berglund | 5d308db | 2013-05-19 15:46:44 +0200 | [diff] [blame] | 1176 | unsigned short* green; |
Camilla Berglund | c159411 | 2013-05-27 22:29:06 +0200 | [diff] [blame] | 1177 | /*! An array of value describing the response of the blue channel. |
| 1178 | */ |
Camilla Berglund | 5d308db | 2013-05-19 15:46:44 +0200 | [diff] [blame] | 1179 | unsigned short* blue; |
Camilla Berglund | c159411 | 2013-05-27 22:29:06 +0200 | [diff] [blame] | 1180 | /*! The number of elements in each array. |
| 1181 | */ |
Camilla Berglund | 5d308db | 2013-05-19 15:46:44 +0200 | [diff] [blame] | 1182 | unsigned int size; |
Camilla Berglund | 2630d49 | 2010-10-13 04:04:43 +0200 | [diff] [blame] | 1183 | } GLFWgammaramp; |
| 1184 | |
Camilla Berglund | 8fa9cc0 | 2014-02-23 16:43:17 +0100 | [diff] [blame] | 1185 | /*! @brief Image data. |
Camilla Berglund | 9d71eb4 | 2015-11-05 09:24:16 +0100 | [diff] [blame] | 1186 | * |
| 1187 | * @sa @ref cursor_custom |
Camilla Berglund | fe0317a | 2016-08-01 11:51:30 +0200 | [diff] [blame] | 1188 | * @sa @ref window_icon |
Camilla Berglund | 810bab7 | 2015-12-13 17:38:14 +0100 | [diff] [blame] | 1189 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1190 | * @since Added in version 2.1. |
| 1191 | * @glfw3 Removed format and bytes-per-pixel members. |
Camilla Berglund | 8fa9cc0 | 2014-02-23 16:43:17 +0100 | [diff] [blame] | 1192 | */ |
| 1193 | typedef struct GLFWimage |
| 1194 | { |
| 1195 | /*! The width, in pixels, of this image. |
| 1196 | */ |
| 1197 | int width; |
| 1198 | /*! The height, in pixels, of this image. |
| 1199 | */ |
| 1200 | int height; |
| 1201 | /*! The pixel data of this image, arranged left-to-right, top-to-bottom. |
| 1202 | */ |
| 1203 | unsigned char* pixels; |
| 1204 | } GLFWimage; |
| 1205 | |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 1206 | |
| 1207 | /************************************************************************* |
Camilla Berglund | 2fca5c5 | 2013-01-17 21:51:39 +0100 | [diff] [blame] | 1208 | * GLFW API functions |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 1209 | *************************************************************************/ |
| 1210 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1211 | /*! @brief Initializes the GLFW library. |
| 1212 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1213 | * This function initializes the GLFW library. Before most GLFW functions can |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1214 | * be used, GLFW must be initialized, and before an application terminates GLFW |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1215 | * should be terminated in order to free any resources allocated during or |
| 1216 | * after initialization. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1217 | * |
Camilla Berglund | 23f6176 | 2013-03-12 19:53:29 +0100 | [diff] [blame] | 1218 | * If this function fails, it calls @ref glfwTerminate before returning. If it |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1219 | * succeeds, you should call @ref glfwTerminate before the application exits. |
Camilla Berglund | 23f6176 | 2013-03-12 19:53:29 +0100 | [diff] [blame] | 1220 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1221 | * Additional calls to this function after successful initialization but before |
Camilla Berglund | 0eccf75 | 2015-08-23 19:30:04 +0200 | [diff] [blame] | 1222 | * termination will return `GLFW_TRUE` immediately. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1223 | * |
Camilla Berglund | 0eccf75 | 2015-08-23 19:30:04 +0200 | [diff] [blame] | 1224 | * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1225 | * [error](@ref error_handling) occurred. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1226 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1227 | * @errors Possible errors include @ref GLFW_PLATFORM_ERROR. |
| 1228 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1229 | * @remark @osx This function will change the current directory of the |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 1230 | * application to the `Contents/Resources` subdirectory of the application's |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1231 | * bundle, if present. This can be disabled with a |
| 1232 | * [compile-time option](@ref compile_options_osx). |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1233 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1234 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1235 | * |
| 1236 | * @sa @ref intro_init |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1237 | * @sa glfwTerminate |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1238 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1239 | * @since Added in version 1.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1240 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1241 | * @ingroup init |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1242 | */ |
| 1243 | GLFWAPI int glfwInit(void); |
| 1244 | |
| 1245 | /*! @brief Terminates the GLFW library. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1246 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1247 | * This function destroys all remaining windows and cursors, restores any |
| 1248 | * modified gamma ramps and frees any other allocated resources. Once this |
| 1249 | * function is called, you must again call @ref glfwInit successfully before |
| 1250 | * you will be able to use most GLFW functions. |
Camilla Berglund | 23f6176 | 2013-03-12 19:53:29 +0100 | [diff] [blame] | 1251 | * |
| 1252 | * If GLFW has been successfully initialized, this function should be called |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1253 | * before the application exits. If initialization fails, there is no need to |
| 1254 | * call this function, as it is called by @ref glfwInit before it returns |
| 1255 | * failure. |
Camilla Berglund | 23f6176 | 2013-03-12 19:53:29 +0100 | [diff] [blame] | 1256 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1257 | * @errors Possible errors include @ref GLFW_PLATFORM_ERROR. |
| 1258 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1259 | * @remark This function may be called before @ref glfwInit. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1260 | * |
Camilla Berglund | 0df4e06 | 2015-12-13 14:07:27 +0100 | [diff] [blame] | 1261 | * @warning The contexts of any remaining windows must not be current on any |
| 1262 | * other thread when this function is called. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1263 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1264 | * @reentrancy This function must not be called from a callback. |
Camilla Berglund | 2085876 | 2015-01-01 18:41:22 +0100 | [diff] [blame] | 1265 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1266 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1267 | * |
| 1268 | * @sa @ref intro_init |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1269 | * @sa glfwInit |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1270 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1271 | * @since Added in version 1.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1272 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1273 | * @ingroup init |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1274 | */ |
Camilla Berglund | 9a71669 | 2010-09-08 16:40:43 +0200 | [diff] [blame] | 1275 | GLFWAPI void glfwTerminate(void); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1276 | |
| 1277 | /*! @brief Retrieves the version of the GLFW library. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1278 | * |
| 1279 | * This function retrieves the major, minor and revision numbers of the GLFW |
| 1280 | * library. It is intended for when you are using GLFW as a shared library and |
| 1281 | * want to ensure that you are using the minimum required version. |
| 1282 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1283 | * Any or all of the version arguments may be `NULL`. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1284 | * |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 1285 | * @param[out] major Where to store the major version number, or `NULL`. |
| 1286 | * @param[out] minor Where to store the minor version number, or `NULL`. |
| 1287 | * @param[out] rev Where to store the revision number, or `NULL`. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1288 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1289 | * @errors None. |
| 1290 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1291 | * @remark This function may be called before @ref glfwInit. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1292 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1293 | * @thread_safety This function may be called from any thread. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1294 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1295 | * @sa @ref intro_version |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1296 | * @sa glfwGetVersionString |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1297 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1298 | * @since Added in version 1.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1299 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1300 | * @ingroup init |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1301 | */ |
Camilla Berglund | 9a71669 | 2010-09-08 16:40:43 +0200 | [diff] [blame] | 1302 | GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1303 | |
Camilla Berglund | 6f8084f | 2013-02-14 13:14:17 +0100 | [diff] [blame] | 1304 | /*! @brief Returns a string describing the compile-time configuration. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1305 | * |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 1306 | * This function returns the compile-time generated |
| 1307 | * [version string](@ref intro_version_string) of the GLFW library binary. It |
| 1308 | * describes the version, platform, compiler and any platform-specific |
Camilla Berglund | 386b603 | 2016-02-10 13:48:49 +0100 | [diff] [blame] | 1309 | * compile-time options. It should not be confused with the OpenGL or OpenGL |
| 1310 | * ES version string, queried with `glGetString`. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1311 | * |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 1312 | * __Do not use the version string__ to parse the GLFW library version. The |
Camilla Berglund | 386b603 | 2016-02-10 13:48:49 +0100 | [diff] [blame] | 1313 | * @ref glfwGetVersion function provides the version of the running library |
| 1314 | * binary in numerical format. |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 1315 | * |
Camilla Berglund | 386b603 | 2016-02-10 13:48:49 +0100 | [diff] [blame] | 1316 | * @return The ASCII encoded GLFW version string. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 1317 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1318 | * @errors None. |
| 1319 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1320 | * @remark This function may be called before @ref glfwInit. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1321 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1322 | * @pointer_lifetime The returned string is static and compile-time generated. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1323 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1324 | * @thread_safety This function may be called from any thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1325 | * |
| 1326 | * @sa @ref intro_version |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1327 | * @sa glfwGetVersion |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1328 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1329 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1330 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1331 | * @ingroup init |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1332 | */ |
Camilla Berglund | d6fe447 | 2010-09-13 18:05:59 +0200 | [diff] [blame] | 1333 | GLFWAPI const char* glfwGetVersionString(void); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 1334 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1335 | /*! @brief Sets the error callback. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1336 | * |
| 1337 | * This function sets the error callback, which is called with an error code |
| 1338 | * and a human-readable description each time a GLFW error occurs. |
| 1339 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1340 | * The error callback is called on the thread where the error occurred. If you |
| 1341 | * are using GLFW from multiple threads, your error callback needs to be |
| 1342 | * written accordingly. |
| 1343 | * |
| 1344 | * Because the description string may have been generated specifically for that |
| 1345 | * error, it is not guaranteed to be valid after the callback has returned. If |
| 1346 | * you wish to use it after the callback returns, you need to make a copy. |
| 1347 | * |
Camilla Berglund | 2085876 | 2015-01-01 18:41:22 +0100 | [diff] [blame] | 1348 | * Once set, the error callback remains set even after the library has been |
| 1349 | * terminated. |
| 1350 | * |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 1351 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1352 | * callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 1353 | * @return The previously set callback, or `NULL` if no callback was set. |
| 1354 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1355 | * @errors None. |
| 1356 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1357 | * @remark This function may be called before @ref glfwInit. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1358 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1359 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 1360 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1361 | * @sa @ref error_handling |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1362 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1363 | * @since Added in version 3.0. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1364 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1365 | * @ingroup init |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1366 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 1367 | GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun); |
Camilla Berglund | f5d74c4 | 2010-09-09 21:06:59 +0200 | [diff] [blame] | 1368 | |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1369 | /*! @brief Returns the currently connected monitors. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1370 | * |
| 1371 | * This function returns an array of handles for all currently connected |
Camilla Berglund | f5cbdba | 2015-09-17 16:37:09 +0200 | [diff] [blame] | 1372 | * monitors. The primary monitor is always first in the returned array. If no |
| 1373 | * monitors were found, this function returns `NULL`. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1374 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1375 | * @param[out] count Where to store the number of monitors in the returned |
| 1376 | * array. This is set to zero if an error occurred. |
Camilla Berglund | f5cbdba | 2015-09-17 16:37:09 +0200 | [diff] [blame] | 1377 | * @return An array of monitor handles, or `NULL` if no monitors were found or |
| 1378 | * if an [error](@ref error_handling) occurred. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1379 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1380 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 1381 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1382 | * @pointer_lifetime The returned array is allocated and freed by GLFW. You |
| 1383 | * should not free it yourself. It is guaranteed to be valid only until the |
| 1384 | * monitor configuration changes or the library is terminated. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 1385 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1386 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | c3bb5c9 | 2013-06-05 16:04:04 +0200 | [diff] [blame] | 1387 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1388 | * @sa @ref monitor_monitors |
| 1389 | * @sa @ref monitor_event |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1390 | * @sa glfwGetPrimaryMonitor |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1391 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1392 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1393 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1394 | * @ingroup monitor |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1395 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 1396 | GLFWAPI GLFWmonitor** glfwGetMonitors(int* count); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1397 | |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1398 | /*! @brief Returns the primary monitor. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1399 | * |
| 1400 | * This function returns the primary monitor. This is usually the monitor |
Camilla Berglund | f5cbdba | 2015-09-17 16:37:09 +0200 | [diff] [blame] | 1401 | * where elements like the task bar or global menu bar are located. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1402 | * |
Camilla Berglund | f5cbdba | 2015-09-17 16:37:09 +0200 | [diff] [blame] | 1403 | * @return The primary monitor, or `NULL` if no monitors were found or if an |
| 1404 | * [error](@ref error_handling) occurred. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1405 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1406 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 1407 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1408 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 1409 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1410 | * @remark The primary monitor is always first in the array returned by @ref |
Camilla Berglund | f5cbdba | 2015-09-17 16:37:09 +0200 | [diff] [blame] | 1411 | * glfwGetMonitors. |
| 1412 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1413 | * @sa @ref monitor_monitors |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1414 | * @sa glfwGetMonitors |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1415 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1416 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1417 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1418 | * @ingroup monitor |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 1419 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 1420 | GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void); |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 1421 | |
Camilla Berglund | ee5f30e | 2013-01-24 19:10:17 +0100 | [diff] [blame] | 1422 | /*! @brief Returns the position of the monitor's viewport on the virtual screen. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1423 | * |
| 1424 | * This function returns the position, in screen coordinates, of the upper-left |
| 1425 | * corner of the specified monitor. |
| 1426 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1427 | * Any or all of the position arguments may be `NULL`. If an error occurs, all |
| 1428 | * non-`NULL` position arguments will be set to zero. |
| 1429 | * |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1430 | * @param[in] monitor The monitor to query. |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 1431 | * @param[out] xpos Where to store the monitor x-coordinate, or `NULL`. |
| 1432 | * @param[out] ypos Where to store the monitor y-coordinate, or `NULL`. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1433 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1434 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 1435 | * GLFW_PLATFORM_ERROR. |
| 1436 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1437 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1438 | * |
| 1439 | * @sa @ref monitor_properties |
| 1440 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1441 | * @since Added in version 3.0. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 1442 | * |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1443 | * @ingroup monitor |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 1444 | */ |
Camilla Berglund | ee5f30e | 2013-01-24 19:10:17 +0100 | [diff] [blame] | 1445 | GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos); |
| 1446 | |
| 1447 | /*! @brief Returns the physical size of the monitor. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1448 | * |
| 1449 | * This function returns the size, in millimetres, of the display area of the |
| 1450 | * specified monitor. |
| 1451 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 1452 | * Some systems do not provide accurate monitor size information, either |
| 1453 | * because the monitor |
| 1454 | * [EDID](https://en.wikipedia.org/wiki/Extended_display_identification_data) |
| 1455 | * data is incorrect or because the driver does not report it accurately. |
| 1456 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1457 | * Any or all of the size arguments may be `NULL`. If an error occurs, all |
| 1458 | * non-`NULL` size arguments will be set to zero. |
| 1459 | * |
Camilla Berglund | ee5f30e | 2013-01-24 19:10:17 +0100 | [diff] [blame] | 1460 | * @param[in] monitor The monitor to query. |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 1461 | * @param[out] widthMM Where to store the width, in millimetres, of the |
| 1462 | * monitor's display area, or `NULL`. |
| 1463 | * @param[out] heightMM Where to store the height, in millimetres, of the |
| 1464 | * monitor's display area, or `NULL`. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1465 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1466 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 1467 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1468 | * @remark @win32 calculates the returned physical size from the |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 1469 | * current resolution and system DPI instead of querying the monitor EDID data. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 1470 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1471 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1472 | * |
| 1473 | * @sa @ref monitor_properties |
| 1474 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1475 | * @since Added in version 3.0. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1476 | * |
Camilla Berglund | ee5f30e | 2013-01-24 19:10:17 +0100 | [diff] [blame] | 1477 | * @ingroup monitor |
| 1478 | */ |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 1479 | GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* widthMM, int* heightMM); |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 1480 | |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1481 | /*! @brief Returns the name of the specified monitor. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1482 | * |
| 1483 | * This function returns a human-readable name, encoded as UTF-8, of the |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1484 | * specified monitor. The name typically reflects the make and model of the |
| 1485 | * monitor and is not guaranteed to be unique among the connected monitors. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1486 | * |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1487 | * @param[in] monitor The monitor to query. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1488 | * @return The UTF-8 encoded name of the monitor, or `NULL` if an |
| 1489 | * [error](@ref error_handling) occurred. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1490 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1491 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 1492 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1493 | * @pointer_lifetime The returned string is allocated and freed by GLFW. You |
| 1494 | * should not free it yourself. It is valid until the specified monitor is |
| 1495 | * disconnected or the library is terminated. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 1496 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1497 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1498 | * |
| 1499 | * @sa @ref monitor_properties |
| 1500 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1501 | * @since Added in version 3.0. |
Camilla Berglund | c3bb5c9 | 2013-06-05 16:04:04 +0200 | [diff] [blame] | 1502 | * |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1503 | * @ingroup monitor |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 1504 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 1505 | GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor); |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 1506 | |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1507 | /*! @brief Sets the monitor configuration callback. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1508 | * |
| 1509 | * This function sets the monitor configuration callback, or removes the |
| 1510 | * currently set callback. This is called when a monitor is connected to or |
| 1511 | * disconnected from the system. |
| 1512 | * |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 1513 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1514 | * callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 1515 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 1516 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1517 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1518 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 1519 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1520 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1521 | * |
| 1522 | * @sa @ref monitor_event |
| 1523 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1524 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1525 | * |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1526 | * @ingroup monitor |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 1527 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 1528 | GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun); |
Marcel Metz | beacbb3 | 2011-05-07 10:53:50 +0200 | [diff] [blame] | 1529 | |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 1530 | /*! @brief Returns the available video modes for the specified monitor. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1531 | * |
| 1532 | * This function returns an array of all video modes supported by the specified |
Camilla Berglund | 948cc04 | 2013-04-16 02:02:22 +0200 | [diff] [blame] | 1533 | * monitor. The returned array is sorted in ascending order, first by color |
| 1534 | * bit depth (the sum of all channel depths) and then by resolution area (the |
| 1535 | * product of width and height). |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1536 | * |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1537 | * @param[in] monitor The monitor to query. |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 1538 | * @param[out] count Where to store the number of video modes in the returned |
| 1539 | * array. This is set to zero if an error occurred. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1540 | * @return An array of video modes, or `NULL` if an |
| 1541 | * [error](@ref error_handling) occurred. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1542 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1543 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 1544 | * GLFW_PLATFORM_ERROR. |
| 1545 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1546 | * @pointer_lifetime The returned array is allocated and freed by GLFW. You |
| 1547 | * should not free it yourself. It is valid until the specified monitor is |
| 1548 | * disconnected, this function is called again for that monitor or the library |
| 1549 | * is terminated. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 1550 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1551 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | c3bb5c9 | 2013-06-05 16:04:04 +0200 | [diff] [blame] | 1552 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1553 | * @sa @ref monitor_modes |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1554 | * @sa glfwGetVideoMode |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1555 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1556 | * @since Added in version 1.0. |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1557 | * @glfw3 Changed to return an array of modes for a specific monitor. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1558 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1559 | * @ingroup monitor |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1560 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 1561 | GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count); |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 1562 | |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1563 | /*! @brief Returns the current mode of the specified monitor. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1564 | * |
Camilla Berglund | 948cc04 | 2013-04-16 02:02:22 +0200 | [diff] [blame] | 1565 | * This function returns the current video mode of the specified monitor. If |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1566 | * you have created a full screen window for that monitor, the return value |
| 1567 | * will depend on whether that window is iconified. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1568 | * |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 1569 | * @param[in] monitor The monitor to query. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1570 | * @return The current mode of the monitor, or `NULL` if an |
| 1571 | * [error](@ref error_handling) occurred. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1572 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1573 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 1574 | * GLFW_PLATFORM_ERROR. |
| 1575 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1576 | * @pointer_lifetime The returned array is allocated and freed by GLFW. You |
| 1577 | * should not free it yourself. It is valid until the specified monitor is |
| 1578 | * disconnected or the library is terminated. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 1579 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1580 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | c3bb5c9 | 2013-06-05 16:04:04 +0200 | [diff] [blame] | 1581 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1582 | * @sa @ref monitor_modes |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1583 | * @sa glfwGetVideoModes |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1584 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1585 | * @since Added in version 3.0. Replaces `glfwGetDesktopMode`. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1586 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1587 | * @ingroup monitor |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 1588 | */ |
Camilla Berglund | ce1e84d | 2013-05-22 22:16:43 +0200 | [diff] [blame] | 1589 | GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 1590 | |
Camilla Berglund | 92a71e0 | 2013-02-12 13:50:41 +0100 | [diff] [blame] | 1591 | /*! @brief Generates a gamma ramp and sets it for the specified monitor. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1592 | * |
Camilla Berglund | 5d308db | 2013-05-19 15:46:44 +0200 | [diff] [blame] | 1593 | * This function generates a 256-element gamma ramp from the specified exponent |
Camilla Berglund | 5bbc2b4 | 2015-03-15 15:40:43 +0100 | [diff] [blame] | 1594 | * and then calls @ref glfwSetGammaRamp with it. The value must be a finite |
| 1595 | * number greater than zero. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1596 | * |
Camilla Berglund | 92a71e0 | 2013-02-12 13:50:41 +0100 | [diff] [blame] | 1597 | * @param[in] monitor The monitor whose gamma ramp to set. |
Camilla Berglund | a3ff29a | 2012-12-02 15:47:10 +0100 | [diff] [blame] | 1598 | * @param[in] gamma The desired exponent. |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 1599 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1600 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 1601 | * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. |
| 1602 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1603 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 1604 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1605 | * @sa @ref monitor_gamma |
| 1606 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1607 | * @since Added in version 3.0. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 1608 | * |
Camilla Berglund | f5f55e3 | 2013-06-17 12:56:36 +0200 | [diff] [blame] | 1609 | * @ingroup monitor |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1610 | */ |
Camilla Berglund | 92a71e0 | 2013-02-12 13:50:41 +0100 | [diff] [blame] | 1611 | GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1612 | |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1613 | /*! @brief Returns the current gamma ramp for the specified monitor. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1614 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1615 | * This function returns the current gamma ramp of the specified monitor. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1616 | * |
Camilla Berglund | 92a71e0 | 2013-02-12 13:50:41 +0100 | [diff] [blame] | 1617 | * @param[in] monitor The monitor to query. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1618 | * @return The current gamma ramp, or `NULL` if an |
| 1619 | * [error](@ref error_handling) occurred. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1620 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1621 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 1622 | * GLFW_PLATFORM_ERROR. |
| 1623 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1624 | * @pointer_lifetime The returned structure and its arrays are allocated and |
| 1625 | * freed by GLFW. You should not free them yourself. They are valid until the |
| 1626 | * specified monitor is disconnected, this function is called again for that |
| 1627 | * monitor or the library is terminated. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 1628 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1629 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1630 | * |
| 1631 | * @sa @ref monitor_gamma |
| 1632 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1633 | * @since Added in version 3.0. |
Camilla Berglund | c3bb5c9 | 2013-06-05 16:04:04 +0200 | [diff] [blame] | 1634 | * |
Camilla Berglund | f5f55e3 | 2013-06-17 12:56:36 +0200 | [diff] [blame] | 1635 | * @ingroup monitor |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1636 | */ |
Camilla Berglund | 5d308db | 2013-05-19 15:46:44 +0200 | [diff] [blame] | 1637 | GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1638 | |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1639 | /*! @brief Sets the current gamma ramp for the specified monitor. |
| 1640 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1641 | * This function sets the current gamma ramp for the specified monitor. The |
| 1642 | * original gamma ramp for that monitor is saved by GLFW the first time this |
| 1643 | * function is called and is restored by @ref glfwTerminate. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1644 | * |
Camilla Berglund | 92a71e0 | 2013-02-12 13:50:41 +0100 | [diff] [blame] | 1645 | * @param[in] monitor The monitor whose gamma ramp to set. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1646 | * @param[in] ramp The gamma ramp to use. |
Camilla Berglund | 8954af6 | 2013-02-20 19:44:52 +0100 | [diff] [blame] | 1647 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1648 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 1649 | * GLFW_PLATFORM_ERROR. |
| 1650 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1651 | * @remark Gamma ramp sizes other than 256 are not supported by all platforms |
Camilla Berglund | 76fff4d | 2015-03-10 19:02:28 +0100 | [diff] [blame] | 1652 | * or graphics hardware. |
| 1653 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1654 | * @remark @win32 The gamma ramp size must be 256. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1655 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1656 | * @pointer_lifetime The specified gamma ramp is copied before this function |
| 1657 | * returns. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1658 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1659 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1660 | * |
| 1661 | * @sa @ref monitor_gamma |
| 1662 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1663 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1664 | * |
Camilla Berglund | f5f55e3 | 2013-06-17 12:56:36 +0200 | [diff] [blame] | 1665 | * @ingroup monitor |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1666 | */ |
Camilla Berglund | 92a71e0 | 2013-02-12 13:50:41 +0100 | [diff] [blame] | 1667 | GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp); |
Camilla Berglund | 2630d49 | 2010-10-13 04:04:43 +0200 | [diff] [blame] | 1668 | |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1669 | /*! @brief Resets all window hints to their default values. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1670 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1671 | * This function resets all window hints to their |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 1672 | * [default values](@ref window_hints_values). |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1673 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1674 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 1675 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1676 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 9ad1d97 | 2012-11-22 19:08:30 +0100 | [diff] [blame] | 1677 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1678 | * @sa @ref window_hints |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1679 | * @sa glfwWindowHint |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1680 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1681 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1682 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1683 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1684 | */ |
Camilla Berglund | 5df4df6 | 2012-10-22 02:59:05 +0200 | [diff] [blame] | 1685 | GLFWAPI void glfwDefaultWindowHints(void); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1686 | |
| 1687 | /*! @brief Sets the specified window hint to the desired value. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1688 | * |
Camilla Berglund | ed9e403 | 2012-12-23 15:59:09 +0100 | [diff] [blame] | 1689 | * This function sets hints for the next call to @ref glfwCreateWindow. The |
| 1690 | * hints, once set, retain their values until changed by a call to @ref |
| 1691 | * glfwWindowHint or @ref glfwDefaultWindowHints, or until the library is |
Camilla Berglund | 6be821c | 2014-10-06 23:18:33 +0200 | [diff] [blame] | 1692 | * terminated. |
Camilla Berglund | ed9e403 | 2012-12-23 15:59:09 +0100 | [diff] [blame] | 1693 | * |
Camilla Berglund | d6e0a43 | 2016-02-09 07:41:48 +0100 | [diff] [blame] | 1694 | * This function does not check whether the specified hint values are valid. |
| 1695 | * If you set hints to invalid values this will instead be reported by the next |
| 1696 | * call to @ref glfwCreateWindow. |
| 1697 | * |
Camilla Berglund | d0649e6 | 2016-01-27 03:25:21 +0100 | [diff] [blame] | 1698 | * @param[in] hint The [window hint](@ref window_hints) to set. |
| 1699 | * @param[in] value The new value of the window hint. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1700 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1701 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 1702 | * GLFW_INVALID_ENUM. |
| 1703 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1704 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 401033c | 2013-03-12 19:17:07 +0100 | [diff] [blame] | 1705 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1706 | * @sa @ref window_hints |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1707 | * @sa glfwDefaultWindowHints |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1708 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1709 | * @since Added in version 3.0. Replaces `glfwOpenWindowHint`. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1710 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1711 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1712 | */ |
Camilla Berglund | d0649e6 | 2016-01-27 03:25:21 +0100 | [diff] [blame] | 1713 | GLFWAPI void glfwWindowHint(int hint, int value); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1714 | |
| 1715 | /*! @brief Creates a window and its associated context. |
| 1716 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1717 | * This function creates a window and its associated OpenGL or OpenGL ES |
| 1718 | * context. Most of the options controlling how the window and its context |
| 1719 | * should be created are specified with [window hints](@ref window_hints). |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1720 | * |
| 1721 | * Successful creation does not change which context is current. Before you |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1722 | * can use the newly created context, you need to |
| 1723 | * [make it current](@ref context_current). For information about the `share` |
| 1724 | * parameter, see @ref context_sharing. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1725 | * |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 1726 | * The created window, framebuffer and context may differ from what you |
| 1727 | * requested, as not all parameters and hints are |
Camilla Berglund | fa0cbd9 | 2013-04-11 01:07:07 +0200 | [diff] [blame] | 1728 | * [hard constraints](@ref window_hints_hard). This includes the size of the |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1729 | * window, especially for full screen windows. To query the actual attributes |
Camilla Berglund | e8bceaa | 2015-04-07 14:37:42 +0200 | [diff] [blame] | 1730 | * of the created window, framebuffer and context, see @ref |
| 1731 | * glfwGetWindowAttrib, @ref glfwGetWindowSize and @ref glfwGetFramebufferSize. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1732 | * |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 1733 | * To create a full screen window, you need to specify the monitor the window |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 1734 | * will cover. If no monitor is specified, the window will be windowed mode. |
| 1735 | * Unless you have a way for the user to choose a specific monitor, it is |
| 1736 | * recommended that you pick the primary monitor. For more information on how |
| 1737 | * to query connected monitors, see @ref monitor_monitors. |
Camilla Berglund | 4b7ae49 | 2013-07-07 12:06:59 +0200 | [diff] [blame] | 1738 | * |
Camilla Berglund | 95654cf | 2014-10-02 17:35:10 +0200 | [diff] [blame] | 1739 | * For full screen windows, the specified size becomes the resolution of the |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 1740 | * window's _desired video mode_. As long as a full screen window is not |
| 1741 | * iconified, the supported video mode most closely matching the desired video |
| 1742 | * mode is set for the specified monitor. For more information about full |
| 1743 | * screen windows, including the creation of so called _windowed full screen_ |
| 1744 | * or _borderless full screen_ windows, see @ref window_windowed_full_screen. |
Camilla Berglund | 95654cf | 2014-10-02 17:35:10 +0200 | [diff] [blame] | 1745 | * |
Camilla Berglund | 999f355 | 2016-08-17 16:48:22 +0200 | [diff] [blame] | 1746 | * Once you have created the window, you can switch it between windowed and |
| 1747 | * full screen mode with @ref glfwSetWindowMonitor. If the window has an |
| 1748 | * OpenGL or OpenGL ES context, it will be unaffected. |
| 1749 | * |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 1750 | * By default, newly created windows use the placement recommended by the |
| 1751 | * window system. To create the window at a specific position, make it |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 1752 | * initially invisible using the [GLFW_VISIBLE](@ref window_hints_wnd) window |
| 1753 | * hint, set its [position](@ref window_pos) and then [show](@ref window_hide) |
| 1754 | * it. |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 1755 | * |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 1756 | * As long as at least one full screen window is not iconified, the screensaver |
| 1757 | * is prohibited from starting. |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 1758 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1759 | * Window systems put limits on window sizes. Very large or very small window |
| 1760 | * dimensions may be overridden by the window system on creation. Check the |
Camilla Berglund | 95654cf | 2014-10-02 17:35:10 +0200 | [diff] [blame] | 1761 | * actual [size](@ref window_size) after creation. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1762 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 1763 | * The [swap interval](@ref buffer_swap) is not set during window creation and |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1764 | * the initial value may vary depending on driver settings and defaults. |
| 1765 | * |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 1766 | * @param[in] width The desired width, in screen coordinates, of the window. |
| 1767 | * This must be greater than zero. |
| 1768 | * @param[in] height The desired height, in screen coordinates, of the window. |
| 1769 | * This must be greater than zero. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1770 | * @param[in] title The initial, UTF-8 encoded window title. |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 1771 | * @param[in] monitor The monitor to use for full screen mode, or `NULL` for |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 1772 | * windowed mode. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 1773 | * @param[in] share The window whose context to share resources with, or `NULL` |
| 1774 | * to not share resources. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1775 | * @return The handle of the created window, or `NULL` if an |
| 1776 | * [error](@ref error_handling) occurred. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1777 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1778 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 1779 | * GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_API_UNAVAILABLE, @ref |
| 1780 | * GLFW_VERSION_UNAVAILABLE, @ref GLFW_FORMAT_UNAVAILABLE and @ref |
| 1781 | * GLFW_PLATFORM_ERROR. |
| 1782 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1783 | * @remark @win32 Window creation will fail if the Microsoft GDI software |
| 1784 | * OpenGL implementation is the only one available. |
Camilla Berglund | 07db5da | 2013-09-26 19:15:36 +0200 | [diff] [blame] | 1785 | * |
Camilla Berglund | 20bce15 | 2016-05-30 16:04:37 +0200 | [diff] [blame] | 1786 | * @remark @win32 If the executable has an icon resource named `GLFW_ICON,` it |
| 1787 | * will be set as the initial icon for the window. If no such icon is present, |
| 1788 | * the `IDI_WINLOGO` icon will be used instead. To set a different icon, see |
| 1789 | * @ref glfwSetWindowIcon. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1790 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1791 | * @remark @win32 The context to share resources with must not be current on |
| 1792 | * any other thread. |
Camilla Berglund | b19fb4c | 2014-12-27 21:14:41 +0100 | [diff] [blame] | 1793 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1794 | * @remark @osx The GLFW window has no icon, as it is not a document |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 1795 | * window, but the dock icon will be the same as the application bundle's icon. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1796 | * For more information on bundles, see the |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 1797 | * [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/) |
| 1798 | * in the Mac Developer Library. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1799 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1800 | * @remark @osx The first time a window is created the menu bar is populated |
| 1801 | * with common commands like Hide, Quit and About. The About entry opens |
| 1802 | * a minimal about dialog with information from the application's bundle. The |
| 1803 | * menu bar can be disabled with a |
Camilla Berglund | 96d230b | 2014-10-07 02:15:36 +0200 | [diff] [blame] | 1804 | * [compile-time option](@ref compile_options_osx). |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1805 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1806 | * @remark @osx On OS X 10.10 and later the window frame will not be rendered |
| 1807 | * at full resolution on Retina displays unless the `NSHighResolutionCapable` |
| 1808 | * key is enabled in the application bundle's `Info.plist`. For more |
| 1809 | * information, see |
Camilla Berglund | 821f3e6 | 2015-03-16 22:39:14 +0100 | [diff] [blame] | 1810 | * [High Resolution Guidelines for OS X](https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html) |
Camilla Berglund | d12b343 | 2015-07-21 17:42:01 +0200 | [diff] [blame] | 1811 | * in the Mac Developer Library. The GLFW test and example programs use |
| 1812 | * a custom `Info.plist` template for this, which can be found as |
| 1813 | * `CMake/MacOSXBundleInfo.plist.in` in the source tree. |
Camilla Berglund | 821f3e6 | 2015-03-16 22:39:14 +0100 | [diff] [blame] | 1814 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1815 | * @remark @x11 Some window managers will not respect the placement of |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 1816 | * initially hidden windows. |
Camilla Berglund | 3af1c41 | 2013-09-19 21:37:01 +0200 | [diff] [blame] | 1817 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1818 | * @remark @x11 Due to the asynchronous nature of X11, it may take a moment for |
| 1819 | * a window to reach its requested state. This means you may not be able to |
| 1820 | * query the final size, position or other attributes directly after window |
| 1821 | * creation. |
Camilla Berglund | 20ed0a1 | 2015-08-12 21:31:54 +0200 | [diff] [blame] | 1822 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1823 | * @reentrancy This function must not be called from a callback. |
Camilla Berglund | 9ad1d97 | 2012-11-22 19:08:30 +0100 | [diff] [blame] | 1824 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1825 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1826 | * |
| 1827 | * @sa @ref window_creation |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1828 | * @sa glfwDestroyWindow |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1829 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1830 | * @since Added in version 3.0. Replaces `glfwOpenWindow`. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1831 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1832 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1833 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 1834 | GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1835 | |
| 1836 | /*! @brief Destroys the specified window and its context. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1837 | * |
| 1838 | * This function destroys the specified window and its context. On calling |
| 1839 | * this function, no further callbacks will be called for that window. |
| 1840 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1841 | * If the context of the specified window is current on the main thread, it is |
| 1842 | * detached before being destroyed. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1843 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1844 | * @param[in] window The window to destroy. |
Camilla Berglund | 9ad1d97 | 2012-11-22 19:08:30 +0100 | [diff] [blame] | 1845 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1846 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 1847 | * GLFW_PLATFORM_ERROR. |
| 1848 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1849 | * @note The context of the specified window must not be current on any other |
| 1850 | * thread when this function is called. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1851 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1852 | * @reentrancy This function must not be called from a callback. |
Camilla Berglund | 44372b8 | 2014-12-17 01:31:36 +0100 | [diff] [blame] | 1853 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1854 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1855 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1856 | * @sa @ref window_creation |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1857 | * @sa glfwCreateWindow |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1858 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1859 | * @since Added in version 3.0. Replaces `glfwCloseWindow`. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1860 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1861 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1862 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 1863 | GLFWAPI void glfwDestroyWindow(GLFWwindow* window); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1864 | |
Camilla Berglund | 64afb19 | 2013-03-06 23:29:37 +0100 | [diff] [blame] | 1865 | /*! @brief Checks the close flag of the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1866 | * |
| 1867 | * This function returns the value of the close flag of the specified window. |
| 1868 | * |
Camilla Berglund | 6fadf37 | 2013-03-01 13:45:12 +0100 | [diff] [blame] | 1869 | * @param[in] window The window to query. |
Camilla Berglund | 64afb19 | 2013-03-06 23:29:37 +0100 | [diff] [blame] | 1870 | * @return The value of the close flag. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1871 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1872 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 1873 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1874 | * @thread_safety This function may be called from any thread. Access is not |
| 1875 | * synchronized. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1876 | * |
| 1877 | * @sa @ref window_close |
| 1878 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1879 | * @since Added in version 3.0. |
Camilla Berglund | 6632cc7 | 2013-07-11 02:00:48 +0200 | [diff] [blame] | 1880 | * |
Camilla Berglund | 6fadf37 | 2013-03-01 13:45:12 +0100 | [diff] [blame] | 1881 | * @ingroup window |
| 1882 | */ |
| 1883 | GLFWAPI int glfwWindowShouldClose(GLFWwindow* window); |
| 1884 | |
Camilla Berglund | 64afb19 | 2013-03-06 23:29:37 +0100 | [diff] [blame] | 1885 | /*! @brief Sets the close flag of the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1886 | * |
| 1887 | * This function sets the value of the close flag of the specified window. |
| 1888 | * This can be used to override the user's attempt to close the window, or |
| 1889 | * to signal that it should be closed. |
| 1890 | * |
Camilla Berglund | 64afb19 | 2013-03-06 23:29:37 +0100 | [diff] [blame] | 1891 | * @param[in] window The window whose flag to change. |
Camilla Berglund | 6fadf37 | 2013-03-01 13:45:12 +0100 | [diff] [blame] | 1892 | * @param[in] value The new value. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1893 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1894 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 1895 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1896 | * @thread_safety This function may be called from any thread. Access is not |
| 1897 | * synchronized. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1898 | * |
| 1899 | * @sa @ref window_close |
| 1900 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1901 | * @since Added in version 3.0. |
Camilla Berglund | 6632cc7 | 2013-07-11 02:00:48 +0200 | [diff] [blame] | 1902 | * |
Camilla Berglund | 6fadf37 | 2013-03-01 13:45:12 +0100 | [diff] [blame] | 1903 | * @ingroup window |
Camilla Berglund | 6fadf37 | 2013-03-01 13:45:12 +0100 | [diff] [blame] | 1904 | */ |
| 1905 | GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value); |
| 1906 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1907 | /*! @brief Sets the title of the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1908 | * |
| 1909 | * This function sets the window title, encoded as UTF-8, of the specified |
| 1910 | * window. |
| 1911 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1912 | * @param[in] window The window whose title to change. |
| 1913 | * @param[in] title The UTF-8 encoded window title. |
Camilla Berglund | 9ad1d97 | 2012-11-22 19:08:30 +0100 | [diff] [blame] | 1914 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1915 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 1916 | * GLFW_PLATFORM_ERROR. |
| 1917 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1918 | * @remark @osx The window title will not be updated until the next time you |
| 1919 | * process events. |
Camilla Berglund | 6412dcb | 2015-04-07 21:52:29 +0200 | [diff] [blame] | 1920 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1921 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1922 | * |
| 1923 | * @sa @ref window_title |
| 1924 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1925 | * @since Added in version 1.0. |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1926 | * @glfw3 Added window handle parameter. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1927 | * |
| 1928 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1929 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 1930 | GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 1931 | |
Camilla Berglund | b823f71 | 2016-03-07 14:55:30 +0100 | [diff] [blame] | 1932 | /*! @brief Sets the icon for the specified window. |
| 1933 | * |
| 1934 | * This function sets the icon of the specified window. If passed an array of |
| 1935 | * candidate images, those of or closest to the sizes desired by the system are |
| 1936 | * selected. If no images are specified, the window reverts to its default |
| 1937 | * icon. |
| 1938 | * |
| 1939 | * The desired image sizes varies depending on platform and system settings. |
| 1940 | * The selected images will be rescaled as needed. Good sizes include 16x16, |
| 1941 | * 32x32 and 48x48. |
| 1942 | * |
| 1943 | * @param[in] window The window whose icon to set. |
| 1944 | * @param[in] count The number of images in the specified array, or zero to |
| 1945 | * revert to the default window icon. |
| 1946 | * @param[in] images The images to create the icon from. This is ignored if |
| 1947 | * count is zero. |
| 1948 | * |
| 1949 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 1950 | * GLFW_PLATFORM_ERROR. |
| 1951 | * |
| 1952 | * @pointer_lifetime The specified image data is copied before this function |
| 1953 | * returns. |
| 1954 | * |
| 1955 | * @remark @osx The GLFW window has no icon, as it is not a document |
Camilla Berglund | 20bce15 | 2016-05-30 16:04:37 +0200 | [diff] [blame] | 1956 | * window, so this function does nothing. The dock icon will be the same as |
| 1957 | * the application bundle's icon. For more information on bundles, see the |
Camilla Berglund | b823f71 | 2016-03-07 14:55:30 +0100 | [diff] [blame] | 1958 | * [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/) |
| 1959 | * in the Mac Developer Library. |
| 1960 | * |
| 1961 | * @thread_safety This function must only be called from the main thread. |
| 1962 | * |
| 1963 | * @sa @ref window_icon |
| 1964 | * |
| 1965 | * @since Added in version 3.2. |
| 1966 | * |
| 1967 | * @ingroup window |
| 1968 | */ |
| 1969 | GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* images); |
| 1970 | |
Camilla Berglund | 7c19323 | 2013-01-24 19:30:31 +0100 | [diff] [blame] | 1971 | /*! @brief Retrieves the position of the client area of the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1972 | * |
| 1973 | * This function retrieves the position, in screen coordinates, of the |
| 1974 | * upper-left corner of the client area of the specified window. |
| 1975 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1976 | * Any or all of the position arguments may be `NULL`. If an error occurs, all |
| 1977 | * non-`NULL` position arguments will be set to zero. |
| 1978 | * |
Camilla Berglund | 7c19323 | 2013-01-24 19:30:31 +0100 | [diff] [blame] | 1979 | * @param[in] window The window to query. |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 1980 | * @param[out] xpos Where to store the x-coordinate of the upper-left corner of |
| 1981 | * the client area, or `NULL`. |
| 1982 | * @param[out] ypos Where to store the y-coordinate of the upper-left corner of |
| 1983 | * the client area, or `NULL`. |
Camilla Berglund | 7c19323 | 2013-01-24 19:30:31 +0100 | [diff] [blame] | 1984 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 1985 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 1986 | * GLFW_PLATFORM_ERROR. |
| 1987 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 1988 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 1989 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1990 | * @sa @ref window_pos |
Camilla Berglund | 7c19323 | 2013-01-24 19:30:31 +0100 | [diff] [blame] | 1991 | * @sa glfwSetWindowPos |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1992 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 1993 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 1994 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 1995 | * @ingroup window |
Camilla Berglund | 7c19323 | 2013-01-24 19:30:31 +0100 | [diff] [blame] | 1996 | */ |
| 1997 | GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos); |
| 1998 | |
| 1999 | /*! @brief Sets the position of the client area of the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2000 | * |
| 2001 | * This function sets the position, in screen coordinates, of the upper-left |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2002 | * corner of the client area of the specified windowed mode window. If the |
| 2003 | * window is a full screen window, this function does nothing. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 2004 | * |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 2005 | * __Do not use this function__ to move an already visible window unless you |
| 2006 | * have very good reasons for doing so, as it will confuse and annoy the user. |
| 2007 | * |
| 2008 | * The window manager may put limits on what positions are allowed. GLFW |
| 2009 | * cannot and should not override these limits. |
| 2010 | * |
Camilla Berglund | 7c19323 | 2013-01-24 19:30:31 +0100 | [diff] [blame] | 2011 | * @param[in] window The window to query. |
| 2012 | * @param[in] xpos The x-coordinate of the upper-left corner of the client area. |
| 2013 | * @param[in] ypos The y-coordinate of the upper-left corner of the client area. |
Camilla Berglund | 7c19323 | 2013-01-24 19:30:31 +0100 | [diff] [blame] | 2014 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2015 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2016 | * GLFW_PLATFORM_ERROR. |
| 2017 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2018 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2019 | * |
| 2020 | * @sa @ref window_pos |
Camilla Berglund | 7c19323 | 2013-01-24 19:30:31 +0100 | [diff] [blame] | 2021 | * @sa glfwGetWindowPos |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2022 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2023 | * @since Added in version 1.0. |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2024 | * @glfw3 Added window handle parameter. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2025 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2026 | * @ingroup window |
Camilla Berglund | 7c19323 | 2013-01-24 19:30:31 +0100 | [diff] [blame] | 2027 | */ |
Camilla Berglund | 52f718d | 2013-02-12 12:01:12 +0100 | [diff] [blame] | 2028 | GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos); |
Camilla Berglund | 7c19323 | 2013-01-24 19:30:31 +0100 | [diff] [blame] | 2029 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2030 | /*! @brief Retrieves the size of the client area of the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2031 | * |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 2032 | * This function retrieves the size, in screen coordinates, of the client area |
Camilla Berglund | 521fa7d | 2013-09-26 20:02:19 +0200 | [diff] [blame] | 2033 | * of the specified window. If you wish to retrieve the size of the |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 2034 | * framebuffer of the window in pixels, see @ref glfwGetFramebufferSize. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2035 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2036 | * Any or all of the size arguments may be `NULL`. If an error occurs, all |
| 2037 | * non-`NULL` size arguments will be set to zero. |
| 2038 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2039 | * @param[in] window The window whose size to retrieve. |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 2040 | * @param[out] width Where to store the width, in screen coordinates, of the |
| 2041 | * client area, or `NULL`. |
| 2042 | * @param[out] height Where to store the height, in screen coordinates, of the |
| 2043 | * client area, or `NULL`. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2044 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2045 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2046 | * GLFW_PLATFORM_ERROR. |
| 2047 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2048 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2049 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2050 | * @sa @ref window_size |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2051 | * @sa glfwSetWindowSize |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2052 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2053 | * @since Added in version 1.0. |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2054 | * @glfw3 Added window handle parameter. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2055 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2056 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2057 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 2058 | GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2059 | |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2060 | /*! @brief Sets the size limits of the specified window. |
| 2061 | * |
| 2062 | * This function sets the size limits of the client area of the specified |
Emmanuel Gil Peyrot | f0f5d9f | 2016-04-09 00:42:58 +0100 | [diff] [blame] | 2063 | * window. If the window is full screen, the size limits only take effect |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 2064 | * once it is made windowed. If the window is not resizable, this function |
| 2065 | * does nothing. |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2066 | * |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 2067 | * The size limits are applied immediately to a windowed mode window and may |
| 2068 | * cause it to be resized. |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2069 | * |
Camilla Berglund | 12a6956 | 2016-05-04 16:28:08 +0200 | [diff] [blame] | 2070 | * The maximum dimensions must be greater than or equal to the minimum |
| 2071 | * dimensions and all must be greater than or equal to zero. |
| 2072 | * |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2073 | * @param[in] window The window to set limits for. |
| 2074 | * @param[in] minwidth The minimum width, in screen coordinates, of the client |
| 2075 | * area, or `GLFW_DONT_CARE`. |
| 2076 | * @param[in] minheight The minimum height, in screen coordinates, of the |
| 2077 | * client area, or `GLFW_DONT_CARE`. |
| 2078 | * @param[in] maxwidth The maximum width, in screen coordinates, of the client |
| 2079 | * area, or `GLFW_DONT_CARE`. |
| 2080 | * @param[in] maxheight The maximum height, in screen coordinates, of the |
| 2081 | * client area, or `GLFW_DONT_CARE`. |
| 2082 | * |
Camilla Berglund | 12a6956 | 2016-05-04 16:28:08 +0200 | [diff] [blame] | 2083 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 2084 | * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2085 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2086 | * @remark If you set size limits and an aspect ratio that conflict, the |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2087 | * results are undefined. |
| 2088 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2089 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2090 | * |
| 2091 | * @sa @ref window_sizelimits |
| 2092 | * @sa glfwSetWindowAspectRatio |
| 2093 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2094 | * @since Added in version 3.2. |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2095 | * |
| 2096 | * @ingroup window |
| 2097 | */ |
| 2098 | GLFWAPI void glfwSetWindowSizeLimits(GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight); |
| 2099 | |
| 2100 | /*! @brief Sets the aspect ratio of the specified window. |
| 2101 | * |
| 2102 | * This function sets the required aspect ratio of the client area of the |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 2103 | * specified window. If the window is full screen, the aspect ratio only takes |
| 2104 | * effect once it is made windowed. If the window is not resizable, this |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2105 | * function does nothing. |
| 2106 | * |
Camilla Berglund | af5b82a | 2015-10-19 16:01:42 +0200 | [diff] [blame] | 2107 | * The aspect ratio is specified as a numerator and a denominator and both |
| 2108 | * values must be greater than zero. For example, the common 16:9 aspect ratio |
| 2109 | * is specified as 16 and 9, respectively. |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2110 | * |
Camilla Berglund | af5b82a | 2015-10-19 16:01:42 +0200 | [diff] [blame] | 2111 | * If the numerator and denominator is set to `GLFW_DONT_CARE` then the aspect |
| 2112 | * ratio limit is disabled. |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2113 | * |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 2114 | * The aspect ratio is applied immediately to a windowed mode window and may |
| 2115 | * cause it to be resized. |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2116 | * |
| 2117 | * @param[in] window The window to set limits for. |
| 2118 | * @param[in] numer The numerator of the desired aspect ratio, or |
| 2119 | * `GLFW_DONT_CARE`. |
| 2120 | * @param[in] denom The denominator of the desired aspect ratio, or |
| 2121 | * `GLFW_DONT_CARE`. |
| 2122 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2123 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 2124 | * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. |
| 2125 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2126 | * @remark If you set size limits and an aspect ratio that conflict, the |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2127 | * results are undefined. |
| 2128 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2129 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2130 | * |
| 2131 | * @sa @ref window_sizelimits |
| 2132 | * @sa glfwSetWindowSizeLimits |
| 2133 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2134 | * @since Added in version 3.2. |
Camilla Berglund | d84772d | 2014-02-13 02:57:59 +0100 | [diff] [blame] | 2135 | * |
| 2136 | * @ingroup window |
| 2137 | */ |
| 2138 | GLFWAPI void glfwSetWindowAspectRatio(GLFWwindow* window, int numer, int denom); |
| 2139 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2140 | /*! @brief Sets the size of the client area of the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2141 | * |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 2142 | * This function sets the size, in screen coordinates, of the client area of |
| 2143 | * the specified window. |
| 2144 | * |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 2145 | * For full screen windows, this function updates the resolution of its desired |
| 2146 | * video mode and switches to the video mode closest to it, without affecting |
| 2147 | * the window's context. As the context is unaffected, the bit depths of the |
| 2148 | * framebuffer remain unchanged. |
| 2149 | * |
| 2150 | * If you wish to update the refresh rate of the desired video mode in addition |
| 2151 | * to its resolution, see @ref glfwSetWindowMonitor. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2152 | * |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 2153 | * The window manager may put limits on what sizes are allowed. GLFW cannot |
| 2154 | * and should not override these limits. |
| 2155 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2156 | * @param[in] window The window to resize. |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 2157 | * @param[in] width The desired width, in screen coordinates, of the window |
| 2158 | * client area. |
| 2159 | * @param[in] height The desired height, in screen coordinates, of the window |
| 2160 | * client area. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2161 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2162 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2163 | * GLFW_PLATFORM_ERROR. |
| 2164 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2165 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2166 | * |
| 2167 | * @sa @ref window_size |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2168 | * @sa glfwGetWindowSize |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 2169 | * @sa glfwSetWindowMonitor |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2170 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2171 | * @since Added in version 1.0. |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2172 | * @glfw3 Added window handle parameter. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2173 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2174 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2175 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 2176 | GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2177 | |
Camilla Berglund | 3498163 | 2013-06-03 12:51:57 +0200 | [diff] [blame] | 2178 | /*! @brief Retrieves the size of the framebuffer of the specified window. |
| 2179 | * |
| 2180 | * This function retrieves the size, in pixels, of the framebuffer of the |
Camilla Berglund | 521fa7d | 2013-09-26 20:02:19 +0200 | [diff] [blame] | 2181 | * specified window. If you wish to retrieve the size of the window in screen |
| 2182 | * coordinates, see @ref glfwGetWindowSize. |
Camilla Berglund | 3498163 | 2013-06-03 12:51:57 +0200 | [diff] [blame] | 2183 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2184 | * Any or all of the size arguments may be `NULL`. If an error occurs, all |
| 2185 | * non-`NULL` size arguments will be set to zero. |
| 2186 | * |
Camilla Berglund | 3498163 | 2013-06-03 12:51:57 +0200 | [diff] [blame] | 2187 | * @param[in] window The window whose framebuffer to query. |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 2188 | * @param[out] width Where to store the width, in pixels, of the framebuffer, |
| 2189 | * or `NULL`. |
| 2190 | * @param[out] height Where to store the height, in pixels, of the framebuffer, |
| 2191 | * or `NULL`. |
Camilla Berglund | 3498163 | 2013-06-03 12:51:57 +0200 | [diff] [blame] | 2192 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2193 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2194 | * GLFW_PLATFORM_ERROR. |
| 2195 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2196 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2197 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2198 | * @sa @ref window_fbsize |
Camilla Berglund | 3498163 | 2013-06-03 12:51:57 +0200 | [diff] [blame] | 2199 | * @sa glfwSetFramebufferSizeCallback |
| 2200 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2201 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2202 | * |
Camilla Berglund | 3498163 | 2013-06-03 12:51:57 +0200 | [diff] [blame] | 2203 | * @ingroup window |
| 2204 | */ |
| 2205 | GLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height); |
| 2206 | |
Camilla Berglund | eb3f75e | 2014-03-25 21:30:13 +0100 | [diff] [blame] | 2207 | /*! @brief Retrieves the size of the frame of the window. |
| 2208 | * |
| 2209 | * This function retrieves the size, in screen coordinates, of each edge of the |
| 2210 | * frame of the specified window. This size includes the title bar, if the |
| 2211 | * window has one. The size of the frame may vary depending on the |
| 2212 | * [window-related hints](@ref window_hints_wnd) used to create it. |
| 2213 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2214 | * Because this function retrieves the size of each window frame edge and not |
| 2215 | * the offset along a particular coordinate axis, the retrieved values will |
| 2216 | * always be zero or positive. |
| 2217 | * |
| 2218 | * Any or all of the size arguments may be `NULL`. If an error occurs, all |
| 2219 | * non-`NULL` size arguments will be set to zero. |
| 2220 | * |
Camilla Berglund | eb3f75e | 2014-03-25 21:30:13 +0100 | [diff] [blame] | 2221 | * @param[in] window The window whose frame size to query. |
| 2222 | * @param[out] left Where to store the size, in screen coordinates, of the left |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2223 | * edge of the window frame, or `NULL`. |
Camilla Berglund | eaff0f7 | 2014-04-07 16:27:32 +0200 | [diff] [blame] | 2224 | * @param[out] top Where to store the size, in screen coordinates, of the top |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2225 | * edge of the window frame, or `NULL`. |
Camilla Berglund | eaff0f7 | 2014-04-07 16:27:32 +0200 | [diff] [blame] | 2226 | * @param[out] right Where to store the size, in screen coordinates, of the |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2227 | * right edge of the window frame, or `NULL`. |
Camilla Berglund | eaff0f7 | 2014-04-07 16:27:32 +0200 | [diff] [blame] | 2228 | * @param[out] bottom Where to store the size, in screen coordinates, of the |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2229 | * bottom edge of the window frame, or `NULL`. |
Camilla Berglund | eb3f75e | 2014-03-25 21:30:13 +0100 | [diff] [blame] | 2230 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2231 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2232 | * GLFW_PLATFORM_ERROR. |
| 2233 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2234 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | eb3f75e | 2014-03-25 21:30:13 +0100 | [diff] [blame] | 2235 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2236 | * @sa @ref window_size |
| 2237 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2238 | * @since Added in version 3.1. |
Camilla Berglund | eb3f75e | 2014-03-25 21:30:13 +0100 | [diff] [blame] | 2239 | * |
| 2240 | * @ingroup window |
| 2241 | */ |
| 2242 | GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int* right, int* bottom); |
| 2243 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2244 | /*! @brief Iconifies the specified window. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2245 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2246 | * This function iconifies (minimizes) the specified window if it was |
| 2247 | * previously restored. If the window is already iconified, this function does |
| 2248 | * nothing. |
| 2249 | * |
| 2250 | * If the specified window is a full screen window, the original monitor |
| 2251 | * resolution is restored until the window is restored. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2252 | * |
| 2253 | * @param[in] window The window to iconify. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2254 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2255 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2256 | * GLFW_PLATFORM_ERROR. |
| 2257 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2258 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 9ad1d97 | 2012-11-22 19:08:30 +0100 | [diff] [blame] | 2259 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2260 | * @sa @ref window_iconify |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2261 | * @sa glfwRestoreWindow |
Camilla Berglund | a10caa4 | 2015-10-13 12:50:59 +0200 | [diff] [blame] | 2262 | * @sa glfwMaximizeWindow |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2263 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2264 | * @since Added in version 2.1. |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2265 | * @glfw3 Added window handle parameter. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2266 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2267 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2268 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 2269 | GLFWAPI void glfwIconifyWindow(GLFWwindow* window); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2270 | |
| 2271 | /*! @brief Restores the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2272 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2273 | * This function restores the specified window if it was previously iconified |
Camilla Berglund | a10caa4 | 2015-10-13 12:50:59 +0200 | [diff] [blame] | 2274 | * (minimized) or maximized. If the window is already restored, this function |
| 2275 | * does nothing. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2276 | * |
| 2277 | * If the specified window is a full screen window, the resolution chosen for |
| 2278 | * the window is restored on the selected monitor. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2279 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2280 | * @param[in] window The window to restore. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2281 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2282 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2283 | * GLFW_PLATFORM_ERROR. |
| 2284 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2285 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 9ad1d97 | 2012-11-22 19:08:30 +0100 | [diff] [blame] | 2286 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2287 | * @sa @ref window_iconify |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2288 | * @sa glfwIconifyWindow |
Camilla Berglund | a10caa4 | 2015-10-13 12:50:59 +0200 | [diff] [blame] | 2289 | * @sa glfwMaximizeWindow |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 2290 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2291 | * @since Added in version 2.1. |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2292 | * @glfw3 Added window handle parameter. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2293 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 2294 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2295 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 2296 | GLFWAPI void glfwRestoreWindow(GLFWwindow* window); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2297 | |
Camilla Berglund | a10caa4 | 2015-10-13 12:50:59 +0200 | [diff] [blame] | 2298 | /*! @brief Maximizes the specified window. |
| 2299 | * |
| 2300 | * This function maximizes the specified window if it was previously not |
| 2301 | * maximized. If the window is already maximized, this function does nothing. |
| 2302 | * |
| 2303 | * If the specified window is a full screen window, this function does nothing. |
| 2304 | * |
| 2305 | * @param[in] window The window to maximize. |
| 2306 | * |
Camilla Berglund | f5b71f5 | 2016-05-27 14:20:39 +0200 | [diff] [blame] | 2307 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2308 | * GLFW_PLATFORM_ERROR. |
| 2309 | * |
Camilla Berglund | a10caa4 | 2015-10-13 12:50:59 +0200 | [diff] [blame] | 2310 | * @par Thread Safety |
| 2311 | * This function may only be called from the main thread. |
| 2312 | * |
| 2313 | * @sa @ref window_iconify |
| 2314 | * @sa glfwIconifyWindow |
| 2315 | * @sa glfwRestoreWindow |
| 2316 | * |
| 2317 | * @since Added in GLFW 3.2. |
| 2318 | * |
| 2319 | * @ingroup window |
| 2320 | */ |
| 2321 | GLFWAPI void glfwMaximizeWindow(GLFWwindow* window); |
| 2322 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2323 | /*! @brief Makes the specified window visible. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2324 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2325 | * This function makes the specified window visible if it was previously |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 2326 | * hidden. If the window is already visible or is in full screen mode, this |
Camilla Berglund | 1e9383d | 2012-11-23 11:41:53 +0100 | [diff] [blame] | 2327 | * function does nothing. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2328 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2329 | * @param[in] window The window to make visible. |
| 2330 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2331 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2332 | * GLFW_PLATFORM_ERROR. |
| 2333 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2334 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 9ad1d97 | 2012-11-22 19:08:30 +0100 | [diff] [blame] | 2335 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2336 | * @sa @ref window_hide |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2337 | * @sa glfwHideWindow |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2338 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2339 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2340 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2341 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2342 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 2343 | GLFWAPI void glfwShowWindow(GLFWwindow* window); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2344 | |
| 2345 | /*! @brief Hides the specified window. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2346 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2347 | * This function hides the specified window if it was previously visible. If |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 2348 | * the window is already hidden or is in full screen mode, this function does |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2349 | * nothing. |
| 2350 | * |
| 2351 | * @param[in] window The window to hide. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2352 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2353 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2354 | * GLFW_PLATFORM_ERROR. |
| 2355 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2356 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 9ad1d97 | 2012-11-22 19:08:30 +0100 | [diff] [blame] | 2357 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2358 | * @sa @ref window_hide |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2359 | * @sa glfwShowWindow |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2360 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2361 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2362 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2363 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2364 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 2365 | GLFWAPI void glfwHideWindow(GLFWwindow* window); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2366 | |
Camilla Berglund | baf5744 | 2016-02-21 15:42:49 +0100 | [diff] [blame] | 2367 | /*! @brief Brings the specified window to front and sets input focus. |
| 2368 | * |
| 2369 | * This function brings the specified window to front and sets input focus. |
| 2370 | * The window should already be visible and not iconified. |
| 2371 | * |
| 2372 | * By default, both windowed and full screen mode windows are focused when |
| 2373 | * initially created. Set the [GLFW_FOCUSED](@ref window_hints_wnd) to disable |
| 2374 | * this behavior. |
| 2375 | * |
| 2376 | * __Do not use this function__ to steal focus from other applications unless |
| 2377 | * you are certain that is what the user wants. Focus stealing can be |
| 2378 | * extremely disruptive. |
| 2379 | * |
| 2380 | * @param[in] window The window to give input focus. |
| 2381 | * |
| 2382 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2383 | * GLFW_PLATFORM_ERROR. |
| 2384 | * |
| 2385 | * @thread_safety This function must only be called from the main thread. |
| 2386 | * |
| 2387 | * @sa @ref window_focus |
| 2388 | * |
| 2389 | * @since Added in version 3.2. |
| 2390 | * |
| 2391 | * @ingroup window |
| 2392 | */ |
| 2393 | GLFWAPI void glfwFocusWindow(GLFWwindow* window); |
| 2394 | |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 2395 | /*! @brief Returns the monitor that the window uses for full screen mode. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2396 | * |
| 2397 | * This function returns the handle of the monitor that the specified window is |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 2398 | * in full screen on. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2399 | * |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 2400 | * @param[in] window The window to query. |
Camilla Berglund | 999f355 | 2016-08-17 16:48:22 +0200 | [diff] [blame] | 2401 | * @return The monitor, or `NULL` if the window is in windowed mode or an |
| 2402 | * [error](@ref error_handling) occurred. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2403 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2404 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 2405 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2406 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2407 | * |
| 2408 | * @sa @ref window_monitor |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 2409 | * @sa glfwSetWindowMonitor |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2410 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2411 | * @since Added in version 3.0. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2412 | * |
Camilla Berglund | 5f68e12 | 2012-11-27 17:07:28 +0100 | [diff] [blame] | 2413 | * @ingroup window |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 2414 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 2415 | GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window); |
Camilla Berglund | 41bc0d1 | 2012-11-27 16:55:04 +0100 | [diff] [blame] | 2416 | |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 2417 | /*! @brief Sets the mode, monitor, video mode and placement of a window. |
| 2418 | * |
| 2419 | * This function sets the monitor that the window uses for full screen mode or, |
| 2420 | * if the monitor is `NULL`, makes it windowed mode. |
| 2421 | * |
| 2422 | * When setting a monitor, this function updates the width, height and refresh |
| 2423 | * rate of the desired video mode and switches to the video mode closest to it. |
| 2424 | * The window position is ignored when setting a monitor. |
| 2425 | * |
| 2426 | * When the monitor is `NULL`, the position, width and height are used to |
| 2427 | * place the window client area. The refresh rate is ignored when no monitor |
| 2428 | * is specified. |
| 2429 | * |
| 2430 | * If you only wish to update the resolution of a full screen window or the |
| 2431 | * size of a windowed mode window, see @ref glfwSetWindowSize. |
| 2432 | * |
| 2433 | * When a window transitions from full screen to windowed mode, this function |
| 2434 | * restores any previous window settings such as whether it is decorated, |
| 2435 | * floating, resizable, has size or aspect ratio limits, etc.. |
| 2436 | * |
| 2437 | * @param[in] window The window whose monitor, size or video mode to set. |
| 2438 | * @param[in] monitor The desired monitor, or `NULL` to set windowed mode. |
| 2439 | * @param[in] xpos The desired x-coordinate of the upper-left corner of the |
| 2440 | * client area. |
| 2441 | * @param[in] ypos The desired y-coordinate of the upper-left corner of the |
| 2442 | * client area. |
| 2443 | * @param[in] width The desired with, in screen coordinates, of the client area |
| 2444 | * or video mode. |
| 2445 | * @param[in] height The desired height, in screen coordinates, of the client |
| 2446 | * area or video mode. |
Camilla Berglund | 325729d | 2016-05-22 14:25:04 +0200 | [diff] [blame] | 2447 | * @param[in] refreshRate The desired refresh rate, in Hz, of the video mode, |
| 2448 | * or `GLFW_DONT_CARE`. |
Camilla Berglund | 6570d0c | 2016-02-23 12:26:42 +0100 | [diff] [blame] | 2449 | * |
| 2450 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2451 | * GLFW_PLATFORM_ERROR. |
| 2452 | * |
| 2453 | * @thread_safety This function must only be called from the main thread. |
| 2454 | * |
| 2455 | * @sa @ref window_monitor |
| 2456 | * @sa @ref window_full_screen |
| 2457 | * @sa glfwGetWindowMonitor |
| 2458 | * @sa glfwSetWindowSize |
| 2459 | * |
| 2460 | * @since Added in version 3.2. |
| 2461 | * |
| 2462 | * @ingroup window |
| 2463 | */ |
| 2464 | GLFWAPI void glfwSetWindowMonitor(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate); |
| 2465 | |
Camilla Berglund | ad1f6f0 | 2013-05-27 15:30:32 +0200 | [diff] [blame] | 2466 | /*! @brief Returns an attribute of the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2467 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2468 | * This function returns the value of an attribute of the specified window or |
| 2469 | * its OpenGL or OpenGL ES context. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2470 | * |
Camilla Berglund | 1e9383d | 2012-11-23 11:41:53 +0100 | [diff] [blame] | 2471 | * @param[in] window The window to query. |
Camilla Berglund | 1f5f20e | 2013-05-27 17:10:34 +0200 | [diff] [blame] | 2472 | * @param[in] attrib The [window attribute](@ref window_attribs) whose value to |
| 2473 | * return. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2474 | * @return The value of the attribute, or zero if an |
| 2475 | * [error](@ref error_handling) occurred. |
Camilla Berglund | 1e9383d | 2012-11-23 11:41:53 +0100 | [diff] [blame] | 2476 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2477 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 2478 | * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. |
| 2479 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2480 | * @remark Framebuffer related hints are not window attributes. See @ref |
Camilla Berglund | 59abeeb | 2015-04-07 14:34:12 +0200 | [diff] [blame] | 2481 | * window_attribs_fb for more information. |
| 2482 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2483 | * @remark Zero is a valid value for many window and context related |
Camilla Berglund | 59abeeb | 2015-04-07 14:34:12 +0200 | [diff] [blame] | 2484 | * attributes so you cannot use a return value of zero as an indication of |
| 2485 | * errors. However, this function should not fail as long as it is passed |
| 2486 | * valid arguments and the library has been [initialized](@ref intro_init). |
| 2487 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2488 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2489 | * |
| 2490 | * @sa @ref window_attribs |
| 2491 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2492 | * @since Added in version 3.0. Replaces `glfwGetWindowParam` and |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 2493 | * `glfwGetGLVersion`. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2494 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2495 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2496 | */ |
Camilla Berglund | ad1f6f0 | 2013-05-27 15:30:32 +0200 | [diff] [blame] | 2497 | GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2498 | |
| 2499 | /*! @brief Sets the user pointer of the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2500 | * |
| 2501 | * This function sets the user-defined pointer of the specified window. The |
| 2502 | * current value is retained until the window is destroyed. The initial value |
| 2503 | * is `NULL`. |
| 2504 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2505 | * @param[in] window The window whose pointer to set. |
| 2506 | * @param[in] pointer The new value. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2507 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2508 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 2509 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2510 | * @thread_safety This function may be called from any thread. Access is not |
| 2511 | * synchronized. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2512 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2513 | * @sa @ref window_userptr |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2514 | * @sa glfwGetWindowUserPointer |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2515 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2516 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2517 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2518 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2519 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 2520 | GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2521 | |
| 2522 | /*! @brief Returns the user pointer of the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2523 | * |
| 2524 | * This function returns the current value of the user-defined pointer of the |
| 2525 | * specified window. The initial value is `NULL`. |
| 2526 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2527 | * @param[in] window The window whose pointer to return. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2528 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2529 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 2530 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2531 | * @thread_safety This function may be called from any thread. Access is not |
| 2532 | * synchronized. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2533 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2534 | * @sa @ref window_userptr |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2535 | * @sa glfwSetWindowUserPointer |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2536 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2537 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2538 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2539 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2540 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 2541 | GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2542 | |
Camilla Berglund | 1a3d47d | 2012-11-30 13:56:42 +0100 | [diff] [blame] | 2543 | /*! @brief Sets the position callback for the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2544 | * |
| 2545 | * This function sets the position callback of the specified window, which is |
| 2546 | * called when the window is moved. The callback is provided with the screen |
| 2547 | * position of the upper-left corner of the client area of the window. |
| 2548 | * |
Camilla Berglund | 1a3d47d | 2012-11-30 13:56:42 +0100 | [diff] [blame] | 2549 | * @param[in] window The window whose callback to set. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 2550 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
Camilla Berglund | 1a3d47d | 2012-11-30 13:56:42 +0100 | [diff] [blame] | 2551 | * callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 2552 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 2553 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 2554 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2555 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 2556 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2557 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2558 | * |
| 2559 | * @sa @ref window_pos |
| 2560 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2561 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2562 | * |
Camilla Berglund | 1a3d47d | 2012-11-30 13:56:42 +0100 | [diff] [blame] | 2563 | * @ingroup window |
| 2564 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 2565 | GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun); |
Camilla Berglund | 1a3d47d | 2012-11-30 13:56:42 +0100 | [diff] [blame] | 2566 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2567 | /*! @brief Sets the size callback for the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2568 | * |
| 2569 | * This function sets the size callback of the specified window, which is |
| 2570 | * called when the window is resized. The callback is provided with the size, |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 2571 | * in screen coordinates, of the client area of the window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2572 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2573 | * @param[in] window The window whose callback to set. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 2574 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2575 | * callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 2576 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 2577 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 2578 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2579 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 2580 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2581 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2582 | * |
| 2583 | * @sa @ref window_size |
| 2584 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2585 | * @since Added in version 1.0. |
| 2586 | * @glfw3 Added window handle parameter and return value. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2587 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2588 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2589 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 2590 | GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2591 | |
| 2592 | /*! @brief Sets the close callback for the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2593 | * |
| 2594 | * This function sets the close callback of the specified window, which is |
| 2595 | * called when the user attempts to close the window, for example by clicking |
| 2596 | * the close widget in the title bar. |
| 2597 | * |
| 2598 | * The close flag is set before this callback is called, but you can modify it |
| 2599 | * at any time with @ref glfwSetWindowShouldClose. |
| 2600 | * |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 2601 | * The close callback is not triggered by @ref glfwDestroyWindow. |
| 2602 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2603 | * @param[in] window The window whose callback to set. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 2604 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2605 | * callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 2606 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 2607 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 2608 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2609 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 2610 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2611 | * @remark @osx Selecting Quit from the application menu will trigger the close |
| 2612 | * callback for all windows. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2613 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2614 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2615 | * |
| 2616 | * @sa @ref window_close |
| 2617 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2618 | * @since Added in version 2.5. |
| 2619 | * @glfw3 Added window handle parameter and return value. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2620 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2621 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2622 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 2623 | GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2624 | |
| 2625 | /*! @brief Sets the refresh callback for the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2626 | * |
| 2627 | * This function sets the refresh callback of the specified window, which is |
| 2628 | * called when the client area of the window needs to be redrawn, for example |
| 2629 | * if the window has been exposed after having been covered by another window. |
| 2630 | * |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 2631 | * On compositing window systems such as Aero, Compiz or Aqua, where the window |
| 2632 | * contents are saved off-screen, this callback may be called only very |
| 2633 | * infrequently or never at all. |
| 2634 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2635 | * @param[in] window The window whose callback to set. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 2636 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2637 | * callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 2638 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 2639 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 2640 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2641 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 2642 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2643 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2644 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2645 | * @sa @ref window_refresh |
| 2646 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2647 | * @since Added in version 2.5. |
| 2648 | * @glfw3 Added window handle parameter and return value. |
Camilla Berglund | a3ff29a | 2012-12-02 15:47:10 +0100 | [diff] [blame] | 2649 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2650 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2651 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 2652 | GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2653 | |
| 2654 | /*! @brief Sets the focus callback for the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2655 | * |
| 2656 | * This function sets the focus callback of the specified window, which is |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 2657 | * called when the window gains or loses input focus. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2658 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 2659 | * After the focus callback is called for a window that lost input focus, |
| 2660 | * synthetic key and mouse button release events will be generated for all such |
| 2661 | * that had been pressed. For more information, see @ref glfwSetKeyCallback |
| 2662 | * and @ref glfwSetMouseButtonCallback. |
Camilla Berglund | 4538a52 | 2013-04-24 19:49:46 +0200 | [diff] [blame] | 2663 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2664 | * @param[in] window The window whose callback to set. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 2665 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2666 | * callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 2667 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 2668 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 2669 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2670 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 2671 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2672 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2673 | * |
| 2674 | * @sa @ref window_focus |
| 2675 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2676 | * @since Added in version 3.0. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2677 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2678 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2679 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 2680 | GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2681 | |
| 2682 | /*! @brief Sets the iconify callback for the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2683 | * |
| 2684 | * This function sets the iconification callback of the specified window, which |
| 2685 | * is called when the window is iconified or restored. |
| 2686 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2687 | * @param[in] window The window whose callback to set. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 2688 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2689 | * callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 2690 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 2691 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 2692 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2693 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 2694 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2695 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2696 | * |
| 2697 | * @sa @ref window_iconify |
| 2698 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2699 | * @since Added in version 3.0. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2700 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2701 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2702 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 2703 | GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun); |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 2704 | |
Camilla Berglund | 3498163 | 2013-06-03 12:51:57 +0200 | [diff] [blame] | 2705 | /*! @brief Sets the framebuffer resize callback for the specified window. |
| 2706 | * |
| 2707 | * This function sets the framebuffer resize callback of the specified window, |
| 2708 | * which is called when the framebuffer of the specified window is resized. |
| 2709 | * |
| 2710 | * @param[in] window The window whose callback to set. |
| 2711 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
| 2712 | * callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 2713 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 2714 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 3498163 | 2013-06-03 12:51:57 +0200 | [diff] [blame] | 2715 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2716 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 2717 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2718 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2719 | * |
| 2720 | * @sa @ref window_fbsize |
| 2721 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2722 | * @since Added in version 3.0. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2723 | * |
Camilla Berglund | 3498163 | 2013-06-03 12:51:57 +0200 | [diff] [blame] | 2724 | * @ingroup window |
| 2725 | */ |
| 2726 | GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun); |
| 2727 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2728 | /*! @brief Processes all pending events. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2729 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2730 | * This function processes only those events that are already in the event |
| 2731 | * queue and then returns immediately. Processing events will cause the window |
| 2732 | * and input callbacks associated with those events to be called. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2733 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2734 | * On some platforms, a window move, resize or menu operation will cause event |
| 2735 | * processing to block. This is due to how event processing is designed on |
| 2736 | * those platforms. You can use the |
| 2737 | * [window refresh callback](@ref window_refresh) to redraw the contents of |
| 2738 | * your window when necessary during such operations. |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 2739 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2740 | * On some platforms, certain events are sent directly to the application |
| 2741 | * without going through the event queue, causing callbacks to be called |
| 2742 | * outside of a call to one of the event processing functions. |
Camilla Berglund | 401033c | 2013-03-12 19:17:07 +0100 | [diff] [blame] | 2743 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2744 | * Event processing is not required for joystick input to work. |
Camilla Berglund | 9ad1d97 | 2012-11-22 19:08:30 +0100 | [diff] [blame] | 2745 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2746 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2747 | * GLFW_PLATFORM_ERROR. |
| 2748 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2749 | * @reentrancy This function must not be called from a callback. |
Camilla Berglund | b48128f | 2013-02-14 18:49:03 +0100 | [diff] [blame] | 2750 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2751 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 948cc04 | 2013-04-16 02:02:22 +0200 | [diff] [blame] | 2752 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 2753 | * @sa @ref events |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2754 | * @sa glfwWaitEvents |
Camilla Berglund | 5620895 | 2016-02-02 21:11:16 +0100 | [diff] [blame] | 2755 | * @sa glfwWaitEventsTimeout |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2756 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2757 | * @since Added in version 1.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2758 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2759 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2760 | */ |
Camilla Berglund | 9a71669 | 2010-09-08 16:40:43 +0200 | [diff] [blame] | 2761 | GLFWAPI void glfwPollEvents(void); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2762 | |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2763 | /*! @brief Waits until events are queued and processes them. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2764 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2765 | * This function puts the calling thread to sleep until at least one event is |
| 2766 | * available in the event queue. Once one or more events are available, |
| 2767 | * it behaves exactly like @ref glfwPollEvents, i.e. the events in the queue |
| 2768 | * are processed and the function then returns immediately. Processing events |
| 2769 | * will cause the window and input callbacks associated with those events to be |
| 2770 | * called. |
Camilla Berglund | 948cc04 | 2013-04-16 02:02:22 +0200 | [diff] [blame] | 2771 | * |
| 2772 | * Since not all events are associated with callbacks, this function may return |
| 2773 | * without a callback having been called even if you are monitoring all |
| 2774 | * callbacks. |
| 2775 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2776 | * On some platforms, a window move, resize or menu operation will cause event |
| 2777 | * processing to block. This is due to how event processing is designed on |
| 2778 | * those platforms. You can use the |
| 2779 | * [window refresh callback](@ref window_refresh) to redraw the contents of |
| 2780 | * your window when necessary during such operations. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2781 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 2782 | * On some platforms, certain callbacks may be called outside of a call to one |
| 2783 | * of the event processing functions. |
| 2784 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2785 | * If no windows exist, this function returns immediately. For synchronization |
| 2786 | * of threads in applications that do not create windows, use your threading |
| 2787 | * library of choice. |
Camilla Berglund | 2ae46fa | 2013-12-04 19:12:24 +0100 | [diff] [blame] | 2788 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2789 | * Event processing is not required for joystick input to work. |
Camilla Berglund | 9ad1d97 | 2012-11-22 19:08:30 +0100 | [diff] [blame] | 2790 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2791 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2792 | * GLFW_PLATFORM_ERROR. |
| 2793 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2794 | * @reentrancy This function must not be called from a callback. |
Camilla Berglund | 44372b8 | 2014-12-17 01:31:36 +0100 | [diff] [blame] | 2795 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2796 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2797 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 2798 | * @sa @ref events |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2799 | * @sa glfwPollEvents |
Camilla Berglund | 5620895 | 2016-02-02 21:11:16 +0100 | [diff] [blame] | 2800 | * @sa glfwWaitEventsTimeout |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2801 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2802 | * @since Added in version 2.5. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2803 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2804 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2805 | */ |
Camilla Berglund | 9a71669 | 2010-09-08 16:40:43 +0200 | [diff] [blame] | 2806 | GLFWAPI void glfwWaitEvents(void); |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 2807 | |
Camilla Berglund | 5620895 | 2016-02-02 21:11:16 +0100 | [diff] [blame] | 2808 | /*! @brief Waits with timeout until events are queued and processes them. |
| 2809 | * |
| 2810 | * This function puts the calling thread to sleep until at least one event is |
| 2811 | * available in the event queue, or until the specified timeout is reached. If |
| 2812 | * one or more events are available, it behaves exactly like @ref |
| 2813 | * glfwPollEvents, i.e. the events in the queue are processed and the function |
| 2814 | * then returns immediately. Processing events will cause the window and input |
| 2815 | * callbacks associated with those events to be called. |
| 2816 | * |
| 2817 | * The timeout value must be a positive finite number. |
| 2818 | * |
| 2819 | * Since not all events are associated with callbacks, this function may return |
| 2820 | * without a callback having been called even if you are monitoring all |
| 2821 | * callbacks. |
| 2822 | * |
| 2823 | * On some platforms, a window move, resize or menu operation will cause event |
| 2824 | * processing to block. This is due to how event processing is designed on |
| 2825 | * those platforms. You can use the |
| 2826 | * [window refresh callback](@ref window_refresh) to redraw the contents of |
| 2827 | * your window when necessary during such operations. |
| 2828 | * |
| 2829 | * On some platforms, certain callbacks may be called outside of a call to one |
| 2830 | * of the event processing functions. |
| 2831 | * |
| 2832 | * If no windows exist, this function returns immediately. For synchronization |
| 2833 | * of threads in applications that do not create windows, use your threading |
| 2834 | * library of choice. |
| 2835 | * |
| 2836 | * Event processing is not required for joystick input to work. |
| 2837 | * |
| 2838 | * @param[in] timeout The maximum amount of time, in seconds, to wait. |
| 2839 | * |
| 2840 | * @reentrancy This function must not be called from a callback. |
| 2841 | * |
| 2842 | * @thread_safety This function must only be called from the main thread. |
| 2843 | * |
| 2844 | * @sa @ref events |
| 2845 | * @sa glfwPollEvents |
| 2846 | * @sa glfwWaitEvents |
| 2847 | * |
| 2848 | * @since Added in version 3.2. |
| 2849 | * |
| 2850 | * @ingroup window |
| 2851 | */ |
| 2852 | GLFWAPI void glfwWaitEventsTimeout(double timeout); |
| 2853 | |
Camilla Berglund | 1ccc232 | 2014-02-10 18:16:58 +0100 | [diff] [blame] | 2854 | /*! @brief Posts an empty event to the event queue. |
| 2855 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2856 | * This function posts an empty event from the current thread to the event |
Camilla Berglund | 73abf8a | 2016-07-06 13:06:59 +0200 | [diff] [blame] | 2857 | * queue, causing @ref glfwWaitEvents or @ref glfwWaitEventsTimeout to return. |
Camilla Berglund | 1ccc232 | 2014-02-10 18:16:58 +0100 | [diff] [blame] | 2858 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2859 | * If no windows exist, this function returns immediately. For synchronization |
| 2860 | * of threads in applications that do not create windows, use your threading |
| 2861 | * library of choice. |
Camilla Berglund | 1ccc232 | 2014-02-10 18:16:58 +0100 | [diff] [blame] | 2862 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2863 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2864 | * GLFW_PLATFORM_ERROR. |
| 2865 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2866 | * @thread_safety This function may be called from any thread. |
Camilla Berglund | 1ccc232 | 2014-02-10 18:16:58 +0100 | [diff] [blame] | 2867 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 2868 | * @sa @ref events |
Camilla Berglund | 1ccc232 | 2014-02-10 18:16:58 +0100 | [diff] [blame] | 2869 | * @sa glfwWaitEvents |
Camilla Berglund | 73abf8a | 2016-07-06 13:06:59 +0200 | [diff] [blame] | 2870 | * @sa glfwWaitEventsTimeout |
Camilla Berglund | 1ccc232 | 2014-02-10 18:16:58 +0100 | [diff] [blame] | 2871 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2872 | * @since Added in version 3.1. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2873 | * |
Camilla Berglund | 1ccc232 | 2014-02-10 18:16:58 +0100 | [diff] [blame] | 2874 | * @ingroup window |
| 2875 | */ |
| 2876 | GLFWAPI void glfwPostEmptyEvent(void); |
| 2877 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2878 | /*! @brief Returns the value of an input option for the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2879 | * |
Camilla Berglund | 95654cf | 2014-10-02 17:35:10 +0200 | [diff] [blame] | 2880 | * This function returns the value of an input option for the specified window. |
| 2881 | * The mode must be one of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or |
| 2882 | * `GLFW_STICKY_MOUSE_BUTTONS`. |
| 2883 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2884 | * @param[in] window The window to query. |
Camilla Berglund | 9264b5d | 2013-04-26 14:29:55 +0200 | [diff] [blame] | 2885 | * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or |
Camilla Berglund | 39fe1f1 | 2013-03-12 19:39:36 +0100 | [diff] [blame] | 2886 | * `GLFW_STICKY_MOUSE_BUTTONS`. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2887 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2888 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2889 | * GLFW_INVALID_ENUM. |
| 2890 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2891 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2892 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2893 | * @sa glfwSetInputMode |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2894 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2895 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2896 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 2897 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2898 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 2899 | GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2900 | |
| 2901 | /*! @brief Sets an input option for the specified window. |
Camilla Berglund | 95654cf | 2014-10-02 17:35:10 +0200 | [diff] [blame] | 2902 | * |
| 2903 | * This function sets an input mode option for the specified window. The mode |
| 2904 | * must be one of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 2905 | * `GLFW_STICKY_MOUSE_BUTTONS`. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2906 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2907 | * If the mode is `GLFW_CURSOR`, the value must be one of the following cursor |
Camilla Berglund | 39fe1f1 | 2013-03-12 19:39:36 +0100 | [diff] [blame] | 2908 | * modes: |
Camilla Berglund | 13ccf7d | 2013-04-07 13:46:38 +0200 | [diff] [blame] | 2909 | * - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally. |
| 2910 | * - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 2911 | * area of the window but does not restrict the cursor from leaving. |
Camilla Berglund | a18b187 | 2013-12-05 03:27:12 +0100 | [diff] [blame] | 2912 | * - `GLFW_CURSOR_DISABLED` hides and grabs the cursor, providing virtual |
| 2913 | * and unlimited cursor movement. This is useful for implementing for |
| 2914 | * example 3D camera controls. |
Camilla Berglund | 39fe1f1 | 2013-03-12 19:39:36 +0100 | [diff] [blame] | 2915 | * |
Camilla Berglund | 0eccf75 | 2015-08-23 19:30:04 +0200 | [diff] [blame] | 2916 | * If the mode is `GLFW_STICKY_KEYS`, the value must be either `GLFW_TRUE` to |
| 2917 | * enable sticky keys, or `GLFW_FALSE` to disable it. If sticky keys are |
Camilla Berglund | 95654cf | 2014-10-02 17:35:10 +0200 | [diff] [blame] | 2918 | * enabled, a key press will ensure that @ref glfwGetKey returns `GLFW_PRESS` |
| 2919 | * the next time it is called even if the key had been released before the |
| 2920 | * call. This is useful when you are only interested in whether keys have been |
| 2921 | * pressed but not when or in which order. |
Camilla Berglund | 39fe1f1 | 2013-03-12 19:39:36 +0100 | [diff] [blame] | 2922 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2923 | * If the mode is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either |
Camilla Berglund | 0eccf75 | 2015-08-23 19:30:04 +0200 | [diff] [blame] | 2924 | * `GLFW_TRUE` to enable sticky mouse buttons, or `GLFW_FALSE` to disable it. |
| 2925 | * If sticky mouse buttons are enabled, a mouse button press will ensure that |
| 2926 | * @ref glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even |
| 2927 | * if the mouse button had been released before the call. This is useful when |
| 2928 | * you are only interested in whether mouse buttons have been pressed but not |
| 2929 | * when or in which order. |
Camilla Berglund | 95654cf | 2014-10-02 17:35:10 +0200 | [diff] [blame] | 2930 | * |
| 2931 | * @param[in] window The window whose input mode to set. |
| 2932 | * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or |
| 2933 | * `GLFW_STICKY_MOUSE_BUTTONS`. |
| 2934 | * @param[in] value The new value of the specified input mode. |
Camilla Berglund | 39fe1f1 | 2013-03-12 19:39:36 +0100 | [diff] [blame] | 2935 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2936 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 2937 | * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. |
| 2938 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2939 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 2940 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2941 | * @sa glfwGetInputMode |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 2942 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 2943 | * @since Added in version 3.0. Replaces `glfwEnable` and `glfwDisable`. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 2944 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 2945 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2946 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 2947 | GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 2948 | |
Camilla Berglund | 9c31541 | 2015-07-02 14:24:50 +0200 | [diff] [blame] | 2949 | /*! @brief Returns the localized name of the specified printable key. |
| 2950 | * |
| 2951 | * This function returns the localized name of the specified printable key. |
Camilla Berglund | 70ffae7 | 2016-02-22 11:54:56 +0100 | [diff] [blame] | 2952 | * This is intended for displaying key bindings to the user. |
Camilla Berglund | 9c31541 | 2015-07-02 14:24:50 +0200 | [diff] [blame] | 2953 | * |
Camilla Berglund | 70ffae7 | 2016-02-22 11:54:56 +0100 | [diff] [blame] | 2954 | * If the key is `GLFW_KEY_UNKNOWN`, the scancode is used instead, otherwise |
| 2955 | * the scancode is ignored. If a non-printable key or (if the key is |
| 2956 | * `GLFW_KEY_UNKNOWN`) a scancode that maps to a non-printable key is |
| 2957 | * specified, this function returns `NULL`. |
| 2958 | * |
| 2959 | * This behavior allows you to pass in the arguments passed to the |
| 2960 | * [key callback](@ref input_key) without modification. |
| 2961 | * |
| 2962 | * The printable keys are: |
| 2963 | * - `GLFW_KEY_APOSTROPHE` |
| 2964 | * - `GLFW_KEY_COMMA` |
| 2965 | * - `GLFW_KEY_MINUS` |
| 2966 | * - `GLFW_KEY_PERIOD` |
| 2967 | * - `GLFW_KEY_SLASH` |
| 2968 | * - `GLFW_KEY_SEMICOLON` |
| 2969 | * - `GLFW_KEY_EQUAL` |
| 2970 | * - `GLFW_KEY_LEFT_BRACKET` |
| 2971 | * - `GLFW_KEY_RIGHT_BRACKET` |
| 2972 | * - `GLFW_KEY_BACKSLASH` |
| 2973 | * - `GLFW_KEY_WORLD_1` |
| 2974 | * - `GLFW_KEY_WORLD_2` |
| 2975 | * - `GLFW_KEY_0` to `GLFW_KEY_9` |
| 2976 | * - `GLFW_KEY_A` to `GLFW_KEY_Z` |
| 2977 | * - `GLFW_KEY_KP_0` to `GLFW_KEY_KP_9` |
| 2978 | * - `GLFW_KEY_KP_DECIMAL` |
| 2979 | * - `GLFW_KEY_KP_DIVIDE` |
| 2980 | * - `GLFW_KEY_KP_MULTIPLY` |
| 2981 | * - `GLFW_KEY_KP_SUBTRACT` |
| 2982 | * - `GLFW_KEY_KP_ADD` |
| 2983 | * - `GLFW_KEY_KP_EQUAL` |
Camilla Berglund | 9c31541 | 2015-07-02 14:24:50 +0200 | [diff] [blame] | 2984 | * |
| 2985 | * @param[in] key The key to query, or `GLFW_KEY_UNKNOWN`. |
| 2986 | * @param[in] scancode The scancode of the key to query. |
Camilla Berglund | 70ffae7 | 2016-02-22 11:54:56 +0100 | [diff] [blame] | 2987 | * @return The localized name of the key, or `NULL`. |
Camilla Berglund | 9c31541 | 2015-07-02 14:24:50 +0200 | [diff] [blame] | 2988 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 2989 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 2990 | * GLFW_PLATFORM_ERROR. |
| 2991 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2992 | * @pointer_lifetime The returned string is allocated and freed by GLFW. You |
| 2993 | * should not free it yourself. It is valid until the next call to @ref |
| 2994 | * glfwGetKeyName, or until the library is terminated. |
Camilla Berglund | 9c31541 | 2015-07-02 14:24:50 +0200 | [diff] [blame] | 2995 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 2996 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 9c31541 | 2015-07-02 14:24:50 +0200 | [diff] [blame] | 2997 | * |
| 2998 | * @sa @ref input_key_name |
| 2999 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3000 | * @since Added in version 3.2. |
Camilla Berglund | 9c31541 | 2015-07-02 14:24:50 +0200 | [diff] [blame] | 3001 | * |
| 3002 | * @ingroup input |
| 3003 | */ |
| 3004 | GLFWAPI const char* glfwGetKeyName(int key, int scancode); |
| 3005 | |
Michael Stocker | e745b0d | 2016-08-11 19:11:40 +0200 | [diff] [blame^] | 3006 | /*! @brief Returns the platform dependent scancode of the specified key. |
| 3007 | * |
| 3008 | * This function returns the platform dependent scancode of the specified key. |
| 3009 | * This is intended for platform specific default keybindings. |
| 3010 | * |
| 3011 | * If the key is `GLFW_KEY_UNKNOWN` or does not exist on the keyboard this |
| 3012 | * method will return `-1`. |
| 3013 | * |
| 3014 | * @param[in] key The key to query. |
| 3015 | * @return The platform dependent scancode for the key, or `-1`. |
| 3016 | * |
| 3017 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 3018 | * GLFW_PLATFORM_ERROR. |
| 3019 | * |
| 3020 | * @thread_safety This function may be called from any thread. |
| 3021 | * |
| 3022 | * @sa @ref input_key_scancode |
| 3023 | * |
| 3024 | * @since Added in version 3.3. |
| 3025 | * |
| 3026 | * @ingroup input |
| 3027 | */ |
| 3028 | GLFWAPI const short int glfwGetKeyScancode(int key); |
| 3029 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3030 | /*! @brief Returns the last reported state of a keyboard key for the specified |
| 3031 | * window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3032 | * |
| 3033 | * This function returns the last state reported for the specified key to the |
| 3034 | * specified window. The returned state is one of `GLFW_PRESS` or |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3035 | * `GLFW_RELEASE`. The higher-level action `GLFW_REPEAT` is only reported to |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3036 | * the key callback. |
| 3037 | * |
| 3038 | * If the `GLFW_STICKY_KEYS` input mode is enabled, this function returns |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3039 | * `GLFW_PRESS` the first time you call it for a key that was pressed, even if |
| 3040 | * that key has already been released. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3041 | * |
| 3042 | * The key functions deal with physical keys, with [key tokens](@ref keys) |
| 3043 | * named after their use on the standard US keyboard layout. If you want to |
| 3044 | * input text, use the Unicode character callback instead. |
| 3045 | * |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 3046 | * The [modifier key bit masks](@ref mods) are not key tokens and cannot be |
| 3047 | * used with this function. |
| 3048 | * |
Camilla Berglund | 9c31541 | 2015-07-02 14:24:50 +0200 | [diff] [blame] | 3049 | * __Do not use this function__ to implement [text input](@ref input_char). |
| 3050 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3051 | * @param[in] window The desired window. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3052 | * @param[in] key The desired [keyboard key](@ref keys). `GLFW_KEY_UNKNOWN` is |
| 3053 | * not a valid key for this function. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 3054 | * @return One of `GLFW_PRESS` or `GLFW_RELEASE`. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3055 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3056 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 3057 | * GLFW_INVALID_ENUM. |
| 3058 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3059 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3060 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3061 | * @sa @ref input_key |
| 3062 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3063 | * @since Added in version 1.0. |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3064 | * @glfw3 Added window handle parameter. |
Camilla Berglund | 11615fc | 2013-05-30 17:19:12 +0200 | [diff] [blame] | 3065 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3066 | * @ingroup input |
| 3067 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 3068 | GLFWAPI int glfwGetKey(GLFWwindow* window, int key); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3069 | |
| 3070 | /*! @brief Returns the last reported state of a mouse button for the specified |
| 3071 | * window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3072 | * |
| 3073 | * This function returns the last state reported for the specified mouse button |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3074 | * to the specified window. The returned state is one of `GLFW_PRESS` or |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 3075 | * `GLFW_RELEASE`. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3076 | * |
| 3077 | * If the `GLFW_STICKY_MOUSE_BUTTONS` input mode is enabled, this function |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3078 | * `GLFW_PRESS` the first time you call it for a mouse button that was pressed, |
| 3079 | * even if that mouse button has already been released. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3080 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3081 | * @param[in] window The desired window. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 3082 | * @param[in] button The desired [mouse button](@ref buttons). |
| 3083 | * @return One of `GLFW_PRESS` or `GLFW_RELEASE`. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3084 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3085 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 3086 | * GLFW_INVALID_ENUM. |
| 3087 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3088 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3089 | * |
| 3090 | * @sa @ref input_mouse_button |
| 3091 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3092 | * @since Added in version 1.0. |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3093 | * @glfw3 Added window handle parameter. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3094 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3095 | * @ingroup input |
| 3096 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 3097 | GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3098 | |
Camilla Berglund | d459145 | 2014-02-11 18:24:01 +0100 | [diff] [blame] | 3099 | /*! @brief Retrieves the position of the cursor relative to the client area of |
| 3100 | * the window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3101 | * |
Camilla Berglund | d459145 | 2014-02-11 18:24:01 +0100 | [diff] [blame] | 3102 | * This function returns the position of the cursor, in screen coordinates, |
| 3103 | * relative to the upper-left corner of the client area of the specified |
| 3104 | * window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3105 | * |
Camilla Berglund | 6df692b | 2013-04-26 17:20:31 +0200 | [diff] [blame] | 3106 | * If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor |
| 3107 | * position is unbounded and limited only by the minimum and maximum values of |
| 3108 | * a `double`. |
Camilla Berglund | 948cc04 | 2013-04-16 02:02:22 +0200 | [diff] [blame] | 3109 | * |
Camilla Berglund | 3ec2925 | 2013-04-25 18:03:15 +0200 | [diff] [blame] | 3110 | * The coordinate can be converted to their integer equivalents with the |
| 3111 | * `floor` function. Casting directly to an integer type works for positive |
| 3112 | * coordinates, but fails for negative ones. |
| 3113 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3114 | * Any or all of the position arguments may be `NULL`. If an error occurs, all |
| 3115 | * non-`NULL` position arguments will be set to zero. |
| 3116 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3117 | * @param[in] window The desired window. |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 3118 | * @param[out] xpos Where to store the cursor x-coordinate, relative to the |
| 3119 | * left edge of the client area, or `NULL`. |
| 3120 | * @param[out] ypos Where to store the cursor y-coordinate, relative to the to |
| 3121 | * top edge of the client area, or `NULL`. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3122 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3123 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 3124 | * GLFW_PLATFORM_ERROR. |
| 3125 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3126 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3127 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3128 | * @sa @ref cursor_pos |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3129 | * @sa glfwSetCursorPos |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3130 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3131 | * @since Added in version 3.0. Replaces `glfwGetMousePos`. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3132 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3133 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3134 | */ |
Camilla Berglund | 129e94d | 2013-04-04 16:16:21 +0200 | [diff] [blame] | 3135 | GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3136 | |
Camilla Berglund | 6d9d856 | 2013-09-28 22:12:50 +0200 | [diff] [blame] | 3137 | /*! @brief Sets the position of the cursor, relative to the client area of the |
| 3138 | * window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3139 | * |
Camilla Berglund | 6d9d856 | 2013-09-28 22:12:50 +0200 | [diff] [blame] | 3140 | * This function sets the position, in screen coordinates, of the cursor |
| 3141 | * relative to the upper-left corner of the client area of the specified |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3142 | * window. The window must have input focus. If the window does not have |
| 3143 | * input focus when this function is called, it fails silently. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3144 | * |
Camilla Berglund | 2085876 | 2015-01-01 18:41:22 +0100 | [diff] [blame] | 3145 | * __Do not use this function__ to implement things like camera controls. GLFW |
| 3146 | * already provides the `GLFW_CURSOR_DISABLED` cursor mode that hides the |
| 3147 | * cursor, transparently re-centers it and provides unconstrained cursor |
| 3148 | * motion. See @ref glfwSetInputMode for more information. |
| 3149 | * |
| 3150 | * If the cursor mode is `GLFW_CURSOR_DISABLED` then the cursor position is |
| 3151 | * unconstrained and limited only by the minimum and maximum values of |
Camilla Berglund | 6df692b | 2013-04-26 17:20:31 +0200 | [diff] [blame] | 3152 | * a `double`. |
Camilla Berglund | 948cc04 | 2013-04-16 02:02:22 +0200 | [diff] [blame] | 3153 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3154 | * @param[in] window The desired window. |
| 3155 | * @param[in] xpos The desired x-coordinate, relative to the left edge of the |
Camilla Berglund | bb55816 | 2013-09-09 23:31:59 +0200 | [diff] [blame] | 3156 | * client area. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3157 | * @param[in] ypos The desired y-coordinate, relative to the top edge of the |
Camilla Berglund | bb55816 | 2013-09-09 23:31:59 +0200 | [diff] [blame] | 3158 | * client area. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3159 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3160 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 3161 | * GLFW_PLATFORM_ERROR. |
| 3162 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3163 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3164 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3165 | * @sa @ref cursor_pos |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3166 | * @sa glfwGetCursorPos |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3167 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3168 | * @since Added in version 3.0. Replaces `glfwSetMousePos`. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3169 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3170 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3171 | */ |
Camilla Berglund | 129e94d | 2013-04-04 16:16:21 +0200 | [diff] [blame] | 3172 | GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3173 | |
Camilla Berglund | 2a1375e | 2014-09-02 16:52:16 +0200 | [diff] [blame] | 3174 | /*! @brief Creates a custom cursor. |
urraka | 40c04a7 | 2013-12-04 10:19:22 -0300 | [diff] [blame] | 3175 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3176 | * Creates a new custom cursor image that can be set for a window with @ref |
| 3177 | * glfwSetCursor. The cursor can be destroyed with @ref glfwDestroyCursor. |
| 3178 | * Any remaining cursors are destroyed by @ref glfwTerminate. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 3179 | * |
Camilla Berglund | 85a01bf | 2015-08-17 21:04:19 +0200 | [diff] [blame] | 3180 | * The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight |
| 3181 | * bits per channel. They are arranged canonically as packed sequential rows, |
| 3182 | * starting from the top-left corner. |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3183 | * |
| 3184 | * The cursor hotspot is specified in pixels, relative to the upper-left corner |
| 3185 | * of the cursor image. Like all other coordinate systems in GLFW, the X-axis |
| 3186 | * points to the right and the Y-axis points down. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 3187 | * |
Camilla Berglund | 8fa9cc0 | 2014-02-23 16:43:17 +0100 | [diff] [blame] | 3188 | * @param[in] image The desired cursor image. |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3189 | * @param[in] xhot The desired x-coordinate, in pixels, of the cursor hotspot. |
| 3190 | * @param[in] yhot The desired y-coordinate, in pixels, of the cursor hotspot. |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3191 | * @return The handle of the created cursor, or `NULL` if an |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3192 | * [error](@ref error_handling) occurred. |
urraka | 40c04a7 | 2013-12-04 10:19:22 -0300 | [diff] [blame] | 3193 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3194 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 3195 | * GLFW_PLATFORM_ERROR. |
| 3196 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3197 | * @pointer_lifetime The specified image data is copied before this function |
| 3198 | * returns. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3199 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3200 | * @reentrancy This function must not be called from a callback. |
Camilla Berglund | 44372b8 | 2014-12-17 01:31:36 +0100 | [diff] [blame] | 3201 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3202 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3203 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3204 | * @sa @ref cursor_object |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3205 | * @sa glfwDestroyCursor |
Camilla Berglund | 2a1375e | 2014-09-02 16:52:16 +0200 | [diff] [blame] | 3206 | * @sa glfwCreateStandardCursor |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3207 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3208 | * @since Added in version 3.1. |
urraka | 40c04a7 | 2013-12-04 10:19:22 -0300 | [diff] [blame] | 3209 | * |
| 3210 | * @ingroup input |
| 3211 | */ |
Camilla Berglund | 8fa9cc0 | 2014-02-23 16:43:17 +0100 | [diff] [blame] | 3212 | GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot); |
urraka | 40c04a7 | 2013-12-04 10:19:22 -0300 | [diff] [blame] | 3213 | |
Camilla Berglund | 2a1375e | 2014-09-02 16:52:16 +0200 | [diff] [blame] | 3214 | /*! @brief Creates a cursor with a standard shape. |
| 3215 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3216 | * Returns a cursor with a [standard shape](@ref shapes), that can be set for |
| 3217 | * a window with @ref glfwSetCursor. |
Camilla Berglund | 2a1375e | 2014-09-02 16:52:16 +0200 | [diff] [blame] | 3218 | * |
| 3219 | * @param[in] shape One of the [standard shapes](@ref shapes). |
Camilla Berglund | 2a1375e | 2014-09-02 16:52:16 +0200 | [diff] [blame] | 3220 | * @return A new cursor ready to use or `NULL` if an |
| 3221 | * [error](@ref error_handling) occurred. |
| 3222 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3223 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 3224 | * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. |
| 3225 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3226 | * @reentrancy This function must not be called from a callback. |
Camilla Berglund | 2a1375e | 2014-09-02 16:52:16 +0200 | [diff] [blame] | 3227 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3228 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 2a1375e | 2014-09-02 16:52:16 +0200 | [diff] [blame] | 3229 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3230 | * @sa @ref cursor_object |
Camilla Berglund | 2a1375e | 2014-09-02 16:52:16 +0200 | [diff] [blame] | 3231 | * @sa glfwCreateCursor |
| 3232 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3233 | * @since Added in version 3.1. |
Camilla Berglund | 2a1375e | 2014-09-02 16:52:16 +0200 | [diff] [blame] | 3234 | * |
| 3235 | * @ingroup input |
| 3236 | */ |
| 3237 | GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape); |
| 3238 | |
urraka | 40c04a7 | 2013-12-04 10:19:22 -0300 | [diff] [blame] | 3239 | /*! @brief Destroys a cursor. |
| 3240 | * |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 3241 | * This function destroys a cursor previously created with @ref |
| 3242 | * glfwCreateCursor. Any remaining cursors will be destroyed by @ref |
| 3243 | * glfwTerminate. |
urraka | 40c04a7 | 2013-12-04 10:19:22 -0300 | [diff] [blame] | 3244 | * |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 3245 | * @param[in] cursor The cursor object to destroy. |
urraka | 40c04a7 | 2013-12-04 10:19:22 -0300 | [diff] [blame] | 3246 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3247 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 3248 | * GLFW_PLATFORM_ERROR. |
| 3249 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3250 | * @reentrancy This function must not be called from a callback. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3251 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3252 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3253 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3254 | * @sa @ref cursor_object |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3255 | * @sa glfwCreateCursor |
| 3256 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3257 | * @since Added in version 3.1. |
urraka | 40c04a7 | 2013-12-04 10:19:22 -0300 | [diff] [blame] | 3258 | * |
| 3259 | * @ingroup input |
| 3260 | */ |
| 3261 | GLFWAPI void glfwDestroyCursor(GLFWcursor* cursor); |
| 3262 | |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3263 | /*! @brief Sets the cursor for the window. |
urraka | 40c04a7 | 2013-12-04 10:19:22 -0300 | [diff] [blame] | 3264 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3265 | * This function sets the cursor image to be used when the cursor is over the |
| 3266 | * client area of the specified window. The set cursor will only be visible |
| 3267 | * when the [cursor mode](@ref cursor_mode) of the window is |
| 3268 | * `GLFW_CURSOR_NORMAL`. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3269 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3270 | * On some platforms, the set cursor may not be visible unless the window also |
| 3271 | * has input focus. |
| 3272 | * |
| 3273 | * @param[in] window The window to set the cursor for. |
| 3274 | * @param[in] cursor The cursor to set, or `NULL` to switch back to the default |
| 3275 | * arrow cursor. |
urraka | 40c04a7 | 2013-12-04 10:19:22 -0300 | [diff] [blame] | 3276 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3277 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 3278 | * GLFW_PLATFORM_ERROR. |
| 3279 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3280 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3281 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3282 | * @sa @ref cursor_object |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3283 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3284 | * @since Added in version 3.1. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3285 | * |
urraka | 40c04a7 | 2013-12-04 10:19:22 -0300 | [diff] [blame] | 3286 | * @ingroup input |
| 3287 | */ |
| 3288 | GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); |
| 3289 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3290 | /*! @brief Sets the key callback. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3291 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3292 | * This function sets the key callback of the specified window, which is called |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3293 | * when a key is pressed, repeated or released. |
| 3294 | * |
Camilla Berglund | 948cc04 | 2013-04-16 02:02:22 +0200 | [diff] [blame] | 3295 | * The key functions deal with physical keys, with layout independent |
| 3296 | * [key tokens](@ref keys) named after their values in the standard US keyboard |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 3297 | * layout. If you want to input text, use the |
| 3298 | * [character callback](@ref glfwSetCharCallback) instead. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3299 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3300 | * When a window loses input focus, it will generate synthetic key release |
| 3301 | * events for all pressed keys. You can tell these events from user-generated |
| 3302 | * events by the fact that the synthetic ones are generated after the focus |
| 3303 | * loss event has been processed, i.e. after the |
| 3304 | * [window focus callback](@ref glfwSetWindowFocusCallback) has been called. |
Camilla Berglund | 4538a52 | 2013-04-24 19:49:46 +0200 | [diff] [blame] | 3305 | * |
Camilla Berglund | 11615fc | 2013-05-30 17:19:12 +0200 | [diff] [blame] | 3306 | * The scancode of a key is specific to that platform or sometimes even to that |
| 3307 | * machine. Scancodes are intended to allow users to bind keys that don't have |
| 3308 | * a GLFW key token. Such keys have `key` set to `GLFW_KEY_UNKNOWN`, their |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3309 | * state is not saved and so it cannot be queried with @ref glfwGetKey. |
Camilla Berglund | 11615fc | 2013-05-30 17:19:12 +0200 | [diff] [blame] | 3310 | * |
| 3311 | * Sometimes GLFW needs to generate synthetic key events, in which case the |
| 3312 | * scancode may be zero. |
| 3313 | * |
Camilla Berglund | 9492fc5 | 2013-01-17 17:51:12 +0100 | [diff] [blame] | 3314 | * @param[in] window The window whose callback to set. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 3315 | * @param[in] cbfun The new key callback, or `NULL` to remove the currently |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3316 | * set callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 3317 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 3318 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 3319 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3320 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 3321 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3322 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3323 | * |
| 3324 | * @sa @ref input_key |
| 3325 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3326 | * @since Added in version 1.0. |
| 3327 | * @glfw3 Added window handle parameter and return value. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3328 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3329 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3330 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 3331 | GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3332 | |
| 3333 | /*! @brief Sets the Unicode character callback. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3334 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3335 | * This function sets the character callback of the specified window, which is |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3336 | * called when a Unicode character is input. |
| 3337 | * |
Camilla Berglund | 96b12ee | 2014-06-12 23:04:20 +0200 | [diff] [blame] | 3338 | * The character callback is intended for Unicode text input. As it deals with |
| 3339 | * characters, it is keyboard layout dependent, whereas the |
| 3340 | * [key callback](@ref glfwSetKeyCallback) is not. Characters do not map 1:1 |
| 3341 | * to physical keys, as a key may produce zero, one or more characters. If you |
| 3342 | * want to know whether a specific physical key was pressed or released, see |
| 3343 | * the key callback instead. |
| 3344 | * |
| 3345 | * The character callback behaves as system text input normally does and will |
| 3346 | * not be called if modifier keys are held down that would prevent normal text |
| 3347 | * input on that platform, for example a Super (Command) key on OS X or Alt key |
| 3348 | * on Windows. There is a |
| 3349 | * [character with modifiers callback](@ref glfwSetCharModsCallback) that |
| 3350 | * receives these events. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3351 | * |
Camilla Berglund | 9492fc5 | 2013-01-17 17:51:12 +0100 | [diff] [blame] | 3352 | * @param[in] window The window whose callback to set. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 3353 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 3354 | * callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 3355 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 3356 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 3357 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3358 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 3359 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3360 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3361 | * |
| 3362 | * @sa @ref input_char |
| 3363 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3364 | * @since Added in version 2.4. |
| 3365 | * @glfw3 Added window handle parameter and return value. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3366 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3367 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3368 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 3369 | GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3370 | |
Camilla Berglund | 96b12ee | 2014-06-12 23:04:20 +0200 | [diff] [blame] | 3371 | /*! @brief Sets the Unicode character with modifiers callback. |
| 3372 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3373 | * This function sets the character with modifiers callback of the specified |
Camilla Berglund | 96b12ee | 2014-06-12 23:04:20 +0200 | [diff] [blame] | 3374 | * window, which is called when a Unicode character is input regardless of what |
| 3375 | * modifier keys are used. |
| 3376 | * |
| 3377 | * The character with modifiers callback is intended for implementing custom |
| 3378 | * Unicode character input. For regular Unicode text input, see the |
| 3379 | * [character callback](@ref glfwSetCharCallback). Like the character |
| 3380 | * callback, the character with modifiers callback deals with characters and is |
| 3381 | * keyboard layout dependent. Characters do not map 1:1 to physical keys, as |
| 3382 | * a key may produce zero, one or more characters. If you want to know whether |
| 3383 | * a specific physical key was pressed or released, see the |
| 3384 | * [key callback](@ref glfwSetKeyCallback) instead. |
| 3385 | * |
| 3386 | * @param[in] window The window whose callback to set. |
| 3387 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
| 3388 | * callback. |
| 3389 | * @return The previously set callback, or `NULL` if no callback was set or an |
Camilla Berglund | 999f355 | 2016-08-17 16:48:22 +0200 | [diff] [blame] | 3390 | * [error](@ref error_handling) occurred. |
Camilla Berglund | 96b12ee | 2014-06-12 23:04:20 +0200 | [diff] [blame] | 3391 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3392 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 3393 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3394 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3395 | * |
| 3396 | * @sa @ref input_char |
| 3397 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3398 | * @since Added in version 3.1. |
Camilla Berglund | 96b12ee | 2014-06-12 23:04:20 +0200 | [diff] [blame] | 3399 | * |
| 3400 | * @ingroup input |
| 3401 | */ |
| 3402 | GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun cbfun); |
| 3403 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3404 | /*! @brief Sets the mouse button callback. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3405 | * |
| 3406 | * This function sets the mouse button callback of the specified window, which |
| 3407 | * is called when a mouse button is pressed or released. |
| 3408 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3409 | * When a window loses input focus, it will generate synthetic mouse button |
| 3410 | * release events for all pressed mouse buttons. You can tell these events |
| 3411 | * from user-generated events by the fact that the synthetic ones are generated |
| 3412 | * after the focus loss event has been processed, i.e. after the |
| 3413 | * [window focus callback](@ref glfwSetWindowFocusCallback) has been called. |
Camilla Berglund | 4538a52 | 2013-04-24 19:49:46 +0200 | [diff] [blame] | 3414 | * |
Camilla Berglund | 9492fc5 | 2013-01-17 17:51:12 +0100 | [diff] [blame] | 3415 | * @param[in] window The window whose callback to set. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 3416 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 3417 | * callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 3418 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 3419 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 3420 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3421 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 3422 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3423 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3424 | * |
| 3425 | * @sa @ref input_mouse_button |
| 3426 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3427 | * @since Added in version 1.0. |
| 3428 | * @glfw3 Added window handle parameter and return value. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3429 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3430 | * @ingroup input |
| 3431 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 3432 | GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3433 | |
| 3434 | /*! @brief Sets the cursor position callback. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3435 | * |
| 3436 | * This function sets the cursor position callback of the specified window, |
| 3437 | * which is called when the cursor is moved. The callback is provided with the |
Camilla Berglund | 6d9d856 | 2013-09-28 22:12:50 +0200 | [diff] [blame] | 3438 | * position, in screen coordinates, relative to the upper-left corner of the |
| 3439 | * client area of the window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3440 | * |
Camilla Berglund | 9492fc5 | 2013-01-17 17:51:12 +0100 | [diff] [blame] | 3441 | * @param[in] window The window whose callback to set. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 3442 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 3443 | * callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 3444 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 3445 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 3446 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3447 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 3448 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3449 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3450 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3451 | * @sa @ref cursor_pos |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3452 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3453 | * @since Added in version 3.0. Replaces `glfwSetMousePosCallback`. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3454 | * |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3455 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3456 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 3457 | GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3458 | |
| 3459 | /*! @brief Sets the cursor enter/exit callback. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3460 | * |
| 3461 | * This function sets the cursor boundary crossing callback of the specified |
| 3462 | * window, which is called when the cursor enters or leaves the client area of |
| 3463 | * the window. |
| 3464 | * |
Camilla Berglund | 9492fc5 | 2013-01-17 17:51:12 +0100 | [diff] [blame] | 3465 | * @param[in] window The window whose callback to set. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 3466 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
Camilla Berglund | dba2d80 | 2013-01-17 23:06:56 +0100 | [diff] [blame] | 3467 | * callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 3468 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 3469 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 3470 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3471 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 3472 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3473 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3474 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3475 | * @sa @ref cursor_enter |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3476 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3477 | * @since Added in version 3.0. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3478 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3479 | * @ingroup input |
| 3480 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 3481 | GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3482 | |
| 3483 | /*! @brief Sets the scroll callback. |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 3484 | * |
| 3485 | * This function sets the scroll callback of the specified window, which is |
| 3486 | * called when a scrolling device is used, such as a mouse wheel or scrolling |
| 3487 | * area of a touchpad. |
| 3488 | * |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 3489 | * The scroll callback receives all scrolling input, like that from a mouse |
| 3490 | * wheel or a touchpad scrolling area. |
| 3491 | * |
Camilla Berglund | 9492fc5 | 2013-01-17 17:51:12 +0100 | [diff] [blame] | 3492 | * @param[in] window The window whose callback to set. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 3493 | * @param[in] cbfun The new scroll callback, or `NULL` to remove the currently |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3494 | * set callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 3495 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 3496 | * library had not been [initialized](@ref intro_init). |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 3497 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3498 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 3499 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3500 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3501 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3502 | * @sa @ref scrolling |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3503 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3504 | * @since Added in version 3.0. Replaces `glfwSetMouseWheelCallback`. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3505 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 3506 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3507 | */ |
Camilla Berglund | 11a27de | 2013-04-08 21:21:21 +0200 | [diff] [blame] | 3508 | GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 3509 | |
Camilla Berglund | 5c8121e | 2014-03-29 21:35:21 +0100 | [diff] [blame] | 3510 | /*! @brief Sets the file drop callback. |
arturo | 89d0723 | 2013-07-10 11:42:14 +0200 | [diff] [blame] | 3511 | * |
Camilla Berglund | 5c8121e | 2014-03-29 21:35:21 +0100 | [diff] [blame] | 3512 | * This function sets the file drop callback of the specified window, which is |
| 3513 | * called when one or more dragged files are dropped on the window. |
arturo | 89d0723 | 2013-07-10 11:42:14 +0200 | [diff] [blame] | 3514 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3515 | * Because the path array and its strings may have been generated specifically |
| 3516 | * for that event, they are not guaranteed to be valid after the callback has |
| 3517 | * returned. If you wish to use them after the callback returns, you need to |
| 3518 | * make a deep copy. |
arturo | 89d0723 | 2013-07-10 11:42:14 +0200 | [diff] [blame] | 3519 | * |
| 3520 | * @param[in] window The window whose callback to set. |
Camilla Berglund | 5c8121e | 2014-03-29 21:35:21 +0100 | [diff] [blame] | 3521 | * @param[in] cbfun The new file drop callback, or `NULL` to remove the |
| 3522 | * currently set callback. |
Camilla Berglund | e8e05d4 | 2014-04-23 13:30:11 +0200 | [diff] [blame] | 3523 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 3524 | * library had not been [initialized](@ref intro_init). |
arturo | 89d0723 | 2013-07-10 11:42:14 +0200 | [diff] [blame] | 3525 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3526 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 3527 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3528 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3529 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3530 | * @sa @ref path_drop |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3531 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3532 | * @since Added in version 3.1. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3533 | * |
arturo | 89d0723 | 2013-07-10 11:42:14 +0200 | [diff] [blame] | 3534 | * @ingroup input |
| 3535 | */ |
| 3536 | GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun); |
| 3537 | |
Camilla Berglund | fdd4518 | 2013-05-27 15:13:09 +0200 | [diff] [blame] | 3538 | /*! @brief Returns whether the specified joystick is present. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3539 | * |
Camilla Berglund | fdd4518 | 2013-05-27 15:13:09 +0200 | [diff] [blame] | 3540 | * This function returns whether the specified joystick is present. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3541 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3542 | * @param[in] joy The [joystick](@ref joysticks) to query. |
Camilla Berglund | 0eccf75 | 2015-08-23 19:30:04 +0200 | [diff] [blame] | 3543 | * @return `GLFW_TRUE` if the joystick is present, or `GLFW_FALSE` otherwise. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3544 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3545 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 3546 | * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. |
| 3547 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3548 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3549 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3550 | * @sa @ref joystick |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3551 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3552 | * @since Added in version 3.0. Replaces `glfwGetJoystickParam`. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3553 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3554 | * @ingroup input |
| 3555 | */ |
Camilla Berglund | 7f2eb7b | 2013-04-24 19:25:42 +0200 | [diff] [blame] | 3556 | GLFWAPI int glfwJoystickPresent(int joy); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3557 | |
Camilla Berglund | 7f2eb7b | 2013-04-24 19:25:42 +0200 | [diff] [blame] | 3558 | /*! @brief Returns the values of all axes of the specified joystick. |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 3559 | * |
| 3560 | * This function returns the values of all axes of the specified joystick. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3561 | * Each element in the array is a value between -1.0 and 1.0. |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 3562 | * |
Camilla Berglund | 386b603 | 2016-02-10 13:48:49 +0100 | [diff] [blame] | 3563 | * Querying a joystick slot with no device present is not an error, but will |
| 3564 | * cause this function to return `NULL`. Call @ref glfwJoystickPresent to |
| 3565 | * check device presence. |
| 3566 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3567 | * @param[in] joy The [joystick](@ref joysticks) to query. |
| 3568 | * @param[out] count Where to store the number of axis values in the returned |
Camilla Berglund | 999f355 | 2016-08-17 16:48:22 +0200 | [diff] [blame] | 3569 | * array. This is set to zero if the joystick is not present or an error |
| 3570 | * occurred. |
| 3571 | * @return An array of axis values, or `NULL` if the joystick is not present or |
| 3572 | * an [error](@ref error_handling) occurred. |
Camilla Berglund | 7f2eb7b | 2013-04-24 19:25:42 +0200 | [diff] [blame] | 3573 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3574 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 3575 | * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. |
| 3576 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3577 | * @pointer_lifetime The returned array is allocated and freed by GLFW. You |
| 3578 | * should not free it yourself. It is valid until the specified joystick is |
| 3579 | * disconnected, this function is called again for that joystick or the library |
| 3580 | * is terminated. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3581 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3582 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | c3bb5c9 | 2013-06-05 16:04:04 +0200 | [diff] [blame] | 3583 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3584 | * @sa @ref joystick_axis |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3585 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3586 | * @since Added in version 3.0. Replaces `glfwGetJoystickPos`. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3587 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3588 | * @ingroup input |
| 3589 | */ |
Camilla Berglund | 180a4ee | 2013-06-04 18:20:38 +0200 | [diff] [blame] | 3590 | GLFWAPI const float* glfwGetJoystickAxes(int joy, int* count); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3591 | |
Camilla Berglund | e93bade | 2013-06-16 02:33:33 +0200 | [diff] [blame] | 3592 | /*! @brief Returns the state of all buttons of the specified joystick. |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 3593 | * |
Camilla Berglund | e93bade | 2013-06-16 02:33:33 +0200 | [diff] [blame] | 3594 | * This function returns the state of all buttons of the specified joystick. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3595 | * Each element in the array is either `GLFW_PRESS` or `GLFW_RELEASE`. |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 3596 | * |
Camilla Berglund | 386b603 | 2016-02-10 13:48:49 +0100 | [diff] [blame] | 3597 | * Querying a joystick slot with no device present is not an error, but will |
| 3598 | * cause this function to return `NULL`. Call @ref glfwJoystickPresent to |
| 3599 | * check device presence. |
| 3600 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3601 | * @param[in] joy The [joystick](@ref joysticks) to query. |
| 3602 | * @param[out] count Where to store the number of button states in the returned |
Camilla Berglund | 999f355 | 2016-08-17 16:48:22 +0200 | [diff] [blame] | 3603 | * array. This is set to zero if the joystick is not present or an error |
| 3604 | * occurred. |
| 3605 | * @return An array of button states, or `NULL` if the joystick is not present |
| 3606 | * or an [error](@ref error_handling) occurred. |
Camilla Berglund | 7f2eb7b | 2013-04-24 19:25:42 +0200 | [diff] [blame] | 3607 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3608 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 3609 | * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. |
| 3610 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3611 | * @pointer_lifetime The returned array is allocated and freed by GLFW. You |
| 3612 | * should not free it yourself. It is valid until the specified joystick is |
| 3613 | * disconnected, this function is called again for that joystick or the library |
| 3614 | * is terminated. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3615 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3616 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | c3bb5c9 | 2013-06-05 16:04:04 +0200 | [diff] [blame] | 3617 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3618 | * @sa @ref joystick_button |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3619 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3620 | * @since Added in version 2.2. |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3621 | * @glfw3 Changed to return a dynamic array. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3622 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3623 | * @ingroup input |
| 3624 | */ |
Camilla Berglund | 180a4ee | 2013-06-04 18:20:38 +0200 | [diff] [blame] | 3625 | GLFWAPI const unsigned char* glfwGetJoystickButtons(int joy, int* count); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 3626 | |
Camilla Berglund | 7d9b5c0 | 2012-12-02 16:55:09 +0100 | [diff] [blame] | 3627 | /*! @brief Returns the name of the specified joystick. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3628 | * |
| 3629 | * This function returns the name, encoded as UTF-8, of the specified joystick. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3630 | * The returned string is allocated and freed by GLFW. You should not free it |
| 3631 | * yourself. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3632 | * |
Camilla Berglund | 386b603 | 2016-02-10 13:48:49 +0100 | [diff] [blame] | 3633 | * Querying a joystick slot with no device present is not an error, but will |
| 3634 | * cause this function to return `NULL`. Call @ref glfwJoystickPresent to |
| 3635 | * check device presence. |
| 3636 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3637 | * @param[in] joy The [joystick](@ref joysticks) to query. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 3638 | * @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick |
Camilla Berglund | 999f355 | 2016-08-17 16:48:22 +0200 | [diff] [blame] | 3639 | * is not present or an [error](@ref error_handling) occurred. |
Camilla Berglund | d4a08b1 | 2012-12-02 17:13:41 +0100 | [diff] [blame] | 3640 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3641 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 3642 | * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. |
| 3643 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3644 | * @pointer_lifetime The returned string is allocated and freed by GLFW. You |
| 3645 | * should not free it yourself. It is valid until the specified joystick is |
| 3646 | * disconnected, this function is called again for that joystick or the library |
| 3647 | * is terminated. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3648 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3649 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | c3bb5c9 | 2013-06-05 16:04:04 +0200 | [diff] [blame] | 3650 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3651 | * @sa @ref joystick_name |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3652 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3653 | * @since Added in version 3.0. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3654 | * |
| 3655 | * @ingroup input |
Camilla Berglund | 7d9b5c0 | 2012-12-02 16:55:09 +0100 | [diff] [blame] | 3656 | */ |
Camilla Berglund | 93a1d1c | 2012-09-07 01:01:34 +0200 | [diff] [blame] | 3657 | GLFWAPI const char* glfwGetJoystickName(int joy); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 3658 | |
Camilla Berglund | 8a7fa30 | 2015-12-13 17:38:50 +0100 | [diff] [blame] | 3659 | /*! @brief Sets the joystick configuration callback. |
| 3660 | * |
| 3661 | * This function sets the joystick configuration callback, or removes the |
| 3662 | * currently set callback. This is called when a joystick is connected to or |
| 3663 | * disconnected from the system. |
| 3664 | * |
| 3665 | * @param[in] cbfun The new callback, or `NULL` to remove the currently set |
| 3666 | * callback. |
| 3667 | * @return The previously set callback, or `NULL` if no callback was set or the |
| 3668 | * library had not been [initialized](@ref intro_init). |
| 3669 | * |
| 3670 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 3671 | * |
| 3672 | * @thread_safety This function must only be called from the main thread. |
| 3673 | * |
| 3674 | * @sa @ref joystick_event |
| 3675 | * |
| 3676 | * @since Added in version 3.2. |
| 3677 | * |
| 3678 | * @ingroup input |
| 3679 | */ |
| 3680 | GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun); |
| 3681 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3682 | /*! @brief Sets the clipboard to the specified string. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3683 | * |
| 3684 | * This function sets the system clipboard to the specified, UTF-8 encoded |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3685 | * string. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3686 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3687 | * @param[in] window The window that will own the clipboard contents. |
| 3688 | * @param[in] string A UTF-8 encoded string. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3689 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3690 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 3691 | * GLFW_PLATFORM_ERROR. |
| 3692 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3693 | * @pointer_lifetime The specified string is copied before this function |
| 3694 | * returns. |
Camilla Berglund | a3ff29a | 2012-12-02 15:47:10 +0100 | [diff] [blame] | 3695 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3696 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3697 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3698 | * @sa @ref clipboard |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3699 | * @sa glfwGetClipboardString |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3700 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3701 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3702 | * |
Camilla Berglund | 8d170c7 | 2014-09-09 16:26:57 +0200 | [diff] [blame] | 3703 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3704 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 3705 | GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3706 | |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3707 | /*! @brief Returns the contents of the clipboard as a string. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3708 | * |
| 3709 | * This function returns the contents of the system clipboard, if it contains |
Camilla Berglund | cf9079c | 2015-09-16 18:51:49 +0200 | [diff] [blame] | 3710 | * or is convertible to a UTF-8 encoded string. If the clipboard is empty or |
Camilla Berglund | 0b65053 | 2015-09-16 16:27:28 +0200 | [diff] [blame] | 3711 | * if its contents cannot be converted, `NULL` is returned and a @ref |
| 3712 | * GLFW_FORMAT_UNAVAILABLE error is generated. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3713 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3714 | * @param[in] window The window that will request the clipboard contents. |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 3715 | * @return The contents of the clipboard as a UTF-8 encoded string, or `NULL` |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3716 | * if an [error](@ref error_handling) occurred. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3717 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3718 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 3719 | * GLFW_PLATFORM_ERROR. |
| 3720 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3721 | * @pointer_lifetime The returned string is allocated and freed by GLFW. You |
| 3722 | * should not free it yourself. It is valid until the next call to @ref |
Camilla Berglund | 6be821c | 2014-10-06 23:18:33 +0200 | [diff] [blame] | 3723 | * glfwGetClipboardString or @ref glfwSetClipboardString, or until the library |
| 3724 | * is terminated. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3725 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3726 | * @thread_safety This function must only be called from the main thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3727 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3728 | * @sa @ref clipboard |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3729 | * @sa glfwSetClipboardString |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3730 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3731 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3732 | * |
Camilla Berglund | 8d170c7 | 2014-09-09 16:26:57 +0200 | [diff] [blame] | 3733 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3734 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 3735 | GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window); |
Ralph Eastwood | 31c9154 | 2011-09-21 10:09:47 +0100 | [diff] [blame] | 3736 | |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3737 | /*! @brief Returns the value of the GLFW timer. |
| 3738 | * |
| 3739 | * This function returns the value of the GLFW timer. Unless the timer has |
| 3740 | * been set using @ref glfwSetTime, the timer measures time elapsed since GLFW |
| 3741 | * was initialized. |
| 3742 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3743 | * The resolution of the timer is system dependent, but is usually on the order |
| 3744 | * of a few micro- or nanoseconds. It uses the highest-resolution monotonic |
| 3745 | * time source on each supported platform. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3746 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3747 | * @return The current value, in seconds, or zero if an |
| 3748 | * [error](@ref error_handling) occurred. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3749 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3750 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 3751 | * |
Camilla Berglund | 20bce15 | 2016-05-30 16:04:37 +0200 | [diff] [blame] | 3752 | * @thread_safety This function may be called from any thread. Reading and |
| 3753 | * writing of the internal timer offset is not atomic, so it needs to be |
| 3754 | * externally synchronized with calls to @ref glfwSetTime. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3755 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3756 | * @sa @ref time |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3757 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3758 | * @since Added in version 1.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3759 | * |
| 3760 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3761 | */ |
Camilla Berglund | 9a71669 | 2010-09-08 16:40:43 +0200 | [diff] [blame] | 3762 | GLFWAPI double glfwGetTime(void); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 3763 | |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3764 | /*! @brief Sets the GLFW timer. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3765 | * |
| 3766 | * This function sets the value of the GLFW timer. It then continues to count |
Camilla Berglund | 6e20cda | 2015-03-10 12:01:38 +0100 | [diff] [blame] | 3767 | * up from that value. The value must be a positive finite number less than |
| 3768 | * or equal to 18446744073.0, which is approximately 584.5 years. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3769 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3770 | * @param[in] time The new value, in seconds. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3771 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3772 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 3773 | * GLFW_INVALID_VALUE. |
| 3774 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3775 | * @remark The upper limit of the timer is calculated as |
Camilla Berglund | 6e20cda | 2015-03-10 12:01:38 +0100 | [diff] [blame] | 3776 | * floor((2<sup>64</sup> - 1) / 10<sup>9</sup>) and is due to implementations |
| 3777 | * storing nanoseconds in 64 bits. The limit may be increased in the future. |
| 3778 | * |
Camilla Berglund | 20bce15 | 2016-05-30 16:04:37 +0200 | [diff] [blame] | 3779 | * @thread_safety This function may be called from any thread. Reading and |
| 3780 | * writing of the internal timer offset is not atomic, so it needs to be |
| 3781 | * externally synchronized with calls to @ref glfwGetTime. |
Camilla Berglund | 0e20577 | 2014-03-24 11:58:35 +0100 | [diff] [blame] | 3782 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3783 | * @sa @ref time |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 3784 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3785 | * @since Added in version 2.2. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3786 | * |
| 3787 | * @ingroup input |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3788 | */ |
| 3789 | GLFWAPI void glfwSetTime(double time); |
| 3790 | |
Camilla Berglund | 31f67dd | 2016-03-06 11:38:55 +0100 | [diff] [blame] | 3791 | /*! @brief Returns the current value of the raw timer. |
| 3792 | * |
Camilla Berglund | 337c77a | 2016-03-06 14:11:14 +0100 | [diff] [blame] | 3793 | * This function returns the current value of the raw timer, measured in |
| 3794 | * 1 / frequency seconds. To get the frequency, call @ref |
| 3795 | * glfwGetTimerFrequency. |
Camilla Berglund | 31f67dd | 2016-03-06 11:38:55 +0100 | [diff] [blame] | 3796 | * |
| 3797 | * @return The value of the timer, or zero if an |
| 3798 | * [error](@ref error_handling) occurred. |
| 3799 | * |
Camilla Berglund | 46fce40 | 2016-03-07 13:35:37 +0100 | [diff] [blame] | 3800 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
Camilla Berglund | 31f67dd | 2016-03-06 11:38:55 +0100 | [diff] [blame] | 3801 | * |
| 3802 | * @thread_safety This function may be called from any thread. |
| 3803 | * |
| 3804 | * @sa @ref time |
| 3805 | * @sa glfwGetTimerFrequency |
| 3806 | * |
| 3807 | * @since Added in version 3.2. |
| 3808 | * |
| 3809 | * @ingroup input |
| 3810 | */ |
Camilla Berglund | 5661d03 | 2016-03-23 10:09:07 +0100 | [diff] [blame] | 3811 | GLFWAPI uint64_t glfwGetTimerValue(void); |
Camilla Berglund | 31f67dd | 2016-03-06 11:38:55 +0100 | [diff] [blame] | 3812 | |
| 3813 | /*! @brief Returns the frequency, in Hz, of the raw timer. |
| 3814 | * |
Camilla Berglund | defaea3 | 2016-03-07 13:36:54 +0100 | [diff] [blame] | 3815 | * This function returns the frequency, in Hz, of the raw timer. |
| 3816 | * |
Camilla Berglund | 31f67dd | 2016-03-06 11:38:55 +0100 | [diff] [blame] | 3817 | * @return The frequency of the timer, in Hz, or zero if an |
| 3818 | * [error](@ref error_handling) occurred. |
| 3819 | * |
Camilla Berglund | 46fce40 | 2016-03-07 13:35:37 +0100 | [diff] [blame] | 3820 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
Camilla Berglund | 31f67dd | 2016-03-06 11:38:55 +0100 | [diff] [blame] | 3821 | * |
| 3822 | * @thread_safety This function may be called from any thread. |
| 3823 | * |
| 3824 | * @sa @ref time |
| 3825 | * @sa glfwGetTimerValue |
| 3826 | * |
| 3827 | * @since Added in version 3.2. |
| 3828 | * |
| 3829 | * @ingroup input |
| 3830 | */ |
Camilla Berglund | 5661d03 | 2016-03-23 10:09:07 +0100 | [diff] [blame] | 3831 | GLFWAPI uint64_t glfwGetTimerFrequency(void); |
Camilla Berglund | 31f67dd | 2016-03-06 11:38:55 +0100 | [diff] [blame] | 3832 | |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3833 | /*! @brief Makes the context of the specified window current for the calling |
| 3834 | * thread. |
| 3835 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3836 | * This function makes the OpenGL or OpenGL ES context of the specified window |
| 3837 | * current on the calling thread. A context can only be made current on |
| 3838 | * a single thread at a time and each thread can have only a single current |
| 3839 | * context at a time. |
| 3840 | * |
| 3841 | * By default, making a context non-current implicitly forces a pipeline flush. |
| 3842 | * On machines that support `GL_KHR_context_flush_control`, you can control |
| 3843 | * whether a context performs this flush by setting the |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 3844 | * [GLFW_CONTEXT_RELEASE_BEHAVIOR](@ref window_hints_ctx) window hint. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3845 | * |
Camilla Berglund | 98b478f | 2015-11-05 13:44:15 +0100 | [diff] [blame] | 3846 | * The specified window must have an OpenGL or OpenGL ES context. Specifying |
| 3847 | * a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT |
| 3848 | * error. |
| 3849 | * |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 3850 | * @param[in] window The window whose context to make current, or `NULL` to |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3851 | * detach the current context. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3852 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3853 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 3854 | * GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR. |
| 3855 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3856 | * @thread_safety This function may be called from any thread. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3857 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3858 | * @sa @ref context_current |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3859 | * @sa glfwGetCurrentContext |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 3860 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3861 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3862 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 3863 | * @ingroup context |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3864 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 3865 | GLFWAPI void glfwMakeContextCurrent(GLFWwindow* window); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3866 | |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3867 | /*! @brief Returns the window whose context is current on the calling thread. |
| 3868 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3869 | * This function returns the window whose OpenGL or OpenGL ES context is |
| 3870 | * current on the calling thread. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3871 | * |
Camilla Berglund | 71d2b57 | 2013-03-12 15:33:05 +0100 | [diff] [blame] | 3872 | * @return The window whose context is current, or `NULL` if no window's |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3873 | * context is current. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3874 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3875 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 3876 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3877 | * @thread_safety This function may be called from any thread. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3878 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3879 | * @sa @ref context_current |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3880 | * @sa glfwMakeContextCurrent |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 3881 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3882 | * @since Added in version 3.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3883 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 3884 | * @ingroup context |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3885 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 3886 | GLFWAPI GLFWwindow* glfwGetCurrentContext(void); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3887 | |
| 3888 | /*! @brief Swaps the front and back buffers of the specified window. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3889 | * |
Camilla Berglund | 001c50c | 2016-02-19 09:13:56 +0100 | [diff] [blame] | 3890 | * This function swaps the front and back buffers of the specified window when |
| 3891 | * rendering with OpenGL or OpenGL ES. If the swap interval is greater than |
| 3892 | * zero, the GPU driver waits the specified number of screen updates before |
| 3893 | * swapping the buffers. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3894 | * |
Camilla Berglund | 98b478f | 2015-11-05 13:44:15 +0100 | [diff] [blame] | 3895 | * The specified window must have an OpenGL or OpenGL ES context. Specifying |
| 3896 | * a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT |
| 3897 | * error. |
| 3898 | * |
Camilla Berglund | 001c50c | 2016-02-19 09:13:56 +0100 | [diff] [blame] | 3899 | * This function does not apply to Vulkan. If you are rendering with Vulkan, |
| 3900 | * see `vkQueuePresentKHR` instead. |
| 3901 | * |
Camilla Berglund | 9492fc5 | 2013-01-17 17:51:12 +0100 | [diff] [blame] | 3902 | * @param[in] window The window whose buffers to swap. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3903 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3904 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 3905 | * GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR. |
| 3906 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3907 | * @remark __EGL:__ The context of the specified window must be current on the |
Camilla Berglund | 276b1bc | 2016-01-31 19:17:18 +0100 | [diff] [blame] | 3908 | * calling thread. |
| 3909 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3910 | * @thread_safety This function may be called from any thread. |
Camilla Berglund | 401033c | 2013-03-12 19:17:07 +0100 | [diff] [blame] | 3911 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3912 | * @sa @ref buffer_swap |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3913 | * @sa glfwSwapInterval |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 3914 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3915 | * @since Added in version 1.0. |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3916 | * @glfw3 Added window handle parameter. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3917 | * |
| 3918 | * @ingroup window |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3919 | */ |
Camilla Berglund | 9af960e | 2013-01-05 21:13:28 +0100 | [diff] [blame] | 3920 | GLFWAPI void glfwSwapBuffers(GLFWwindow* window); |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3921 | |
| 3922 | /*! @brief Sets the swap interval for the current context. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3923 | * |
Camilla Berglund | 001c50c | 2016-02-19 09:13:56 +0100 | [diff] [blame] | 3924 | * This function sets the swap interval for the current OpenGL or OpenGL ES |
| 3925 | * context, i.e. the number of screen updates to wait from the time @ref |
| 3926 | * glfwSwapBuffers was called before swapping the buffers and returning. This |
| 3927 | * is sometimes called _vertical synchronization_, _vertical retrace |
| 3928 | * synchronization_ or just _vsync_. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3929 | * |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 3930 | * Contexts that support either of the `WGL_EXT_swap_control_tear` and |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 3931 | * `GLX_EXT_swap_control_tear` extensions also accept negative swap intervals, |
| 3932 | * which allow the driver to swap even if a frame arrives a little bit late. |
| 3933 | * You can check for the presence of these extensions using @ref |
| 3934 | * glfwExtensionSupported. For more information about swap tearing, see the |
| 3935 | * extension specifications. |
| 3936 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3937 | * A context must be current on the calling thread. Calling this function |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 3938 | * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3939 | * |
Camilla Berglund | 001c50c | 2016-02-19 09:13:56 +0100 | [diff] [blame] | 3940 | * This function does not apply to Vulkan. If you are rendering with Vulkan, |
| 3941 | * see the present mode of your swapchain instead. |
| 3942 | * |
Camilla Berglund | 5fd409b | 2013-06-05 17:53:13 +0200 | [diff] [blame] | 3943 | * @param[in] interval The minimum number of screen updates to wait for |
| 3944 | * until the buffers are swapped by @ref glfwSwapBuffers. |
| 3945 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3946 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 3947 | * GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR. |
| 3948 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3949 | * @remark This function is not called during context creation, leaving the |
Camilla Berglund | 11c22d6 | 2015-02-19 15:33:51 +0100 | [diff] [blame] | 3950 | * swap interval set to whatever is the default on that platform. This is done |
Camilla Berglund | 3af1c41 | 2013-09-19 21:37:01 +0200 | [diff] [blame] | 3951 | * because some swap interval extensions used by GLFW do not allow the swap |
| 3952 | * interval to be reset to zero once it has been set to a non-zero value. |
| 3953 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3954 | * @remark Some GPU drivers do not honor the requested swap interval, either |
Camilla Berglund | 11c22d6 | 2015-02-19 15:33:51 +0100 | [diff] [blame] | 3955 | * because of a user setting that overrides the application's request or due to |
| 3956 | * bugs in the driver. |
Camilla Berglund | 8282a8f | 2013-04-10 23:01:12 +0200 | [diff] [blame] | 3957 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3958 | * @thread_safety This function may be called from any thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3959 | * |
Camilla Berglund | 4188c26 | 2015-01-18 01:55:25 +0100 | [diff] [blame] | 3960 | * @sa @ref buffer_swap |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3961 | * @sa glfwSwapBuffers |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 3962 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 3963 | * @since Added in version 1.0. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3964 | * |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 3965 | * @ingroup context |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3966 | */ |
| 3967 | GLFWAPI void glfwSwapInterval(int interval); |
| 3968 | |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3969 | /*! @brief Returns whether the specified extension is available. |
| 3970 | * |
Camilla Berglund | 608109c | 2013-04-11 20:18:46 +0200 | [diff] [blame] | 3971 | * This function returns whether the specified |
Camilla Berglund | 001c50c | 2016-02-19 09:13:56 +0100 | [diff] [blame] | 3972 | * [API extension](@ref context_glext) is supported by the current OpenGL or |
| 3973 | * OpenGL ES context. It searches both for client API extension and context |
| 3974 | * creation API extensions. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3975 | * |
| 3976 | * A context must be current on the calling thread. Calling this function |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 3977 | * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3978 | * |
| 3979 | * As this functions retrieves and searches one or more extension strings each |
| 3980 | * call, it is recommended that you cache its results if it is going to be used |
| 3981 | * frequently. The extension strings will not change during the lifetime of |
| 3982 | * a context, so there is no danger in doing this. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 3983 | * |
Camilla Berglund | 001c50c | 2016-02-19 09:13:56 +0100 | [diff] [blame] | 3984 | * This function does not apply to Vulkan. If you are using Vulkan, see @ref |
| 3985 | * glfwGetRequiredInstanceExtensions, `vkEnumerateInstanceExtensionProperties` |
| 3986 | * and `vkEnumerateDeviceExtensionProperties` instead. |
| 3987 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3988 | * @param[in] extension The ASCII encoded name of the extension. |
Camilla Berglund | 0eccf75 | 2015-08-23 19:30:04 +0200 | [diff] [blame] | 3989 | * @return `GLFW_TRUE` if the extension is available, or `GLFW_FALSE` |
| 3990 | * otherwise. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3991 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 3992 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 3993 | * GLFW_NO_CURRENT_CONTEXT, @ref GLFW_INVALID_VALUE and @ref |
| 3994 | * GLFW_PLATFORM_ERROR. |
| 3995 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 3996 | * @thread_safety This function may be called from any thread. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 3997 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 3998 | * @sa @ref context_glext |
| 3999 | * @sa glfwGetProcAddress |
| 4000 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 4001 | * @since Added in version 1.0. |
Camilla Berglund | e248fb6 | 2013-03-29 14:06:23 +0100 | [diff] [blame] | 4002 | * |
| 4003 | * @ingroup context |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 4004 | */ |
| 4005 | GLFWAPI int glfwExtensionSupported(const char* extension); |
| 4006 | |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 4007 | /*! @brief Returns the address of the specified function for the current |
| 4008 | * context. |
| 4009 | * |
Camilla Berglund | 001c50c | 2016-02-19 09:13:56 +0100 | [diff] [blame] | 4010 | * This function returns the address of the specified OpenGL or OpenGL ES |
Camilla Berglund | 11c22d6 | 2015-02-19 15:33:51 +0100 | [diff] [blame] | 4011 | * [core or extension function](@ref context_glext), if it is supported |
Camilla Berglund | 1f5f20e | 2013-05-27 17:10:34 +0200 | [diff] [blame] | 4012 | * by the current context. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 4013 | * |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 4014 | * A context must be current on the calling thread. Calling this function |
Camilla Berglund | ce8f97c | 2015-01-11 23:33:14 +0100 | [diff] [blame] | 4015 | * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 4016 | * |
Camilla Berglund | 001c50c | 2016-02-19 09:13:56 +0100 | [diff] [blame] | 4017 | * This function does not apply to Vulkan. If you are rendering with Vulkan, |
| 4018 | * see @ref glfwGetInstanceProcAddress, `vkGetInstanceProcAddr` and |
| 4019 | * `vkGetDeviceProcAddr` instead. |
| 4020 | * |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 4021 | * @param[in] procname The ASCII encoded name of the function. |
Camilla Berglund | a36e3a2 | 2015-11-05 17:14:26 +0100 | [diff] [blame] | 4022 | * @return The address of the function, or `NULL` if an |
| 4023 | * [error](@ref error_handling) occurred. |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 4024 | * |
Camilla Berglund | f51cf81 | 2016-02-05 00:51:40 +0100 | [diff] [blame] | 4025 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 4026 | * GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR. |
| 4027 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 4028 | * @remark The address of a given function is not guaranteed to be the same |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 4029 | * between contexts. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 4030 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 4031 | * @remark This function may return a non-`NULL` address despite the |
Camilla Berglund | 11c22d6 | 2015-02-19 15:33:51 +0100 | [diff] [blame] | 4032 | * associated version or extension not being available. Always check the |
Camilla Berglund | c8e0687 | 2015-08-27 21:40:22 +0200 | [diff] [blame] | 4033 | * context version or extension string first. |
Camilla Berglund | 11c22d6 | 2015-02-19 15:33:51 +0100 | [diff] [blame] | 4034 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 4035 | * @pointer_lifetime The returned function pointer is valid until the context |
| 4036 | * is destroyed or the library is terminated. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 4037 | * |
Camilla Berglund | 951a958 | 2016-01-31 21:32:14 +0100 | [diff] [blame] | 4038 | * @thread_safety This function may be called from any thread. |
Camilla Berglund | 4591ad2 | 2014-09-18 15:03:29 +0200 | [diff] [blame] | 4039 | * |
| 4040 | * @sa @ref context_glext |
| 4041 | * @sa glfwExtensionSupported |
| 4042 | * |
Camilla Berglund | 832c2ff | 2016-01-31 22:35:11 +0100 | [diff] [blame] | 4043 | * @since Added in version 1.0. |
Camilla Berglund | 2d5fb77 | 2013-03-18 19:11:02 +0100 | [diff] [blame] | 4044 | * |
| 4045 | * @ingroup context |
Camilla Berglund | bce2cd6 | 2012-11-22 16:38:24 +0100 | [diff] [blame] | 4046 | */ |
Camilla Berglund | bf42c3c | 2012-06-05 00:16:40 +0200 | [diff] [blame] | 4047 | GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 4048 | |
Camilla Berglund | 9b75bff | 2015-08-10 20:19:04 +0200 | [diff] [blame] | 4049 | /*! @brief Returns whether the Vulkan loader has been found. |
| 4050 | * |
| 4051 | * This function returns whether the Vulkan loader has been found. This check |
| 4052 | * is performed by @ref glfwInit. |
| 4053 | * |
| 4054 | * The availability of a Vulkan loader does not by itself guarantee that window |
| 4055 | * surface creation or even device creation is possible. Call @ref |
| 4056 | * glfwGetRequiredInstanceExtensions to check whether the extensions necessary |
| 4057 | * for Vulkan surface creation are available and @ref |
| 4058 | * glfwGetPhysicalDevicePresentationSupport to check whether a queue family of |
| 4059 | * a physical device supports image presentation. |
| 4060 | * |
| 4061 | * @return `GLFW_TRUE` if Vulkan is available, or `GLFW_FALSE` otherwise. |
| 4062 | * |
| 4063 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. |
| 4064 | * |
| 4065 | * @thread_safety This function may be called from any thread. |
| 4066 | * |
| 4067 | * @sa @ref vulkan_support |
| 4068 | * |
| 4069 | * @since Added in version 3.2. |
| 4070 | * |
| 4071 | * @ingroup vulkan |
| 4072 | */ |
| 4073 | GLFWAPI int glfwVulkanSupported(void); |
| 4074 | |
| 4075 | /*! @brief Returns the Vulkan instance extensions required by GLFW. |
| 4076 | * |
| 4077 | * This function returns an array of names of Vulkan instance extensions required |
| 4078 | * by GLFW for creating Vulkan surfaces for GLFW windows. If successful, the |
| 4079 | * list will always contains `VK_KHR_surface`, so if you don't require any |
| 4080 | * additional extensions you can pass this list directly to the |
| 4081 | * `VkInstanceCreateInfo` struct. |
| 4082 | * |
| 4083 | * If Vulkan is not available on the machine, this function returns `NULL` and |
| 4084 | * generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported |
| 4085 | * to check whether Vulkan is available. |
| 4086 | * |
| 4087 | * If Vulkan is available but no set of extensions allowing window surface |
| 4088 | * creation was found, this function returns `NULL`. You may still use Vulkan |
| 4089 | * for off-screen rendering and compute work. |
| 4090 | * |
| 4091 | * @param[out] count Where to store the number of extensions in the returned |
| 4092 | * array. This is set to zero if an error occurred. |
| 4093 | * @return An array of ASCII encoded extension names, or `NULL` if an |
| 4094 | * [error](@ref error_handling) occurred. |
| 4095 | * |
| 4096 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 4097 | * GLFW_API_UNAVAILABLE. |
| 4098 | * |
| 4099 | * @remarks Additional extensions may be required by future versions of GLFW. |
| 4100 | * You should check if any extensions you wish to enable are already in the |
| 4101 | * returned array, as it is an error to specify an extension more than once in |
| 4102 | * the `VkInstanceCreateInfo` struct. |
| 4103 | * |
| 4104 | * @pointer_lifetime The returned array is allocated and freed by GLFW. You |
| 4105 | * should not free it yourself. It is guaranteed to be valid only until the |
| 4106 | * library is terminated. |
| 4107 | * |
| 4108 | * @thread_safety This function may be called from any thread. |
| 4109 | * |
| 4110 | * @sa @ref vulkan_ext |
| 4111 | * @sa glfwCreateWindowSurface |
| 4112 | * |
| 4113 | * @since Added in version 3.2. |
| 4114 | * |
| 4115 | * @ingroup vulkan |
| 4116 | */ |
Camilla Berglund | 7ab7d8b | 2016-03-23 10:24:01 +0100 | [diff] [blame] | 4117 | GLFWAPI const char** glfwGetRequiredInstanceExtensions(uint32_t* count); |
Camilla Berglund | 9b75bff | 2015-08-10 20:19:04 +0200 | [diff] [blame] | 4118 | |
| 4119 | #if defined(VK_VERSION_1_0) |
| 4120 | |
| 4121 | /*! @brief Returns the address of the specified Vulkan instance function. |
| 4122 | * |
| 4123 | * This function returns the address of the specified Vulkan core or extension |
| 4124 | * function for the specified instance. If instance is set to `NULL` it can |
| 4125 | * return any function exported from the Vulkan loader, including at least the |
| 4126 | * following functions: |
| 4127 | * |
| 4128 | * - `vkEnumerateInstanceExtensionProperties` |
| 4129 | * - `vkEnumerateInstanceLayerProperties` |
| 4130 | * - `vkCreateInstance` |
| 4131 | * - `vkGetInstanceProcAddr` |
| 4132 | * |
| 4133 | * If Vulkan is not available on the machine, this function returns `NULL` and |
| 4134 | * generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported |
| 4135 | * to check whether Vulkan is available. |
| 4136 | * |
| 4137 | * This function is equivalent to calling `vkGetInstanceProcAddr` with |
| 4138 | * a platform-specific query of the Vulkan loader as a fallback. |
| 4139 | * |
| 4140 | * @param[in] instance The Vulkan instance to query, or `NULL` to retrieve |
| 4141 | * functions related to instance creation. |
| 4142 | * @param[in] procname The ASCII encoded name of the function. |
| 4143 | * @return The address of the function, or `NULL` if an |
| 4144 | * [error](@ref error_handling) occurred. |
| 4145 | * |
| 4146 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref |
| 4147 | * GLFW_API_UNAVAILABLE. |
| 4148 | * |
| 4149 | * @pointer_lifetime The returned function pointer is valid until the library |
| 4150 | * is terminated. |
| 4151 | * |
| 4152 | * @thread_safety This function may be called from any thread. |
| 4153 | * |
| 4154 | * @sa @ref vulkan_proc |
| 4155 | * |
| 4156 | * @since Added in version 3.2. |
| 4157 | * |
| 4158 | * @ingroup vulkan |
| 4159 | */ |
| 4160 | GLFWAPI GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, const char* procname); |
| 4161 | |
| 4162 | /*! @brief Returns whether the specified queue family can present images. |
| 4163 | * |
| 4164 | * This function returns whether the specified queue family of the specified |
| 4165 | * physical device supports presentation to the platform GLFW was built for. |
| 4166 | * |
| 4167 | * If Vulkan or the required window surface creation instance extensions are |
| 4168 | * not available on the machine, or if the specified instance was not created |
| 4169 | * with the required extensions, this function returns `GLFW_FALSE` and |
| 4170 | * generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported |
| 4171 | * to check whether Vulkan is available and @ref |
| 4172 | * glfwGetRequiredInstanceExtensions to check what instance extensions are |
| 4173 | * required. |
| 4174 | * |
| 4175 | * @param[in] instance The instance that the physical device belongs to. |
| 4176 | * @param[in] device The physical device that the queue family belongs to. |
| 4177 | * @param[in] queuefamily The index of the queue family to query. |
| 4178 | * @return `GLFW_TRUE` if the queue family supports presentation, or |
| 4179 | * `GLFW_FALSE` otherwise. |
| 4180 | * |
| 4181 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 4182 | * GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR. |
| 4183 | * |
| 4184 | * @thread_safety This function may be called from any thread. For |
| 4185 | * synchronization details of Vulkan objects, see the Vulkan specification. |
| 4186 | * |
| 4187 | * @sa @ref vulkan_present |
| 4188 | * |
| 4189 | * @since Added in version 3.2. |
| 4190 | * |
| 4191 | * @ingroup vulkan |
| 4192 | */ |
| 4193 | GLFWAPI int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); |
| 4194 | |
| 4195 | /*! @brief Creates a Vulkan surface for the specified window. |
| 4196 | * |
| 4197 | * This function creates a Vulkan surface for the specified window. |
| 4198 | * |
| 4199 | * If the Vulkan loader was not found at initialization, this function returns |
| 4200 | * `VK_ERROR_INITIALIZATION_FAILED` and generates a @ref GLFW_API_UNAVAILABLE |
| 4201 | * error. Call @ref glfwVulkanSupported to check whether the Vulkan loader was |
| 4202 | * found. |
| 4203 | * |
| 4204 | * If the required window surface creation instance extensions are not |
| 4205 | * available or if the specified instance was not created with these extensions |
| 4206 | * enabled, this function returns `VK_ERROR_EXTENSION_NOT_PRESENT` and |
| 4207 | * generates a @ref GLFW_API_UNAVAILABLE error. Call @ref |
| 4208 | * glfwGetRequiredInstanceExtensions to check what instance extensions are |
| 4209 | * required. |
| 4210 | * |
| 4211 | * The window surface must be destroyed before the specified Vulkan instance. |
| 4212 | * It is the responsibility of the caller to destroy the window surface. GLFW |
| 4213 | * does not destroy it for you. Call `vkDestroySurfaceKHR` to destroy the |
| 4214 | * surface. |
| 4215 | * |
| 4216 | * @param[in] instance The Vulkan instance to create the surface in. |
| 4217 | * @param[in] window The window to create the surface for. |
| 4218 | * @param[in] allocator The allocator to use, or `NULL` to use the default |
| 4219 | * allocator. |
| 4220 | * @param[out] surface Where to store the handle of the surface. This is set |
| 4221 | * to `VK_NULL_HANDLE` if an error occurred. |
| 4222 | * @return `VK_SUCCESS` if successful, or a Vulkan error code if an |
| 4223 | * [error](@ref error_handling) occurred. |
| 4224 | * |
| 4225 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref |
| 4226 | * GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR. |
| 4227 | * |
| 4228 | * @remarks If an error occurs before the creation call is made, GLFW returns |
| 4229 | * the Vulkan error code most appropriate for the error. Appropriate use of |
| 4230 | * @ref glfwVulkanSupported and @ref glfwGetRequiredInstanceExtensions should |
Camilla Berglund | ee33dcd | 2016-03-07 14:42:51 +0100 | [diff] [blame] | 4231 | * eliminate almost all occurrences of these errors. |
Camilla Berglund | 9b75bff | 2015-08-10 20:19:04 +0200 | [diff] [blame] | 4232 | * |
| 4233 | * @thread_safety This function may be called from any thread. For |
| 4234 | * synchronization details of Vulkan objects, see the Vulkan specification. |
| 4235 | * |
| 4236 | * @sa @ref vulkan_surface |
| 4237 | * @sa glfwGetRequiredInstanceExtensions |
| 4238 | * |
| 4239 | * @since Added in version 3.2. |
| 4240 | * |
| 4241 | * @ingroup vulkan |
| 4242 | */ |
| 4243 | GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); |
| 4244 | |
| 4245 | #endif /*VK_VERSION_1_0*/ |
| 4246 | |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 4247 | |
Camilla Berglund | 4afc67c | 2011-07-27 17:09:17 +0200 | [diff] [blame] | 4248 | /************************************************************************* |
| 4249 | * Global definition cleanup |
| 4250 | *************************************************************************/ |
| 4251 | |
| 4252 | /* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */ |
| 4253 | |
Camilla Berglund | 4afc67c | 2011-07-27 17:09:17 +0200 | [diff] [blame] | 4254 | #ifdef GLFW_WINGDIAPI_DEFINED |
| 4255 | #undef WINGDIAPI |
| 4256 | #undef GLFW_WINGDIAPI_DEFINED |
| 4257 | #endif |
| 4258 | |
| 4259 | #ifdef GLFW_CALLBACK_DEFINED |
| 4260 | #undef CALLBACK |
| 4261 | #undef GLFW_CALLBACK_DEFINED |
| 4262 | #endif |
| 4263 | |
| 4264 | /* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */ |
| 4265 | |
| 4266 | |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 4267 | #ifdef __cplusplus |
| 4268 | } |
| 4269 | #endif |
| 4270 | |
Camilla Berglund | f8df91d | 2013-01-15 01:59:56 +0100 | [diff] [blame] | 4271 | #endif /* _glfw3_h_ */ |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 4272 | |