blob: 0ce69cc60727c4117cd8b047522f2572aa6d51f5 [file] [log] [blame]
Camilla Berglund2955cd32010-11-17 15:42:55 +01001/*************************************************************************
Camilla Berglund6e553c72011-03-06 01:46:39 +01002 * GLFW - An OpenGL library
Camilla Berglund38b0ccb2010-09-07 17:41:26 +02003 * API version: 3.0
Camilla Berglund3249f812010-09-07 17:34:51 +02004 * WWW: http://www.glfw.org/
5 *------------------------------------------------------------------------
6 * Copyright (c) 2002-2006 Marcus Geelnard
Camilla Berglundf8105ed2010-11-09 02:57:46 +01007 * Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
Camilla Berglund3249f812010-09-07 17:34:51 +02008 *
9 * This software is provided 'as-is', without any express or implied
10 * warranty. In no event will the authors be held liable for any damages
11 * arising from the use of this software.
12 *
13 * Permission is granted to anyone to use this software for any purpose,
14 * including commercial applications, and to alter it and redistribute it
15 * freely, subject to the following restrictions:
16 *
17 * 1. The origin of this software must not be misrepresented; you must not
18 * claim that you wrote the original software. If you use this software
19 * in a product, an acknowledgment in the product documentation would
20 * be appreciated but is not required.
21 *
22 * 2. Altered source versions must be plainly marked as such, and must not
23 * be misrepresented as being the original software.
24 *
25 * 3. This notice may not be removed or altered from any source
26 * distribution.
27 *
28 *************************************************************************/
29
Camilla Berglundf8df91d2013-01-15 01:59:56 +010030#ifndef _glfw3_h_
31#define _glfw3_h_
Camilla Berglund3249f812010-09-07 17:34:51 +020032
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37
38/*************************************************************************
Camilla Berglundbce2cd62012-11-22 16:38:24 +010039 * Doxygen documentation
40 *************************************************************************/
41
Camilla Berglundbce2cd62012-11-22 16:38:24 +010042/*! @defgroup clipboard Clipboard support
43 */
Camilla Berglund3f5843f2012-12-13 02:22:39 +010044/*! @defgroup context Context handling
45 */
Camilla Berglundbce2cd62012-11-22 16:38:24 +010046/*! @defgroup error Error handling
47 */
48/*! @defgroup gamma Gamma ramp support
49 */
50/*! @defgroup init Initialization and version information
51 */
52/*! @defgroup input Input handling
53 */
Camilla Berglund5f68e122012-11-27 17:07:28 +010054/*! @defgroup monitor Monitor handling
55 */
Camilla Berglundbce2cd62012-11-22 16:38:24 +010056/*! @defgroup time Time input
57 */
58/*! @defgroup window Window handling
59 *
Camilla Berglund3f5843f2012-12-13 02:22:39 +010060 * The primary purpose of GLFW is to provide a simple interface to window
61 * management and OpenGL and OpenGL ES context creation. GLFW supports
62 * multiple windows, which can be either a normal desktop window or
Camilla Berglund8282a8f2013-04-10 23:01:12 +020063 * a full screen window.
Camilla Berglundbce2cd62012-11-22 16:38:24 +010064 */
Camilla Berglundbce2cd62012-11-22 16:38:24 +010065
66
67/*************************************************************************
Camilla Berglund3249f812010-09-07 17:34:51 +020068 * Global definitions
69 *************************************************************************/
70
Camilla Berglund3249f812010-09-07 17:34:51 +020071/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */
72
Camilla Berglund06e7a962012-11-22 19:14:27 +010073/* Please report any problems that you find with your compiler, which may
Camilla Berglund3249f812010-09-07 17:34:51 +020074 * be solved in this section! There are several compilers that I have not
75 * been able to test this file with yet.
76 *
77 * First: If we are we on Windows, we want a single define for it (_WIN32)
78 * (Note: For Cygwin the compiler flag -mwin32 should be used, but to
79 * make sure that things run smoothly for Cygwin users, we add __CYGWIN__
80 * to the list of "valid Win32 identifiers", which removes the need for
81 * -mwin32)
82 */
83#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__))
84 #define _WIN32
85#endif /* _WIN32 */
86
87/* In order for extension support to be portable, we need to define an
88 * OpenGL function call method. We use the keyword APIENTRY, which is
89 * defined for Win32. (Note: Windows also needs this for <GL/gl.h>)
90 */
91#ifndef APIENTRY
92 #ifdef _WIN32
93 #define APIENTRY __stdcall
94 #else
95 #define APIENTRY
96 #endif
Camilla Berglund3249f812010-09-07 17:34:51 +020097#endif /* APIENTRY */
98
Camilla Berglund3249f812010-09-07 17:34:51 +020099/* The following three defines are here solely to make some Windows-based
100 * <GL/gl.h> files happy. Theoretically we could include <windows.h>, but
101 * it has the major drawback of severely polluting our namespace.
102 */
103
104/* Under Windows, we need WINGDIAPI defined */
105#if !defined(WINGDIAPI) && defined(_WIN32)
106 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)
107 /* Microsoft Visual C++, Borland C++ Builder and Pelles C */
108 #define WINGDIAPI __declspec(dllimport)
109 #elif defined(__LCC__)
110 /* LCC-Win32 */
111 #define WINGDIAPI __stdcall
112 #else
113 /* Others (e.g. MinGW, Cygwin) */
114 #define WINGDIAPI extern
115 #endif
Camilla Berglund4afc67c2011-07-27 17:09:17 +0200116 #define GLFW_WINGDIAPI_DEFINED
Camilla Berglund3249f812010-09-07 17:34:51 +0200117#endif /* WINGDIAPI */
118
119/* Some <GL/glu.h> files also need CALLBACK defined */
120#if !defined(CALLBACK) && defined(_WIN32)
121 #if defined(_MSC_VER)
122 /* Microsoft Visual C++ */
123 #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
124 #define CALLBACK __stdcall
125 #else
126 #define CALLBACK
127 #endif
128 #else
129 /* Other Windows compilers */
130 #define CALLBACK __stdcall
131 #endif
Camilla Berglund4afc67c2011-07-27 17:09:17 +0200132 #define GLFW_CALLBACK_DEFINED
Camilla Berglund3249f812010-09-07 17:34:51 +0200133#endif /* CALLBACK */
134
Camilla Berglund3c912cb2012-08-02 21:25:00 +0200135/* Most <GL/glu.h> variants on Windows need wchar_t */
136#if defined(_WIN32)
137 #include <stddef.h>
138#endif
Camilla Berglund3249f812010-09-07 17:34:51 +0200139
140
141/* ---------------- GLFW related system specific defines ----------------- */
142
Camilla Berglundcc5d7cd2012-03-25 17:43:02 +0200143#if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL)
144 #error "You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined"
145#endif
146
Camilla Berglund2588c9b2012-03-25 17:40:30 +0200147#if defined(_WIN32) && defined(_GLFW_BUILD_DLL)
Camilla Berglund3249f812010-09-07 17:34:51 +0200148
149 /* We are building a Win32 DLL */
Camilla Berglund2955cd32010-11-17 15:42:55 +0100150 #define GLFWAPI __declspec(dllexport)
Camilla Berglund3249f812010-09-07 17:34:51 +0200151
152#elif defined(_WIN32) && defined(GLFW_DLL)
153
154 /* We are calling a Win32 DLL */
155 #if defined(__LCC__)
Camilla Berglund2955cd32010-11-17 15:42:55 +0100156 #define GLFWAPI extern
Camilla Berglund3249f812010-09-07 17:34:51 +0200157 #else
Camilla Berglund2955cd32010-11-17 15:42:55 +0100158 #define GLFWAPI __declspec(dllimport)
Camilla Berglund3249f812010-09-07 17:34:51 +0200159 #endif
160
161#else
162
163 /* We are either building/calling a static lib or we are non-win32 */
164 #define GLFWAPI
165
166#endif
167
168/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */
169
Camilla Berglund3f5843f2012-12-13 02:22:39 +0100170/* Include the chosen client API headers.
Camilla Berglund3249f812010-09-07 17:34:51 +0200171 */
172#if defined(__APPLE_CC__)
Camilla Berglund410a4e22012-09-27 22:28:04 +0200173 #if defined(GLFW_INCLUDE_GLCOREARB)
Camilla Berglundd88789e2011-09-16 04:44:40 +0200174 #include <OpenGL/gl3.h>
Camilla Berglund378c75d2013-03-13 20:44:00 +0100175 #elif !defined(GLFW_INCLUDE_NONE)
Camilla Berglundd88789e2011-09-16 04:44:40 +0200176 #define GL_GLEXT_LEGACY
177 #include <OpenGL/gl.h>
178 #endif
Camilla Berglund22134502012-06-05 23:55:10 +0200179 #if defined(GLFW_INCLUDE_GLU)
Camilla Berglundd88789e2011-09-16 04:44:40 +0200180 #include <OpenGL/glu.h>
181 #endif
Camilla Berglund3249f812010-09-07 17:34:51 +0200182#else
Camilla Berglund410a4e22012-09-27 22:28:04 +0200183 #if defined(GLFW_INCLUDE_GLCOREARB)
184 #include <GL/glcorearb.h>
Jari Vetoniemi38c4a8e2012-11-10 00:08:44 +0200185 #elif defined(GLFW_INCLUDE_ES1)
186 #include <GLES/gl.h>
Camilla Berglund3fd17742012-07-19 23:20:47 +0200187 #elif defined(GLFW_INCLUDE_ES2)
188 #include <GLES2/gl2.h>
Camilla Berglunda933d8c2013-02-14 19:28:59 +0100189 #elif defined(GLFW_INCLUDE_ES3)
190 #include <GLES3/gl3.h>
Camilla Berglund378c75d2013-03-13 20:44:00 +0100191 #elif !defined(GLFW_INCLUDE_NONE)
Camilla Berglundd88789e2011-09-16 04:44:40 +0200192 #include <GL/gl.h>
193 #endif
Camilla Berglund22134502012-06-05 23:55:10 +0200194 #if defined(GLFW_INCLUDE_GLU)
Camilla Berglundd88789e2011-09-16 04:44:40 +0200195 #include <GL/glu.h>
196 #endif
Camilla Berglund3249f812010-09-07 17:34:51 +0200197#endif
198
199
200/*************************************************************************
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100201 * GLFW API tokens
Camilla Berglund3249f812010-09-07 17:34:51 +0200202 *************************************************************************/
203
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100204/*! @name GLFW version macros
205 * @{ */
206/*! @brief The major version number of the GLFW library.
207 *
208 * This is incremented when the API is changed in non-compatible ways.
209 * @ingroup init
210 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100211#define GLFW_VERSION_MAJOR 3
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100212/*! @brief The minor version number of the GLFW library.
213 *
214 * This is incremented when features are added to the API but it remains
215 * backward-compatible.
216 * @ingroup init
217 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100218#define GLFW_VERSION_MINOR 0
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100219/*! @brief The revision number of the GLFW library.
220 *
221 * This is incremented when a bug fix release is made that does not contain any
222 * API changes.
223 * @ingroup init
224 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100225#define GLFW_VERSION_REVISION 0
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100226/*! @} */
Camilla Berglund3249f812010-09-07 17:34:51 +0200227
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100228/*! @name Key and button actions
229 * @{ */
230/*! @brief The key or button was released.
231 * @ingroup input
232 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100233#define GLFW_RELEASE 0
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100234/*! @brief The key or button was pressed.
235 * @ingroup input
236 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100237#define GLFW_PRESS 1
Camilla Berglund253e0d62013-01-12 17:06:35 +0100238/*! @brief The key was held down until it repeated.
239 * @ingroup input
240 */
241#define GLFW_REPEAT 2
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100242/*! @} */
Camilla Berglund3249f812010-09-07 17:34:51 +0200243
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200244/*! @defgroup keys Keyboard keys
245 *
246 * These key codes are inspired by the *USB HID Usage Tables v1.12* (p. 53-60),
Marcusc0cb4c22011-01-02 11:18:14 +0100247 * but re-arranged to map to 7-bit ASCII for printable keys (function keys are
248 * put in the 256+ range).
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200249 *
Marcusc0cb4c22011-01-02 11:18:14 +0100250 * The naming of the key codes follow these rules:
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200251 * - The US keyboard layout is used
Marcusc0cb4c22011-01-02 11:18:14 +0100252 * - Names of printable alpha-numeric characters are used (e.g. "A", "R",
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200253 * "3", etc.)
Marcusc0cb4c22011-01-02 11:18:14 +0100254 * - For non-alphanumeric characters, Unicode:ish names are used (e.g.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200255 * "COMMA", "LEFT_SQUARE_BRACKET", etc.). Note that some names do not
256 * correspond to the Unicode standard (usually for brevity)
257 * - Keys that lack a clear US mapping are named "WORLD_x"
Marcusc0cb4c22011-01-02 11:18:14 +0100258 * - For non-printable keys, custom names are used (e.g. "F4",
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200259 * "BACKSPACE", etc.)
260 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100261 * @ingroup input
262 * @{
263 */
264
Marcusc0cb4c22011-01-02 11:18:14 +0100265/* Printable keys */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100266#define GLFW_KEY_SPACE 32
267#define GLFW_KEY_APOSTROPHE 39 /* ' */
268#define GLFW_KEY_COMMA 44 /* , */
269#define GLFW_KEY_MINUS 45 /* - */
270#define GLFW_KEY_PERIOD 46 /* . */
271#define GLFW_KEY_SLASH 47 /* / */
272#define GLFW_KEY_0 48
273#define GLFW_KEY_1 49
274#define GLFW_KEY_2 50
275#define GLFW_KEY_3 51
276#define GLFW_KEY_4 52
277#define GLFW_KEY_5 53
278#define GLFW_KEY_6 54
279#define GLFW_KEY_7 55
280#define GLFW_KEY_8 56
281#define GLFW_KEY_9 57
282#define GLFW_KEY_SEMICOLON 59 /* ; */
283#define GLFW_KEY_EQUAL 61 /* = */
284#define GLFW_KEY_A 65
285#define GLFW_KEY_B 66
286#define GLFW_KEY_C 67
287#define GLFW_KEY_D 68
288#define GLFW_KEY_E 69
289#define GLFW_KEY_F 70
290#define GLFW_KEY_G 71
291#define GLFW_KEY_H 72
292#define GLFW_KEY_I 73
293#define GLFW_KEY_J 74
294#define GLFW_KEY_K 75
295#define GLFW_KEY_L 76
296#define GLFW_KEY_M 77
297#define GLFW_KEY_N 78
298#define GLFW_KEY_O 79
299#define GLFW_KEY_P 80
300#define GLFW_KEY_Q 81
301#define GLFW_KEY_R 82
302#define GLFW_KEY_S 83
303#define GLFW_KEY_T 84
304#define GLFW_KEY_U 85
305#define GLFW_KEY_V 86
306#define GLFW_KEY_W 87
307#define GLFW_KEY_X 88
308#define GLFW_KEY_Y 89
309#define GLFW_KEY_Z 90
310#define GLFW_KEY_LEFT_BRACKET 91 /* [ */
311#define GLFW_KEY_BACKSLASH 92 /* \ */
312#define GLFW_KEY_RIGHT_BRACKET 93 /* ] */
313#define GLFW_KEY_GRAVE_ACCENT 96 /* ` */
314#define GLFW_KEY_WORLD_1 161 /* non-US #1 */
315#define GLFW_KEY_WORLD_2 162 /* non-US #2 */
Marcusc0cb4c22011-01-02 11:18:14 +0100316
317/* Function keys */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100318#define GLFW_KEY_ESCAPE 256
319#define GLFW_KEY_ENTER 257
320#define GLFW_KEY_TAB 258
321#define GLFW_KEY_BACKSPACE 259
322#define GLFW_KEY_INSERT 260
323#define GLFW_KEY_DELETE 261
324#define GLFW_KEY_RIGHT 262
325#define GLFW_KEY_LEFT 263
326#define GLFW_KEY_DOWN 264
327#define GLFW_KEY_UP 265
328#define GLFW_KEY_PAGE_UP 266
329#define GLFW_KEY_PAGE_DOWN 267
330#define GLFW_KEY_HOME 268
331#define GLFW_KEY_END 269
332#define GLFW_KEY_CAPS_LOCK 280
333#define GLFW_KEY_SCROLL_LOCK 281
334#define GLFW_KEY_NUM_LOCK 282
335#define GLFW_KEY_PRINT_SCREEN 283
336#define GLFW_KEY_PAUSE 284
337#define GLFW_KEY_F1 290
338#define GLFW_KEY_F2 291
339#define GLFW_KEY_F3 292
340#define GLFW_KEY_F4 293
341#define GLFW_KEY_F5 294
342#define GLFW_KEY_F6 295
343#define GLFW_KEY_F7 296
344#define GLFW_KEY_F8 297
345#define GLFW_KEY_F9 298
346#define GLFW_KEY_F10 299
347#define GLFW_KEY_F11 300
348#define GLFW_KEY_F12 301
349#define GLFW_KEY_F13 302
350#define GLFW_KEY_F14 303
351#define GLFW_KEY_F15 304
352#define GLFW_KEY_F16 305
353#define GLFW_KEY_F17 306
354#define GLFW_KEY_F18 307
355#define GLFW_KEY_F19 308
356#define GLFW_KEY_F20 309
357#define GLFW_KEY_F21 310
358#define GLFW_KEY_F22 311
359#define GLFW_KEY_F23 312
360#define GLFW_KEY_F24 313
361#define GLFW_KEY_F25 314
362#define GLFW_KEY_KP_0 320
363#define GLFW_KEY_KP_1 321
364#define GLFW_KEY_KP_2 322
365#define GLFW_KEY_KP_3 323
366#define GLFW_KEY_KP_4 324
367#define GLFW_KEY_KP_5 325
368#define GLFW_KEY_KP_6 326
369#define GLFW_KEY_KP_7 327
370#define GLFW_KEY_KP_8 328
371#define GLFW_KEY_KP_9 329
372#define GLFW_KEY_KP_DECIMAL 330
373#define GLFW_KEY_KP_DIVIDE 331
374#define GLFW_KEY_KP_MULTIPLY 332
375#define GLFW_KEY_KP_SUBTRACT 333
376#define GLFW_KEY_KP_ADD 334
377#define GLFW_KEY_KP_ENTER 335
378#define GLFW_KEY_KP_EQUAL 336
379#define GLFW_KEY_LEFT_SHIFT 340
380#define GLFW_KEY_LEFT_CONTROL 341
381#define GLFW_KEY_LEFT_ALT 342
382#define GLFW_KEY_LEFT_SUPER 343
383#define GLFW_KEY_RIGHT_SHIFT 344
384#define GLFW_KEY_RIGHT_CONTROL 345
385#define GLFW_KEY_RIGHT_ALT 346
386#define GLFW_KEY_RIGHT_SUPER 347
387#define GLFW_KEY_MENU 348
388#define GLFW_KEY_LAST GLFW_KEY_MENU
Marcusc0cb4c22011-01-02 11:18:14 +0100389
390/* GLFW 2.x key name aliases (deprecated) */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100391#define GLFW_KEY_ESC GLFW_KEY_ESCAPE
392#define GLFW_KEY_DEL GLFW_KEY_DELETE
393#define GLFW_KEY_PAGEUP GLFW_KEY_PAGE_UP
394#define GLFW_KEY_PAGEDOWN GLFW_KEY_PAGE_DOWN
395#define GLFW_KEY_KP_NUM_LOCK GLFW_KEY_NUM_LOCK
396#define GLFW_KEY_LCTRL GLFW_KEY_LEFT_CONTROL
397#define GLFW_KEY_LSHIFT GLFW_KEY_LEFT_SHIFT
398#define GLFW_KEY_LALT GLFW_KEY_LEFT_ALT
399#define GLFW_KEY_LSUPER GLFW_KEY_LEFT_SUPER
400#define GLFW_KEY_RCTRL GLFW_KEY_RIGHT_CONTROL
401#define GLFW_KEY_RSHIFT GLFW_KEY_RIGHT_SHIFT
402#define GLFW_KEY_RALT GLFW_KEY_RIGHT_ALT
403#define GLFW_KEY_RSUPER GLFW_KEY_RIGHT_SUPER
Camilla Berglund3249f812010-09-07 17:34:51 +0200404
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100405/*! @} */
406
407/*! @defgroup buttons Mouse buttons
408 * @ingroup input
409 * @{ */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100410#define GLFW_MOUSE_BUTTON_1 0
411#define GLFW_MOUSE_BUTTON_2 1
412#define GLFW_MOUSE_BUTTON_3 2
413#define GLFW_MOUSE_BUTTON_4 3
414#define GLFW_MOUSE_BUTTON_5 4
415#define GLFW_MOUSE_BUTTON_6 5
416#define GLFW_MOUSE_BUTTON_7 6
417#define GLFW_MOUSE_BUTTON_8 7
418#define GLFW_MOUSE_BUTTON_LAST GLFW_MOUSE_BUTTON_8
419#define GLFW_MOUSE_BUTTON_LEFT GLFW_MOUSE_BUTTON_1
420#define GLFW_MOUSE_BUTTON_RIGHT GLFW_MOUSE_BUTTON_2
421#define GLFW_MOUSE_BUTTON_MIDDLE GLFW_MOUSE_BUTTON_3
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100422/*! @} */
Camilla Berglund3249f812010-09-07 17:34:51 +0200423
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100424/*! @defgroup joysticks Joysticks
425 * @ingroup input
426 * @{ */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100427#define GLFW_JOYSTICK_1 0
428#define GLFW_JOYSTICK_2 1
429#define GLFW_JOYSTICK_3 2
430#define GLFW_JOYSTICK_4 3
431#define GLFW_JOYSTICK_5 4
432#define GLFW_JOYSTICK_6 5
433#define GLFW_JOYSTICK_7 6
434#define GLFW_JOYSTICK_8 7
435#define GLFW_JOYSTICK_9 8
436#define GLFW_JOYSTICK_10 9
437#define GLFW_JOYSTICK_11 10
438#define GLFW_JOYSTICK_12 11
439#define GLFW_JOYSTICK_13 12
440#define GLFW_JOYSTICK_14 13
441#define GLFW_JOYSTICK_15 14
442#define GLFW_JOYSTICK_16 15
443#define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100444/*! @} */
Camilla Berglund3249f812010-09-07 17:34:51 +0200445
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100446/*! @defgroup errors Error codes
447 * @ingroup error
448 * @{ */
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100449/*! @brief GLFW has not been initialized.
450 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100451#define GLFW_NOT_INITIALIZED 0x00070001
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100452/*! @brief No context is current for this thread.
453 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100454#define GLFW_NO_CURRENT_CONTEXT 0x00070002
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100455/*! @brief One of the enum parameters for the function was given an invalid
456 * enum.
457 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100458#define GLFW_INVALID_ENUM 0x00070003
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100459/*! @brief One of the parameters for the function was given an invalid value.
460 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100461#define GLFW_INVALID_VALUE 0x00070004
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100462/*! @brief A memory allocation failed.
463 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100464#define GLFW_OUT_OF_MEMORY 0x00070005
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100465/*! @brief GLFW could not find support for the requested client API on the
466 * system.
467 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100468#define GLFW_API_UNAVAILABLE 0x00070006
Camilla Berglund3f5843f2012-12-13 02:22:39 +0100469/*! @brief The requested client API version is not available.
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100470 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100471#define GLFW_VERSION_UNAVAILABLE 0x00070007
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100472/*! @brief A platform-specific error occurred that does not match any of the
473 * more specific categories.
474 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100475#define GLFW_PLATFORM_ERROR 0x00070008
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100476/*! @brief The clipboard did not contain data in the requested format.
477 */
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100478#define GLFW_FORMAT_UNAVAILABLE 0x00070009
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100479/*! @} */
Camilla Berglund3249f812010-09-07 17:34:51 +0200480
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100481#define GLFW_FOCUSED 0x00020001
482#define GLFW_ICONIFIED 0x00020002
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100483#define GLFW_RESIZABLE 0x00022007
484#define GLFW_VISIBLE 0x00022008
Camilla Berglund49db3b22013-04-08 15:16:32 +0200485#define GLFW_DECORATED 0x00022009
Camilla Berglund2c091572010-09-09 21:09:11 +0200486
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100487#define GLFW_CONTEXT_REVISION 0x00020004
488#define GLFW_RED_BITS 0x00021000
489#define GLFW_GREEN_BITS 0x00021001
490#define GLFW_BLUE_BITS 0x00021002
491#define GLFW_ALPHA_BITS 0x00021003
492#define GLFW_DEPTH_BITS 0x00021004
493#define GLFW_STENCIL_BITS 0x00021005
494#define GLFW_ACCUM_RED_BITS 0x00021006
495#define GLFW_ACCUM_GREEN_BITS 0x00021007
496#define GLFW_ACCUM_BLUE_BITS 0x00021008
497#define GLFW_ACCUM_ALPHA_BITS 0x00021009
498#define GLFW_AUX_BUFFERS 0x0002100A
499#define GLFW_STEREO 0x0002100B
500#define GLFW_SAMPLES 0x0002100C
501#define GLFW_SRGB_CAPABLE 0x0002100D
Camilla Berglunddeb0b3d2012-12-02 21:00:15 +0100502
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100503#define GLFW_CLIENT_API 0x00022000
504#define GLFW_CONTEXT_VERSION_MAJOR 0x00022001
505#define GLFW_CONTEXT_VERSION_MINOR 0x00022002
506#define GLFW_CONTEXT_ROBUSTNESS 0x00022003
507#define GLFW_OPENGL_FORWARD_COMPAT 0x00022004
508#define GLFW_OPENGL_DEBUG_CONTEXT 0x00022005
509#define GLFW_OPENGL_PROFILE 0x00022006
510
511#define GLFW_OPENGL_API 0x00000001
512#define GLFW_OPENGL_ES_API 0x00000002
513
514#define GLFW_NO_ROBUSTNESS 0x00000000
515#define GLFW_NO_RESET_NOTIFICATION 0x00000001
516#define GLFW_LOSE_CONTEXT_ON_RESET 0x00000002
517
518#define GLFW_OPENGL_NO_PROFILE 0x00000000
519#define GLFW_OPENGL_CORE_PROFILE 0x00000001
520#define GLFW_OPENGL_COMPAT_PROFILE 0x00000002
521
522#define GLFW_CURSOR_MODE 0x00030001
523#define GLFW_STICKY_KEYS 0x00030002
524#define GLFW_STICKY_MOUSE_BUTTONS 0x00030003
525
526#define GLFW_CURSOR_NORMAL 0x00040001
527#define GLFW_CURSOR_HIDDEN 0x00040002
528#define GLFW_CURSOR_CAPTURED 0x00040003
529
530#define GLFW_PRESENT 0x00050001
531#define GLFW_AXES 0x00050002
532#define GLFW_BUTTONS 0x00050003
533
534#define GLFW_GAMMA_RAMP_SIZE 256
535
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100536#define GLFW_CONNECTED 0x00061000
537#define GLFW_DISCONNECTED 0x00061001
538
Camilla Berglund97387282011-10-06 23:28:56 +0200539
Camilla Berglund3249f812010-09-07 17:34:51 +0200540/*************************************************************************
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100541 * GLFW API types
Camilla Berglund3249f812010-09-07 17:34:51 +0200542 *************************************************************************/
543
Camilla Berglund3f5843f2012-12-13 02:22:39 +0100544/*! @brief Client API function pointer type.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200545 *
546 * Generic function pointer used for returning client API function pointers
547 * without forcing a cast from a regular pointer.
548 *
Camilla Berglund3f5843f2012-12-13 02:22:39 +0100549 * @ingroup context
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100550 */
Camilla Berglundbf42c3c2012-06-05 00:16:40 +0200551typedef void (*GLFWglproc)(void);
552
Camilla Berglunddba2d802013-01-17 23:06:56 +0100553/*! @brief Opaque monitor object.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200554 *
555 * Opaque monitor object.
556 *
Camilla Berglund41bc0d12012-11-27 16:55:04 +0100557 * @ingroup monitor
558 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100559typedef struct GLFWmonitor GLFWmonitor;
Camilla Berglunde0ce9202012-08-29 20:39:05 +0200560
Camilla Berglunddba2d802013-01-17 23:06:56 +0100561/*! @brief Opaque window object.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200562 *
563 * Opaque window object.
564 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100565 * @ingroup window
566 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100567typedef struct GLFWwindow GLFWwindow;
Camilla Berglund135194a2010-09-09 18:15:32 +0200568
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100569/*! @brief The function signature for error callbacks.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200570 *
571 * This is the function signature for error callback functions.
572 *
Camilla Berglund71d2b572013-03-12 15:33:05 +0100573 * @param[in] error An [error code](@ref errors).
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100574 * @param[in] description A UTF-8 encoded string describing the error.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100575 *
576 * @sa glfwSetErrorCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100577 *
578 * @ingroup error
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100579 */
Camilla Berglund897558f2011-03-07 13:34:58 +0100580typedef void (* GLFWerrorfun)(int,const char*);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100581
Camilla Berglund1a3d47d2012-11-30 13:56:42 +0100582/*! @brief The function signature for window position callbacks.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200583 *
584 * This is the function signature for window position callback functions.
585 *
Camilla Berglund1a3d47d2012-11-30 13:56:42 +0100586 * @param[in] window The window that the user moved.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200587 * @param[in] xpos The new x-coordinate, in screen coordinates, of the
588 * upper-left corner of the client area of the window.
589 * @param[in] ypos The new y-coordinate, in screen coordinates, of the
590 * upper-left corner of the client area of the window.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100591 *
592 * @sa glfwSetWindowPosCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100593 *
594 * @ingroup window
Camilla Berglund1a3d47d2012-11-30 13:56:42 +0100595 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100596typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int);
Camilla Berglund1a3d47d2012-11-30 13:56:42 +0100597
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100598/*! @brief The function signature for window resize callbacks.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200599 *
600 * This is the function signature for window size callback functions.
601 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100602 * @param[in] window The window that the user resized.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200603 * @param[in] width The new width, in screen coordinates, of the window.
604 * @param[in] height The new height, in screen coordinates, of the window.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100605 *
606 * @sa glfwSetWindowSizeCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100607 *
608 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100609 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100610typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100611
612/*! @brief The function signature for window close callbacks.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200613 *
614 * This is the function signature for window close callback functions.
615 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100616 * @param[in] window The window that the user attempted to close.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100617 *
618 * @sa glfwSetWindowCloseCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100619 *
620 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100621 */
Camilla Berglund64afb192013-03-06 23:29:37 +0100622typedef void (* GLFWwindowclosefun)(GLFWwindow*);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100623
624/*! @brief The function signature for window content refresh callbacks.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200625 *
626 * This is the function signature for window refresh callback functions.
627 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100628 * @param[in] window The window whose content needs to be refreshed.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100629 *
630 * @sa glfwSetWindowRefreshCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100631 *
632 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100633 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100634typedef void (* GLFWwindowrefreshfun)(GLFWwindow*);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100635
636/*! @brief The function signature for window focus/defocus callbacks.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200637 *
638 * This is the function signature for window focus callback functions.
639 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100640 * @param[in] window The window that was focused or defocused.
Camilla Berglund71d2b572013-03-12 15:33:05 +0100641 * @param[in] focused `GL_TRUE` if the window was focused, or `GL_FALSE` if
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100642 * it was defocused.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100643 *
644 * @sa glfwSetWindowFocusCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100645 *
646 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100647 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100648typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100649
Camilla Berglund06e7a962012-11-22 19:14:27 +0100650/*! @brief The function signature for window iconify/restore callbacks.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200651 *
652 * This is the function signature for window iconify/restore callback
653 * functions.
654 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100655 * @param[in] window The window that was iconified or restored.
Camilla Berglund71d2b572013-03-12 15:33:05 +0100656 * @param[in] iconified `GL_TRUE` if the window was iconified, or `GL_FALSE`
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100657 * if it was restored.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100658 *
659 * @sa glfwSetWindowIconifyCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100660 *
661 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100662 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100663typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100664
665/*! @brief The function signature for mouse button callbacks.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200666 *
667 * This is the function signature for mouse button callback functions.
668 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100669 * @param[in] window The window that received the event.
Camilla Berglund71d2b572013-03-12 15:33:05 +0100670 * @param[in] button The [mouse button](@ref buttons) that was pressed or
671 * released.
672 * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100673 *
674 * @sa glfwSetMouseButtonCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100675 *
676 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100677 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100678typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100679
680/*! @brief The function signature for cursor position callbacks.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200681 *
682 * This is the function signature for cursor position callback functions.
683 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100684 * @param[in] window The window that received the event.
Camilla Berglund52f718d2013-02-12 12:01:12 +0100685 * @param[in] xpos The new x-coordinate of the cursor.
686 * @param[in] ypos The new y-coordinate of the cursor.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100687 *
688 * @sa glfwSetCursorPosCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100689 *
690 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100691 */
Camilla Berglund129e94d2013-04-04 16:16:21 +0200692typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100693
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200694/*! @brief The function signature for cursor enter/leave callbacks.
695 *
696 * This is the function signature for cursor enter/leave callback functions.
697 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100698 * @param[in] window The window that received the event.
Camilla Berglund71d2b572013-03-12 15:33:05 +0100699 * @param[in] entered `GL_TRUE` if the cursor entered the window's client
700 * area, or `GL_FALSE` if it left it.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100701 *
702 * @sa glfwSetCursorEnterCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100703 *
704 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100705 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100706typedef void (* GLFWcursorenterfun)(GLFWwindow*,int);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100707
708/*! @brief The function signature for scroll callbacks.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200709 *
710 * This is the function signature for scroll callback functions.
711 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100712 * @param[in] window The window that received the event.
Camilla Berglund52f718d2013-02-12 12:01:12 +0100713 * @param[in] xpos The scroll offset along the x-axis.
714 * @param[in] ypos The scroll offset along the y-axis.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100715 *
716 * @sa glfwSetScrollCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100717 *
718 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100719 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100720typedef void (* GLFWscrollfun)(GLFWwindow*,double,double);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100721
722/*! @brief The function signature for keyboard key callbacks.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200723 *
724 * This is the function signature for keyboard key callback functions.
725 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100726 * @param[in] window The window that received the event.
Camilla Berglund71d2b572013-03-12 15:33:05 +0100727 * @param[in] key The [keyboard key](@ref keys) that was pressed or released.
Camilla Berglund253e0d62013-01-12 17:06:35 +0100728 * @param[in] action @ref GLFW_PRESS, @ref GLFW_RELEASE or @ref GLFW_REPEAT.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100729 *
730 * @sa glfwSetKeyCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100731 *
732 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100733 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100734typedef void (* GLFWkeyfun)(GLFWwindow*,int,int);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100735
736/*! @brief The function signature for Unicode character callbacks.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200737 *
738 * This is the function signature for Unicode character callback functions.
739 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100740 * @param[in] window The window that received the event.
741 * @param[in] character The Unicode code point of the character.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100742 *
743 * @sa glfwSetCharCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100744 *
745 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100746 */
Camilla Berglund182e0af2013-02-25 17:02:28 +0100747typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int);
Camilla Berglund5f68e122012-11-27 17:07:28 +0100748
749/*! @brief The function signature for monitor configuration callbacks.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200750 *
751 * This is the function signature for monitor configuration callback functions.
752 *
Camilla Berglund5f68e122012-11-27 17:07:28 +0100753 * @param[in] monitor The monitor that was connected or disconnected.
Camilla Berglund71d2b572013-03-12 15:33:05 +0100754 * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100755 *
756 * @sa glfwSetMonitorCallback
Camilla Berglunde248fb62013-03-29 14:06:23 +0100757 *
758 * @ingroup monitor
Camilla Berglund5f68e122012-11-27 17:07:28 +0100759 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100760typedef void (* GLFWmonitorfun)(GLFWmonitor*,int);
Camilla Berglund897558f2011-03-07 13:34:58 +0100761
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200762/*! @brief Video mode type.
763 *
764 * This describes a single video mode.
765 *
766 * @ingroup monitor
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100767 */
Camilla Berglund5fd3fc72010-09-09 19:44:43 +0200768typedef struct
769{
770 int width;
771 int height;
772 int redBits;
Camilla Berglund5fd3fc72010-09-09 19:44:43 +0200773 int greenBits;
Camilla Berglund2e8446f2013-04-11 01:31:00 +0200774 int blueBits;
Camilla Berglund3249f812010-09-07 17:34:51 +0200775} GLFWvidmode;
776
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100777/*! @brief Gamma ramp.
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200778 *
779 * This describes the gamma ramp for a monitor.
780 *
781 * @sa glfwGetGammaRamp glfwSetGammaRamp
782 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100783 * @ingroup gamma
784 */
Camilla Berglund2630d492010-10-13 04:04:43 +0200785typedef struct
786{
787 unsigned short red[GLFW_GAMMA_RAMP_SIZE];
788 unsigned short green[GLFW_GAMMA_RAMP_SIZE];
789 unsigned short blue[GLFW_GAMMA_RAMP_SIZE];
790} GLFWgammaramp;
791
Camilla Berglund3249f812010-09-07 17:34:51 +0200792
793/*************************************************************************
Camilla Berglund2fca5c52013-01-17 21:51:39 +0100794 * GLFW API functions
Camilla Berglund3249f812010-09-07 17:34:51 +0200795 *************************************************************************/
796
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100797/*! @brief Initializes the GLFW library.
798 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100799 * This function initializes the GLFW library. Before most GLFW functions can
800 * be used, GLFW must be initialized, and before a program terminates GLFW
801 * should be terminated in order to free any resources allocated during or
802 * after initialization.
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100803 *
Camilla Berglund23f61762013-03-12 19:53:29 +0100804 * If this function fails, it calls @ref glfwTerminate before returning. If it
805 * succeeds, you should call @ref glfwTerminate before the program exits.
806 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100807 * Additional calls to this function after successful initialization but before
808 * termination will succeed but will do nothing.
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100809 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100810 * @return `GL_TRUE` if successful, or `GL_FALSE` if an error occurred.
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100811 *
Camilla Berglund401033c2013-03-12 19:17:07 +0100812 * @par New in GLFW 3
813 * This function no longer registers @ref glfwTerminate with `atexit`.
814 *
Camilla Berglund9ad1d972012-11-22 19:08:30 +0100815 * @note This function may only be called from the main thread.
816 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100817 * @note This function may take several seconds to complete on some systems,
818 * while on other systems it may take only a fraction of a second to complete.
819 *
Camilla Berglund71d2b572013-03-12 15:33:05 +0100820 * @note **Mac OS X:** This function will change the current directory of the
821 * application to the `Contents/Resources` subdirectory of the application's
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100822 * bundle, if present.
823 *
824 * @sa glfwTerminate
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100825 *
826 * @ingroup init
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100827 */
828GLFWAPI int glfwInit(void);
829
830/*! @brief Terminates the GLFW library.
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100831 *
Camilla Berglund23f61762013-03-12 19:53:29 +0100832 * This function destroys all remaining windows, frees any allocated resources
833 * and sets the library to an uninitialized state. Once this is called, you
834 * must again call @ref glfwInit successfully before you will be able to use
835 * most GLFW functions.
836 *
837 * If GLFW has been successfully initialized, this function should be called
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100838 * before the program exits. If initialization fails, there is no need to call
839 * this function, as it is called by @ref glfwInit before it returns failure.
Camilla Berglund23f61762013-03-12 19:53:29 +0100840 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100841 * @remarks This function may be called before @ref glfwInit.
842 *
Camilla Berglund9ad1d972012-11-22 19:08:30 +0100843 * @note This function may only be called from the main thread.
844 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100845 * @warning No window's context may be current on another thread when this
846 * function is called.
847 *
848 * @sa glfwInit
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100849 *
850 * @ingroup init
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100851 */
Camilla Berglund9a716692010-09-08 16:40:43 +0200852GLFWAPI void glfwTerminate(void);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100853
854/*! @brief Retrieves the version of the GLFW library.
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100855 *
856 * This function retrieves the major, minor and revision numbers of the GLFW
857 * library. It is intended for when you are using GLFW as a shared library and
858 * want to ensure that you are using the minimum required version.
859 *
Camilla Berglund71d2b572013-03-12 15:33:05 +0100860 * @param[out] major Where to store the major version number, or `NULL`.
861 * @param[out] minor Where to store the minor version number, or `NULL`.
862 * @param[out] rev Where to store the revision number, or `NULL`.
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100863 *
864 * @remarks This function may be called before @ref glfwInit.
865 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100866 * @remarks This function may be called from any thread.
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100867 *
868 * @sa glfwGetVersionString
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100869 *
870 * @ingroup init
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100871 */
Camilla Berglund9a716692010-09-08 16:40:43 +0200872GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100873
Camilla Berglund6f8084f2013-02-14 13:14:17 +0100874/*! @brief Returns a string describing the compile-time configuration.
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100875 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100876 * This function returns a static string generated at compile-time according to
877 * which configuration macros were defined. This is intended for use when
878 * submitting bug reports, to allow developers to see which code paths are
879 * enabled in a binary.
880 *
Camilla Berglund6f8084f2013-02-14 13:14:17 +0100881 * The format of the string is as follows:
Camilla Berglund13ccf7d2013-04-07 13:46:38 +0200882 * - The version of GLFW
883 * - The name of the window system API
884 * - The name of the context creation API
885 * - Any additional options or APIs
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100886 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100887 * For example, when compiling GLFW 3.0 with MinGW using the Win32 and WGL
Camilla Berglund8282a8f2013-04-10 23:01:12 +0200888 * back ends, the version string may look something like this:
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100889 *
890 * 3.0.0 Win32 WGL MinGW
891 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100892 * @return The GLFW version string.
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100893 *
894 * @remarks This function may be called before @ref glfwInit.
895 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100896 * @remarks This function may be called from any thread.
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100897 *
898 * @sa glfwGetVersion
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100899 *
900 * @ingroup init
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100901 */
Camilla Berglundd6fe4472010-09-13 18:05:59 +0200902GLFWAPI const char* glfwGetVersionString(void);
Camilla Berglund3249f812010-09-07 17:34:51 +0200903
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100904/*! @brief Sets the error callback.
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100905 *
906 * This function sets the error callback, which is called with an error code
907 * and a human-readable description each time a GLFW error occurs.
908 *
Camilla Berglund71d2b572013-03-12 15:33:05 +0100909 * @param[in] cbfun The new callback, or `NULL` to remove the currently set
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100910 * callback.
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100911 *
912 * @remarks This function may be called before @ref glfwInit.
913 *
Camilla Berglund9bfb9252013-01-07 17:22:02 +0100914 * @note The error callback is called by the thread where the error was
915 * generated. If you are using GLFW from multiple threads, your error callback
916 * needs to be written accordingly.
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100917 *
918 * @note Because the description string provided to the callback may have been
919 * generated specifically for that error, it is not guaranteed to be valid
920 * after the callback has returned. If you wish to use it after that, you need
921 * to make your own copy of it before returning.
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100922 *
923 * @ingroup error
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100924 */
Camilla Berglundf1e7d7c2010-11-23 17:45:23 +0100925GLFWAPI void glfwSetErrorCallback(GLFWerrorfun cbfun);
Camilla Berglundf5d74c42010-09-09 21:06:59 +0200926
Camilla Berglund5f68e122012-11-27 17:07:28 +0100927/*! @brief Returns the currently connected monitors.
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100928 *
929 * This function returns an array of handles for all currently connected
930 * monitors.
931 *
Camilla Berglund5f68e122012-11-27 17:07:28 +0100932 * @param[out] count The size of the returned array.
Camilla Berglund71d2b572013-03-12 15:33:05 +0100933 * @return An array of monitor handles, or `NULL` if an error occurred.
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100934 *
935 * @note The returned array is valid only until the monitor configuration
936 * changes. See @ref glfwSetMonitorCallback to receive notifications of
937 * configuration changes.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100938 *
939 * @sa glfwGetPrimaryMonitor
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100940 *
941 * @ingroup monitor
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100942 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100943GLFWAPI GLFWmonitor** glfwGetMonitors(int* count);
Camilla Berglundbce2cd62012-11-22 16:38:24 +0100944
Camilla Berglund5f68e122012-11-27 17:07:28 +0100945/*! @brief Returns the primary monitor.
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100946 *
947 * This function returns the primary monitor. This is usually the monitor
948 * where elements like the Windows task bar or the OS X menu bar is located.
949 *
Camilla Berglund71d2b572013-03-12 15:33:05 +0100950 * @return The primary monitor, or `NULL` if an error occurred.
Camilla Berglunddba2d802013-01-17 23:06:56 +0100951 *
952 * @sa glfwGetMonitors
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100953 *
954 * @ingroup monitor
Camilla Berglund41bc0d12012-11-27 16:55:04 +0100955 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100956GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void);
Camilla Berglund41bc0d12012-11-27 16:55:04 +0100957
Camilla Berglundee5f30e2013-01-24 19:10:17 +0100958/*! @brief Returns the position of the monitor's viewport on the virtual screen.
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100959 *
960 * This function returns the position, in screen coordinates, of the upper-left
961 * corner of the specified monitor.
962 *
Camilla Berglunddba2d802013-01-17 23:06:56 +0100963 * @param[in] monitor The monitor to query.
Camilla Berglundee5f30e2013-01-24 19:10:17 +0100964 * @param[out] xpos The monitor x-coordinate.
965 * @param[out] ypos The monitor y-coordinate.
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100966 *
Camilla Berglund5f68e122012-11-27 17:07:28 +0100967 * @ingroup monitor
Camilla Berglund41bc0d12012-11-27 16:55:04 +0100968 */
Camilla Berglundee5f30e2013-01-24 19:10:17 +0100969GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);
970
971/*! @brief Returns the physical size of the monitor.
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100972 *
973 * This function returns the size, in millimetres, of the display area of the
974 * specified monitor.
975 *
Camilla Berglundee5f30e2013-01-24 19:10:17 +0100976 * @param[in] monitor The monitor to query.
977 * @param[out] width The width, in mm, of the monitor's display
978 * @param[out] height The height, in mm, of the monitor's display.
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100979 *
980 * @note Some operating systems do not provide accurate information, either
981 * because the monitor's EDID data is incorrect, or because the driver does not
982 * report it accurately.
983 *
Camilla Berglundee5f30e2013-01-24 19:10:17 +0100984 * @ingroup monitor
985 */
986GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* width, int* height);
Camilla Berglund41bc0d12012-11-27 16:55:04 +0100987
Camilla Berglund5f68e122012-11-27 17:07:28 +0100988/*! @brief Returns the name of the specified monitor.
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100989 *
990 * This function returns a human-readable name, encoded as UTF-8, of the
991 * specified monitor.
992 *
Camilla Berglund5f68e122012-11-27 17:07:28 +0100993 * @param[in] monitor The monitor to query.
Camilla Berglund71d2b572013-03-12 15:33:05 +0100994 * @return The UTF-8 encoded name of the monitor, or `NULL` if an error
Camilla Berglund5d6256c2013-02-25 17:53:02 +0100995 * occurred.
Camilla Berglund2d5fb772013-03-18 19:11:02 +0100996 *
Camilla Berglund5f68e122012-11-27 17:07:28 +0100997 * @ingroup monitor
Camilla Berglund41bc0d12012-11-27 16:55:04 +0100998 */
Camilla Berglund9af960e2013-01-05 21:13:28 +0100999GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor);
Camilla Berglund41bc0d12012-11-27 16:55:04 +01001000
Camilla Berglund5f68e122012-11-27 17:07:28 +01001001/*! @brief Sets the monitor configuration callback.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001002 *
1003 * This function sets the monitor configuration callback, or removes the
1004 * currently set callback. This is called when a monitor is connected to or
1005 * disconnected from the system.
1006 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001007 * @param[in] cbfun The new callback, or `NULL` to remove the currently set
Camilla Berglunddba2d802013-01-17 23:06:56 +01001008 * callback.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001009 *
Camilla Berglund5f68e122012-11-27 17:07:28 +01001010 * @ingroup monitor
Camilla Berglund41bc0d12012-11-27 16:55:04 +01001011 */
Camilla Berglunde0ce9202012-08-29 20:39:05 +02001012GLFWAPI void glfwSetMonitorCallback(GLFWmonitorfun cbfun);
Marcel Metzbeacbb32011-05-07 10:53:50 +02001013
Camilla Berglund41bc0d12012-11-27 16:55:04 +01001014/*! @brief Returns the available video modes for the specified monitor.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001015 *
1016 * This function returns an array of all video modes supported by the specified
1017 * monitor.
1018 *
Camilla Berglund5f68e122012-11-27 17:07:28 +01001019 * @param[in] monitor The monitor to query.
1020 * @param[out] count The number of video modes in the returned array.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001021 * @return An array of video modes, or `NULL` if an error occurred.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001022 *
1023 * @note The returned array is valid only until this function is called again
1024 * for this monitor.
Camilla Berglunddba2d802013-01-17 23:06:56 +01001025 *
1026 * @sa glfwGetVideoMode
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001027 *
1028 * @ingroup monitor
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001029 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001030GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count);
Camilla Berglund41bc0d12012-11-27 16:55:04 +01001031
Camilla Berglund5f68e122012-11-27 17:07:28 +01001032/*! @brief Returns the current mode of the specified monitor.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001033 *
1034 * This function returns the current video mode of the specified monitor.
1035 *
Camilla Berglund5f68e122012-11-27 17:07:28 +01001036 * @param[in] monitor The monitor to query.
Camilla Berglund5d6256c2013-02-25 17:53:02 +01001037 * @return The current mode of the monitor, or all zeroes if an error occurred.
Camilla Berglunddba2d802013-01-17 23:06:56 +01001038 *
1039 * @sa glfwGetVideoModes
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001040 *
1041 * @ingroup monitor
Camilla Berglund41bc0d12012-11-27 16:55:04 +01001042 */
Camilla Berglund316ee1d2013-01-05 22:07:06 +01001043GLFWAPI GLFWvidmode glfwGetVideoMode(GLFWmonitor* monitor);
Camilla Berglund3249f812010-09-07 17:34:51 +02001044
Camilla Berglund92a71e02013-02-12 13:50:41 +01001045/*! @brief Generates a gamma ramp and sets it for the specified monitor.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001046 *
1047 * This function generates a gamma ramp from the specified exponent and then
1048 * calls @ref glfwSetGamma with it.
1049 *
Camilla Berglund92a71e02013-02-12 13:50:41 +01001050 * @param[in] monitor The monitor whose gamma ramp to set.
Camilla Berglunda3ff29a2012-12-02 15:47:10 +01001051 * @param[in] gamma The desired exponent.
Camilla Berglunddba2d802013-01-17 23:06:56 +01001052 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001053 * @ingroup gamma
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001054 */
Camilla Berglund92a71e02013-02-12 13:50:41 +01001055GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001056
Camilla Berglund92a71e02013-02-12 13:50:41 +01001057/*! @brief Retrieves the current gamma ramp for the specified monitor.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001058 *
1059 * This function retrieves the current gamma ramp of the specified monitor.
1060 *
Camilla Berglund92a71e02013-02-12 13:50:41 +01001061 * @param[in] monitor The monitor to query.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001062 * @param[out] ramp Where to store the gamma ramp.
Camilla Berglund8954af62013-02-20 19:44:52 +01001063 *
1064 * @bug This function does not yet support monitors whose original gamma ramp
1065 * has more or less than 256 entries.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001066 *
1067 * @ingroup gamma
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001068 */
Camilla Berglund92a71e02013-02-12 13:50:41 +01001069GLFWAPI void glfwGetGammaRamp(GLFWmonitor* monitor, GLFWgammaramp* ramp);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001070
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001071/*! @brief Sets the current gamma ramp for the specified monitor.
1072 *
1073 * This function sets the current gamma ramp for the specified monitor.
1074 *
Camilla Berglund92a71e02013-02-12 13:50:41 +01001075 * @param[in] monitor The monitor whose gamma ramp to set.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001076 * @param[in] ramp The gamma ramp to use.
Camilla Berglund8954af62013-02-20 19:44:52 +01001077 *
1078 * @bug This function does not yet support monitors whose original gamma ramp
1079 * has more or less than 256 entries.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001080 *
1081 * @ingroup gamma
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001082 */
Camilla Berglund92a71e02013-02-12 13:50:41 +01001083GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp);
Camilla Berglund2630d492010-10-13 04:04:43 +02001084
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001085/*! @brief Resets all window hints to their default values.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001086 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001087 * This function resets all window hints to their
Camilla Berglunde248fb62013-03-29 14:06:23 +01001088 * [default values](@ref window_hints_values).
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001089 *
Camilla Berglund9ad1d972012-11-22 19:08:30 +01001090 * @note This function may only be called from the main thread.
1091 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001092 * @sa glfwWindowHint
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001093 *
1094 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001095 */
Camilla Berglund5df4df62012-10-22 02:59:05 +02001096GLFWAPI void glfwDefaultWindowHints(void);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001097
1098/*! @brief Sets the specified window hint to the desired value.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001099 *
Camilla Berglunded9e4032012-12-23 15:59:09 +01001100 * This function sets hints for the next call to @ref glfwCreateWindow. The
1101 * hints, once set, retain their values until changed by a call to @ref
1102 * glfwWindowHint or @ref glfwDefaultWindowHints, or until the library is
1103 * terminated with @ref glfwTerminate.
1104 *
Camilla Berglunde248fb62013-03-29 14:06:23 +01001105 * @param[in] target The [window hint](@ref window_hints) to set.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001106 * @param[in] hint The new value of the window hint.
1107 *
Camilla Berglund401033c2013-03-12 19:17:07 +01001108 * @par New in GLFW 3
1109 * Hints are no longer reset to their default values on window creation. To
1110 * set default hint values, use @ref glfwDefaultWindowHints.
1111 *
Camilla Berglund9ad1d972012-11-22 19:08:30 +01001112 * @note This function may only be called from the main thread.
1113 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001114 * @sa glfwDefaultWindowHints
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001115 *
1116 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001117 */
Camilla Berglundaff30d02012-08-06 17:56:41 +02001118GLFWAPI void glfwWindowHint(int target, int hint);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001119
1120/*! @brief Creates a window and its associated context.
1121 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001122 * This function creates a window and its associated context. Most of the
1123 * options controlling how the window and its context should be created are
Camilla Berglundfa0cbd92013-04-11 01:07:07 +02001124 * specified through @ref glfwWindowHint.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001125 *
1126 * Successful creation does not change which context is current. Before you
1127 * can use the newly created context, you need to make it current using @ref
1128 * glfwMakeContextCurrent.
1129 *
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001130 * Note that the created window and context may differ from what you requested,
Camilla Berglundfa0cbd92013-04-11 01:07:07 +02001131 * as not all parameters and hints are
1132 * [hard constraints](@ref window_hints_hard). This includes the size of the
1133 * window, especially for full screen windows. To retrieve the actual
1134 * properties of the window and context, use queries like @ref
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001135 * glfwGetWindowParam and @ref glfwGetWindowSize.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001136 *
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001137 * @param[in] width The desired width, in screen coordinates, of the window.
1138 * This must be greater than zero.
1139 * @param[in] height The desired height, in screen coordinates, of the window.
1140 * This must be greater than zero.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001141 * @param[in] title The initial, UTF-8 encoded window title.
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001142 * @param[in] monitor The monitor to use for full screen mode, or `NULL` to use
Camilla Berglund41bc0d12012-11-27 16:55:04 +01001143 * windowed mode.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001144 * @param[in] share The window whose context to share resources with, or `NULL`
1145 * to not share resources.
1146 * @return The handle of the created window, or `NULL` if an error occurred.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001147 *
Camilla Berglund6f8084f2013-02-14 13:14:17 +01001148 * @remarks To create the window at a specific position, make it initially
Camilla Berglund71d2b572013-03-12 15:33:05 +01001149 * invisible using the `GLFW_VISIBLE` window hint, set its position and then
Camilla Berglund6f8084f2013-02-14 13:14:17 +01001150 * show it.
1151 *
Camilla Berglund159f9b92013-04-10 01:57:43 +02001152 * @remarks If a fullscreen window is active, the screensaver is prohibited
1153 * from starting.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001154 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001155 * @remarks **Windows:** If the executable has an icon resource named
1156 * `GLFW_ICON,` it will be set as the icon for the window. If no such icon is
1157 * present, the `IDI_WINLOGO` icon will be used instead.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001158 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001159 * @remarks **Mac OS X:** The GLFW window has no icon, as it is not a document
1160 * window, but the dock icon will be the same as the application bundle's icon.
1161 * Also, the first time a window is opened the menu bar is populated with
1162 * common commands like Hide, Quit and About. The (minimal) about dialog uses
1163 * information from the application's bundle. For more information on bundles,
1164 * see the Bundle Programming Guide provided by Apple.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001165 *
Camilla Berglund9ad1d972012-11-22 19:08:30 +01001166 * @note This function may only be called from the main thread.
1167 *
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001168 * @bug **Mac OS X:** The primary monitor is always used for full screen
Camilla Berglundbb10cae2013-03-12 19:39:25 +01001169 * windows, regardless of which monitor was specified.
1170 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001171 * @sa glfwDestroyWindow
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001172 *
1173 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001174 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001175GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001176
1177/*! @brief Destroys the specified window and its context.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001178 *
1179 * This function destroys the specified window and its context. On calling
1180 * this function, no further callbacks will be called for that window.
1181 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001182 * @param[in] window The window to destroy.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001183 *
Camilla Berglund9ad1d972012-11-22 19:08:30 +01001184 * @note This function may only be called from the main thread.
1185 *
Camilla Berglundb48128f2013-02-14 18:49:03 +01001186 * @note This function may not be called from a callback.
1187 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001188 * @note If the window's context is current on the main thread, it is
1189 * detached before being destroyed.
1190 *
1191 * @warning The window's context must not be current on any other thread.
1192 *
1193 * @sa glfwCreateWindow
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001194 *
1195 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001196 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001197GLFWAPI void glfwDestroyWindow(GLFWwindow* window);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001198
Camilla Berglund64afb192013-03-06 23:29:37 +01001199/*! @brief Checks the close flag of the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001200 *
1201 * This function returns the value of the close flag of the specified window.
1202 *
Camilla Berglund6fadf372013-03-01 13:45:12 +01001203 * @param[in] window The window to query.
Camilla Berglund64afb192013-03-06 23:29:37 +01001204 * @return The value of the close flag.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001205 *
Camilla Berglund6fadf372013-03-01 13:45:12 +01001206 * @ingroup window
1207 */
1208GLFWAPI int glfwWindowShouldClose(GLFWwindow* window);
1209
Camilla Berglund64afb192013-03-06 23:29:37 +01001210/*! @brief Sets the close flag of the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001211 *
1212 * This function sets the value of the close flag of the specified window.
1213 * This can be used to override the user's attempt to close the window, or
1214 * to signal that it should be closed.
1215 *
Camilla Berglund64afb192013-03-06 23:29:37 +01001216 * @param[in] window The window whose flag to change.
Camilla Berglund6fadf372013-03-01 13:45:12 +01001217 * @param[in] value The new value.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001218 *
Camilla Berglund6fadf372013-03-01 13:45:12 +01001219 * @ingroup window
Camilla Berglund6fadf372013-03-01 13:45:12 +01001220 */
1221GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value);
1222
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001223/*! @brief Sets the title of the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001224 *
1225 * This function sets the window title, encoded as UTF-8, of the specified
1226 * window.
1227 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001228 * @param[in] window The window whose title to change.
1229 * @param[in] title The UTF-8 encoded window title.
Camilla Berglund9ad1d972012-11-22 19:08:30 +01001230 *
1231 * @note This function may only be called from the main thread.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001232 *
1233 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001234 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001235GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001236
Camilla Berglund7c193232013-01-24 19:30:31 +01001237/*! @brief Retrieves the position of the client area of the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001238 *
1239 * This function retrieves the position, in screen coordinates, of the
1240 * upper-left corner of the client area of the specified window.
1241 *
Camilla Berglund7c193232013-01-24 19:30:31 +01001242 * @param[in] window The window to query.
1243 * @param[out] xpos The x-coordinate of the upper-left corner of the client area.
1244 * @param[out] ypos The y-coordinate of the upper-left corner of the client area.
Camilla Berglund7c193232013-01-24 19:30:31 +01001245 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001246 * @remarks Either or both coordinate parameters may be `NULL`.
Camilla Berglund7c193232013-01-24 19:30:31 +01001247 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001248 * @bug **Mac OS X:** The screen coordinate system is inverted.
1249 *
Camilla Berglund7c193232013-01-24 19:30:31 +01001250 * @sa glfwSetWindowPos
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001251 *
1252 * @ingroup window
Camilla Berglund7c193232013-01-24 19:30:31 +01001253 */
1254GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos);
1255
1256/*! @brief Sets the position of the client area of the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001257 *
1258 * This function sets the position, in screen coordinates, of the upper-left
1259 * corner of the client area of the window.
1260 *
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001261 * If it is a full screen window, this function does nothing.
1262 *
Camilla Berglund7c193232013-01-24 19:30:31 +01001263 * @param[in] window The window to query.
1264 * @param[in] xpos The x-coordinate of the upper-left corner of the client area.
1265 * @param[in] ypos The y-coordinate of the upper-left corner of the client area.
Camilla Berglund7c193232013-01-24 19:30:31 +01001266 *
1267 * @remarks If you wish to set an initial window position you should create
Camilla Berglund71d2b572013-03-12 15:33:05 +01001268 * a hidden window (using @ref glfwWindowHint and `GLFW_VISIBLE`), set its
Camilla Berglund7c193232013-01-24 19:30:31 +01001269 * position and then show it.
1270 *
1271 * @note It is very rarely a good idea to move an already visible window, as it
1272 * will confuse and annoy the user.
1273 *
1274 * @note This function may only be called from the main thread.
1275 *
1276 * @note The window manager may put limits on what positions are allowed.
1277 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001278 * @bug **X11:** Some window managers ignore the set position of hidden (i.e.
1279 * unmapped) windows, instead placing them where it thinks is appropriate once
1280 * they are shown.
Camilla Berglund7c193232013-01-24 19:30:31 +01001281 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001282 * @bug **Mac OS X:** The screen coordinate system is inverted.
Camilla Berglund7c193232013-01-24 19:30:31 +01001283 *
1284 * @sa glfwGetWindowPos
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001285 *
1286 * @ingroup window
Camilla Berglund7c193232013-01-24 19:30:31 +01001287 */
Camilla Berglund52f718d2013-02-12 12:01:12 +01001288GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);
Camilla Berglund7c193232013-01-24 19:30:31 +01001289
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001290/*! @brief Retrieves the size of the client area of the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001291 *
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001292 * This function retrieves the size, in screen coordinates, of the client area
1293 * of the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001294 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001295 * @param[in] window The window whose size to retrieve.
1296 * @param[out] width The width of the client area.
1297 * @param[out] height The height of the client area.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001298 *
1299 * @sa glfwSetWindowSize
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001300 *
1301 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001302 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001303GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001304
1305/*! @brief Sets the size of the client area of the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001306 *
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001307 * This function sets the size, in screen coordinates, of the client area of
1308 * the specified window.
1309 *
1310 * For full screen windows, this function selects and switches to the resolution
1311 * closest to the specified size, without affecting the window's context. As
1312 * the context is unaffected, the bit depths of the framebuffer remain
1313 * unchanged.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001314 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001315 * @param[in] window The window to resize.
1316 * @param[in] width The desired width of the specified window.
1317 * @param[in] height The desired height of the specified window.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001318 *
Camilla Berglund9ad1d972012-11-22 19:08:30 +01001319 * @note This function may only be called from the main thread.
1320 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001321 * @note The window manager may put limits on what window sizes are allowed.
1322 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001323 * @sa glfwGetWindowSize
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001324 *
1325 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001326 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001327GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001328
1329/*! @brief Iconifies the specified window.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001330 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001331 * This function iconifies/minimizes the specified window, if it was previously
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001332 * restored. If it is a full screen window, the original monitor resolution is
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001333 * restored until the window is restored. If the window is already iconified,
1334 * this function does nothing.
1335 *
1336 * @param[in] window The window to iconify.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001337 *
Camilla Berglund9ad1d972012-11-22 19:08:30 +01001338 * @note This function may only be called from the main thread.
1339 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001340 * @bug **Mac OS X:** This function is not yet implemented for
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001341 * full screen windows.
Camilla Berglund8954af62013-02-20 19:44:52 +01001342 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001343 * @sa glfwRestoreWindow
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001344 *
1345 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001346 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001347GLFWAPI void glfwIconifyWindow(GLFWwindow* window);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001348
1349/*! @brief Restores the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001350 *
1351 * This function restores the specified window, if it was previously
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001352 * iconified/minimized. If it is a full screen window, the resolution chosen
1353 * for the window is restored on the selected monitor. If the window is
1354 * already restored, this function does nothing.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001355 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001356 * @param[in] window The window to restore.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001357 *
Camilla Berglund9ad1d972012-11-22 19:08:30 +01001358 * @note This function may only be called from the main thread.
1359 *
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001360 * @bug **Mac OS X:** This function is not yet implemented for full screen
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001361 * windows.
Camilla Berglund8954af62013-02-20 19:44:52 +01001362 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001363 * @sa glfwIconifyWindow
Camilla Berglunde248fb62013-03-29 14:06:23 +01001364 *
1365 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001366 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001367GLFWAPI void glfwRestoreWindow(GLFWwindow* window);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001368
1369/*! @brief Makes the specified window visible.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001370 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001371 * This function makes the specified window visible, if it was previously
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001372 * hidden. If the window is already visible or is in full screen mode, this
Camilla Berglund1e9383d2012-11-23 11:41:53 +01001373 * function does nothing.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001374 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001375 * @param[in] window The window to make visible.
1376 *
Camilla Berglund9ad1d972012-11-22 19:08:30 +01001377 * @note This function may only be called from the main thread.
1378 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001379 * @sa glfwHideWindow
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001380 *
1381 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001382 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001383GLFWAPI void glfwShowWindow(GLFWwindow* window);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001384
1385/*! @brief Hides the specified window.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001386 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001387 * This function hides the specified window, if it was previously visible. If
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001388 * the window is already hidden or is in full screen mode, this function does
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001389 * nothing.
1390 *
1391 * @param[in] window The window to hide.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001392 *
Camilla Berglund9ad1d972012-11-22 19:08:30 +01001393 * @note This function may only be called from the main thread.
1394 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001395 * @sa glfwShowWindow
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001396 *
1397 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001398 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001399GLFWAPI void glfwHideWindow(GLFWwindow* window);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001400
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001401/*! @brief Returns the monitor that the window uses for full screen mode.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001402 *
1403 * This function returns the handle of the monitor that the specified window is
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001404 * in full screen on.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001405 *
Camilla Berglund5f68e122012-11-27 17:07:28 +01001406 * @param[in] window The window to query.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001407 * @return The monitor, or `NULL` if the window is in windowed mode.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001408 *
Camilla Berglund5f68e122012-11-27 17:07:28 +01001409 * @ingroup window
Camilla Berglund41bc0d12012-11-27 16:55:04 +01001410 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001411GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);
Camilla Berglund41bc0d12012-11-27 16:55:04 +01001412
Camilla Berglundf8f81e52013-02-28 21:15:04 +01001413/*! @brief Returns a parameter of the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001414 *
1415 * This function returns a property of the specified window. There are many
1416 * different properties, some related to the window and others to its context.
1417 *
Camilla Berglund1e9383d2012-11-23 11:41:53 +01001418 * @param[in] window The window to query.
Camilla Berglundf8f81e52013-02-28 21:15:04 +01001419 * @param[in] param The parameter whose value to return.
1420 * @return The value of the parameter, or zero if an error occurred.
Camilla Berglund1e9383d2012-11-23 11:41:53 +01001421 *
Camilla Berglundf8f81e52013-02-28 21:15:04 +01001422 * @par Window parameters
Camilla Berglund1bd59842013-01-13 21:28:18 +01001423 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001424 * The `GLFW_FOCUSED` parameter indicates whether the window is focused.
Camilla Berglund1e9383d2012-11-23 11:41:53 +01001425 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001426 * The `GLFW_ICONIFIED` parameter indicates whether the window is iconified.
Camilla Berglund1e9383d2012-11-23 11:41:53 +01001427 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001428 * The `GLFW_VISIBLE` parameter indicates whether the window is visible.
Camilla Berglund1e9383d2012-11-23 11:41:53 +01001429 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001430 * The `GLFW_RESIZABLE` parameter indicates whether the window is resizable
Camilla Berglund1e9383d2012-11-23 11:41:53 +01001431 * by the user.
1432 *
Camilla Berglund7b5b33e2013-04-08 15:28:38 +02001433 * The `GLFW_DECORATED` parameter indicates whether the window is decorated.
1434 *
Camilla Berglundf8f81e52013-02-28 21:15:04 +01001435 * @par Context parameters
Camilla Berglund1bd59842013-01-13 21:28:18 +01001436 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001437 * The `GLFW_CLIENT_API` parameter indicates the client API provided by the
1438 * window's context; either `GLFW_OPENGL_API` or `GLFW_OPENGL_ES_API`.
Camilla Berglund1e9383d2012-11-23 11:41:53 +01001439 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001440 * The `GLFW_CONTEXT_VERSION_MAJOR`, `GLFW_CONTEXT_VERSION_MINOR` and
1441 * `GLFW_CONTEXT_REVISION` parameters indicate the client API version of the
Camilla Berglund3f5843f2012-12-13 02:22:39 +01001442 * window's context.
Camilla Berglund1e9383d2012-11-23 11:41:53 +01001443 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001444 * The `GLFW_OPENGL_FORWARD_COMPAT` parameter is `GL_TRUE` if the window's
1445 * context is an OpenGL forward-compatible one, or `GL_FALSE` otherwise.
Camilla Berglund1e9383d2012-11-23 11:41:53 +01001446 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001447 * The `GLFW_OPENGL_DEBUG_CONTEXT` parameter is `GL_TRUE` if the window's
1448 * context is an OpenGL debug context, or `GL_FALSE` otherwise.
Camilla Berglund1e9383d2012-11-23 11:41:53 +01001449 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001450 * The `GLFW_OPENGL_PROFILE` parameter indicates the OpenGL profile used by the
1451 * context. This is `GLFW_OPENGL_CORE_PROFILE` or `GLFW_OPENGL_COMPAT_PROFILE`
1452 * if the context uses a known profile, or `GLFW_OPENGL_NO_PROFILE` if the
1453 * OpenGL profile is unknown or the context is for another client API.
Camilla Berglund1e9383d2012-11-23 11:41:53 +01001454 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001455 * The `GLFW_CONTEXT_ROBUSTNESS` parameter indicates the robustness strategy
1456 * used by the context. This is `GLFW_LOSE_CONTEXT_ON_RESET` or
1457 * `GLFW_NO_RESET_NOTIFICATION` if the window's context supports robustness, or
1458 * `GLFW_NO_ROBUSTNESS` otherwise.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001459 *
1460 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001461 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001462GLFWAPI int glfwGetWindowParam(GLFWwindow* window, int param);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001463
1464/*! @brief Sets the user pointer of the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001465 *
1466 * This function sets the user-defined pointer of the specified window. The
1467 * current value is retained until the window is destroyed. The initial value
1468 * is `NULL`.
1469 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001470 * @param[in] window The window whose pointer to set.
1471 * @param[in] pointer The new value.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001472 *
1473 * @sa glfwGetWindowUserPointer
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001474 *
1475 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001476 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001477GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001478
1479/*! @brief Returns the user pointer of the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001480 *
1481 * This function returns the current value of the user-defined pointer of the
1482 * specified window. The initial value is `NULL`.
1483 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001484 * @param[in] window The window whose pointer to return.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001485 *
1486 * @sa glfwSetWindowUserPointer
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001487 *
1488 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001489 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001490GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001491
Camilla Berglund1a3d47d2012-11-30 13:56:42 +01001492/*! @brief Sets the position callback for the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001493 *
1494 * This function sets the position callback of the specified window, which is
1495 * called when the window is moved. The callback is provided with the screen
1496 * position of the upper-left corner of the client area of the window.
1497 *
Camilla Berglund1a3d47d2012-11-30 13:56:42 +01001498 * @param[in] window The window whose callback to set.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001499 * @param[in] cbfun The new callback, or `NULL` to remove the currently set
Camilla Berglund1a3d47d2012-11-30 13:56:42 +01001500 * callback.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001501 *
Camilla Berglund1a3d47d2012-11-30 13:56:42 +01001502 * @ingroup window
1503 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001504GLFWAPI void glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun);
Camilla Berglund1a3d47d2012-11-30 13:56:42 +01001505
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001506/*! @brief Sets the size callback for the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001507 *
1508 * This function sets the size callback of the specified window, which is
1509 * called when the window is resized. The callback is provided with the size,
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001510 * in screen coordinates, of the client area of the window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001511 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001512 * @param[in] window The window whose callback to set.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001513 * @param[in] cbfun The new callback, or `NULL` to remove the currently set
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001514 * callback.
Camilla Berglunda3ff29a2012-12-02 15:47:10 +01001515 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001516 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001517 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001518GLFWAPI void glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001519
1520/*! @brief Sets the close callback for the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001521 *
1522 * This function sets the close callback of the specified window, which is
1523 * called when the user attempts to close the window, for example by clicking
1524 * the close widget in the title bar.
1525 *
1526 * The close flag is set before this callback is called, but you can modify it
1527 * at any time with @ref glfwSetWindowShouldClose.
1528 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001529 * @param[in] window The window whose callback to set.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001530 * @param[in] cbfun The new callback, or `NULL` to remove the currently set
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001531 * callback.
Camilla Berglunda3ff29a2012-12-02 15:47:10 +01001532 *
Camilla Berglund64afb192013-03-06 23:29:37 +01001533 * @remarks Calling @ref glfwDestroyWindow does not cause this callback to be
1534 * called.
Camilla Berglund1bd59842013-01-13 21:28:18 +01001535 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001536 * @remarks **Mac OS X:** Selecting Quit from the application menu will
Camilla Berglund1bd59842013-01-13 21:28:18 +01001537 * trigger the close callback for all windows.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001538 *
1539 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001540 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001541GLFWAPI void glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001542
1543/*! @brief Sets the refresh callback for the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001544 *
1545 * This function sets the refresh callback of the specified window, which is
1546 * called when the client area of the window needs to be redrawn, for example
1547 * if the window has been exposed after having been covered by another window.
1548 *
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001549 * On compositing window systems such as Aero, Compiz or Aqua, where the window
1550 * contents are saved off-screen, this callback may be called only very
1551 * infrequently or never at all.
1552 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001553 * @param[in] window The window whose callback to set.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001554 * @param[in] cbfun The new callback, or `NULL` to remove the currently set
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001555 * callback.
Camilla Berglunda3ff29a2012-12-02 15:47:10 +01001556 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001557 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001558 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001559GLFWAPI void glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001560
1561/*! @brief Sets the focus callback for the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001562 *
1563 * This function sets the focus callback of the specified window, which is
1564 * called when the window gains or loses focus.
1565 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001566 * @param[in] window The window whose callback to set.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001567 * @param[in] cbfun The new callback, or `NULL` to remove the currently set
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001568 * callback.
Camilla Berglunda3ff29a2012-12-02 15:47:10 +01001569 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001570 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001571 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001572GLFWAPI void glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001573
1574/*! @brief Sets the iconify callback for the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001575 *
1576 * This function sets the iconification callback of the specified window, which
1577 * is called when the window is iconified or restored.
1578 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001579 * @param[in] window The window whose callback to set.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001580 * @param[in] cbfun The new callback, or `NULL` to remove the currently set
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001581 * callback.
Camilla Berglunda3ff29a2012-12-02 15:47:10 +01001582 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001583 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001584 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001585GLFWAPI void glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun);
Camilla Berglund135194a2010-09-09 18:15:32 +02001586
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001587/*! @brief Processes all pending events.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001588 *
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001589 * This function processes only those events that have already been received
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001590 * and then returns immediately.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001591 *
Camilla Berglund401033c2013-03-12 19:17:07 +01001592 * @par New in GLFW 3
1593 * This function is no longer called by @ref glfwSwapBuffers. You need to call
1594 * it or @ref glfwWaitEvents yourself.
1595 *
Camilla Berglund9ad1d972012-11-22 19:08:30 +01001596 * @note This function may only be called from the main thread.
1597 *
Camilla Berglundb48128f2013-02-14 18:49:03 +01001598 * @note This function may not be called from a callback.
1599 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001600 * @sa glfwWaitEvents
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001601 *
1602 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001603 */
Camilla Berglund9a716692010-09-08 16:40:43 +02001604GLFWAPI void glfwPollEvents(void);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001605
1606/*! @brief Waits until events are pending and processes them.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001607 *
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001608 * This function blocks until at least one event has been received and then
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001609 * processes all received events before returning.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001610 *
Camilla Berglund9ad1d972012-11-22 19:08:30 +01001611 * @note This function may only be called from the main thread.
1612 *
Camilla Berglundb48128f2013-02-14 18:49:03 +01001613 * @note This function may not be called from a callback.
1614 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001615 * @sa glfwPollEvents
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001616 *
1617 * @ingroup window
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001618 */
Camilla Berglund9a716692010-09-08 16:40:43 +02001619GLFWAPI void glfwWaitEvents(void);
Camilla Berglund135194a2010-09-09 18:15:32 +02001620
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001621/*! @brief Returns the value of an input option for the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001622 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001623 * @param[in] window The window to query.
Camilla Berglund39fe1f12013-03-12 19:39:36 +01001624 * @param[in] mode One of `GLFW_CURSOR_MODE`, `GLFW_STICKY_KEYS` or
1625 * `GLFW_STICKY_MOUSE_BUTTONS`.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001626 *
1627 * @sa glfwSetInputMode
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001628 *
1629 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001630 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001631GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001632
1633/*! @brief Sets an input option for the specified window.
Camilla Berglund9492fc52013-01-17 17:51:12 +01001634 * @param[in] window The window whose input mode to set.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001635 * @param[in] mode One of `GLFW_CURSOR_MODE`, `GLFW_STICKY_KEYS` or
1636 * `GLFW_STICKY_MOUSE_BUTTONS`.
Camilla Berglund9492fc52013-01-17 17:51:12 +01001637 * @param[in] value The new value of the specified input mode.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001638 *
Camilla Berglund39fe1f12013-03-12 19:39:36 +01001639 * If `mode` is `GLFW_CURSOR_MODE`, the value must be one of the supported input
1640 * modes:
Camilla Berglund13ccf7d2013-04-07 13:46:38 +02001641 * - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally.
1642 * - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client
Camilla Berglund39fe1f12013-03-12 19:39:36 +01001643 * area of the window.
Camilla Berglund13ccf7d2013-04-07 13:46:38 +02001644 * - `GLFW_CURSOR_CAPTURED` makes the cursor invisible and unable to leave the
Camilla Berglund39fe1f12013-03-12 19:39:36 +01001645 * window but unconstrained in terms of position.
1646 *
1647 * If `mode` is `GLFW_STICKY_KEYS`, the value must be either `GL_TRUE` to
1648 * enable sticky keys, or `GL_FALSE` to disable it. If sticky keys are
1649 * enabled, a key press will ensure that @ref glfwGetKey returns @ref
1650 * GLFW_PRESS the next time it is called even if the key had been released
1651 * before the call.
1652 *
1653 * If `mode` is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either `GL_TRUE`
1654 * to enable sticky mouse buttons, or `GL_FALSE` to disable it. If sticky
1655 * mouse buttons are enabled, a mouse button press will ensure that @ref
1656 * glfwGetMouseButton returns @ref GLFW_PRESS the next time it is called even
1657 * if the mouse button had been released before the call.
1658 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001659 * @bug **Mac OS X:** The @ref GLFW_CURSOR_HIDDEN value of @ref
Camilla Berglund8954af62013-02-20 19:44:52 +01001660 * GLFW_CURSOR_MODE is not yet implemented.
1661 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001662 * @sa glfwGetInputMode
Camilla Berglunde248fb62013-03-29 14:06:23 +01001663 *
1664 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001665 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001666GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001667
1668/*! @brief Returns the last reported state of a keyboard key for the specified
1669 * window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001670 *
1671 * This function returns the last state reported for the specified key to the
1672 * specified window. The returned state is one of `GLFW_PRESS` or
1673 * `GLFW_RELEASE`. The higher-level state `GLFW_REPEAT` is only reported to
1674 * the key callback.
1675 *
1676 * If the `GLFW_STICKY_KEYS` input mode is enabled, this function returns
1677 * `GLFW_PRESS` the first time you call this function after a key has been
1678 * pressed, even if the key has already been released.
1679 *
1680 * The key functions deal with physical keys, with [key tokens](@ref keys)
1681 * named after their use on the standard US keyboard layout. If you want to
1682 * input text, use the Unicode character callback instead.
1683 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001684 * @param[in] window The desired window.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001685 * @param[in] key The desired [keyboard key](@ref keys).
1686 * @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001687 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001688 * @ingroup input
1689 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001690GLFWAPI int glfwGetKey(GLFWwindow* window, int key);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001691
1692/*! @brief Returns the last reported state of a mouse button for the specified
1693 * window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001694 *
1695 * This function returns the last state reported for the specified mouse button
1696 * to the specified window.
1697 *
1698 * If the `GLFW_STICKY_MOUSE_BUTTONS` input mode is enabled, this function
1699 * returns `GLFW_PRESS` the first time you call this function after a mouse
1700 * button has been pressed, even if the mouse button has already been released.
1701 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001702 * @param[in] window The desired window.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001703 * @param[in] button The desired [mouse button](@ref buttons).
1704 * @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001705 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001706 * @ingroup input
1707 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001708GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001709
1710/*! @brief Retrieves the last reported cursor position, relative to the client
1711 * area of the window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001712 *
1713 * This function returns the last reported position of the cursor to the
1714 * specified window.
1715 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001716 * @param[in] window The desired window.
1717 * @param[out] xpos The cursor x-coordinate, relative to the left edge of the
Camilla Berglund71d2b572013-03-12 15:33:05 +01001718 * client area, or `NULL`.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001719 * @param[out] ypos The cursor y-coordinate, relative to the to top edge of the
Camilla Berglund71d2b572013-03-12 15:33:05 +01001720 * client area, or `NULL`.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001721 *
1722 * @sa glfwSetCursorPos
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001723 *
1724 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001725 */
Camilla Berglund129e94d2013-04-04 16:16:21 +02001726GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001727
1728/*! @brief Sets the position of the cursor, relative to the client area of the window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001729 *
1730 * This function sets the position of the cursor. The specified window must be
1731 * focused. If the window does not have focus when this function is called, it
1732 * fails silently.
1733 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001734 * @param[in] window The desired window.
1735 * @param[in] xpos The desired x-coordinate, relative to the left edge of the
Camilla Berglund71d2b572013-03-12 15:33:05 +01001736 * client area, or `NULL`.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001737 * @param[in] ypos The desired y-coordinate, relative to the top edge of the
Camilla Berglund71d2b572013-03-12 15:33:05 +01001738 * client area, or `NULL`.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001739 *
1740 * @sa glfwGetCursorPos
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001741 *
1742 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001743 */
Camilla Berglund129e94d2013-04-04 16:16:21 +02001744GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001745
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001746/*! @brief Sets the key callback.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001747 *
1748 * This function sets the key callback of the specific window, which is called
1749 * when a key is pressed, repeated or released.
1750 *
1751 * The key functions deal with physical keys, with [key tokens](@ref keys)
1752 * named after their use on the standard US keyboard layout. If you want to
1753 * input text, use the [character callback](@ref glfwSetCharCallback) instead.
1754 *
Camilla Berglund9492fc52013-01-17 17:51:12 +01001755 * @param[in] window The window whose callback to set.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001756 * @param[in] cbfun The new key callback, or `NULL` to remove the currently
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001757 * set callback.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001758 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001759 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001760 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001761GLFWAPI void glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001762
1763/*! @brief Sets the Unicode character callback.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001764 *
1765 * This function sets the character callback of the specific window, which is
1766 * called when a Unicode character is input.
1767 *
1768 * The character callback is intended for text input. If you want to know
1769 * whether a specific key was pressed or released, use the
1770 * [key callback](@ref glfwSetKeyCallback) instead.
1771 *
Camilla Berglund9492fc52013-01-17 17:51:12 +01001772 * @param[in] window The window whose callback to set.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001773 * @param[in] cbfun The new callback, or `NULL` to remove the currently set
Camilla Berglunddba2d802013-01-17 23:06:56 +01001774 * callback.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001775 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001776 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001777 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001778GLFWAPI void glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001779
1780/*! @brief Sets the mouse button callback.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001781 *
1782 * This function sets the mouse button callback of the specified window, which
1783 * is called when a mouse button is pressed or released.
1784 *
Camilla Berglund9492fc52013-01-17 17:51:12 +01001785 * @param[in] window The window whose callback to set.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001786 * @param[in] cbfun The new callback, or `NULL` to remove the currently set
Camilla Berglunddba2d802013-01-17 23:06:56 +01001787 * callback.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001788 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001789 * @ingroup input
1790 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001791GLFWAPI void glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001792
1793/*! @brief Sets the cursor position callback.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001794 *
1795 * This function sets the cursor position callback of the specified window,
1796 * which is called when the cursor is moved. The callback is provided with the
1797 * position relative to the upper-left corner of the client area of the window.
1798 *
Camilla Berglund9492fc52013-01-17 17:51:12 +01001799 * @param[in] window The window whose callback to set.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001800 * @param[in] cbfun The new callback, or `NULL` to remove the currently set
Camilla Berglunddba2d802013-01-17 23:06:56 +01001801 * callback.
Camilla Berglunda3ff29a2012-12-02 15:47:10 +01001802 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001803 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001804 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001805GLFWAPI void glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001806
1807/*! @brief Sets the cursor enter/exit callback.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001808 *
1809 * This function sets the cursor boundary crossing callback of the specified
1810 * window, which is called when the cursor enters or leaves the client area of
1811 * the window.
1812 *
Camilla Berglund9492fc52013-01-17 17:51:12 +01001813 * @param[in] window The window whose callback to set.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001814 * @param[in] cbfun The new callback, or `NULL` to remove the currently set
Camilla Berglunddba2d802013-01-17 23:06:56 +01001815 * callback.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001816 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001817 * @ingroup input
1818 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001819GLFWAPI void glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001820
1821/*! @brief Sets the scroll callback.
Camilla Berglunde248fb62013-03-29 14:06:23 +01001822 *
1823 * This function sets the scroll callback of the specified window, which is
1824 * called when a scrolling device is used, such as a mouse wheel or scrolling
1825 * area of a touchpad.
1826 *
Camilla Berglund9492fc52013-01-17 17:51:12 +01001827 * @param[in] window The window whose callback to set.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001828 * @param[in] cbfun The new scroll callback, or `NULL` to remove the currently
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001829 * set callback.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001830 *
Camilla Berglunda59c82c2013-03-01 15:20:29 +01001831 * @remarks This receives all scrolling input, like that from a mouse wheel or
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001832 * a touchpad scrolling area.
Camilla Berglunde248fb62013-03-29 14:06:23 +01001833 *
1834 * @ingroup input
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001835 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001836GLFWAPI void glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun);
Camilla Berglund3249f812010-09-07 17:34:51 +02001837
Camilla Berglundf8f81e52013-02-28 21:15:04 +01001838/*! @brief Returns a parameter of the specified joystick.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001839 *
1840 * This function returns a parameter of the specified joystick.
1841 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001842 * @param[in] joy The joystick to query.
Camilla Berglundf8f81e52013-02-28 21:15:04 +01001843 * @param[in] param The parameter whose value to return.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001844 * @return The specified joystick's current value, or zero if the joystick is
1845 * not present.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001846 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001847 * @ingroup input
1848 */
Camilla Berglund9a716692010-09-08 16:40:43 +02001849GLFWAPI int glfwGetJoystickParam(int joy, int param);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001850
1851/*! @brief Returns the values of axes of the specified joystick.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001852 *
1853 * This function returns the current positions of axes of the specified
1854 * joystick.
1855 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001856 * @param[in] joy The joystick to query.
1857 * @param[out] axes The array to hold the values.
1858 * @param[in] numaxes The size of the provided array.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001859 * @return The number of values written to `axes`, or zero if an error
Camilla Berglund5d6256c2013-02-25 17:53:02 +01001860 * occurred.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001861 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001862 * @ingroup input
1863 */
Camilla Berglund2502e4d2012-08-29 18:31:12 +02001864GLFWAPI int glfwGetJoystickAxes(int joy, float* axes, int numaxes);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001865
1866/*! @brief Returns the values of buttons of the specified joystick.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001867 *
1868 * This function returns the current state of buttons of the specified
1869 * joystick.
1870 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001871 * @param[in] joy The joystick to query.
1872 * @param[out] buttons The array to hold the values.
1873 * @param[in] numbuttons The size of the provided array.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001874 * @return The number of values written to `buttons`, or zero if an error
Camilla Berglund5d6256c2013-02-25 17:53:02 +01001875 * occurred.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001876 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001877 * @ingroup input
1878 */
Camilla Berglund9a716692010-09-08 16:40:43 +02001879GLFWAPI int glfwGetJoystickButtons(int joy, unsigned char* buttons, int numbuttons);
Camilla Berglund3249f812010-09-07 17:34:51 +02001880
Camilla Berglund7d9b5c02012-12-02 16:55:09 +01001881/*! @brief Returns the name of the specified joystick.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001882 *
1883 * This function returns the name, encoded as UTF-8, of the specified joystick.
1884 *
Camilla Berglund7d9b5c02012-12-02 16:55:09 +01001885 * @param[in] joy The joystick to query.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001886 * @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick
Camilla Berglund7d9b5c02012-12-02 16:55:09 +01001887 * is not present.
Camilla Berglundd4a08b12012-12-02 17:13:41 +01001888 *
1889 * @note The returned string is valid only until the next call to @ref
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001890 * glfwGetJoystickName for that joystick.
1891 *
1892 * @ingroup input
Camilla Berglund7d9b5c02012-12-02 16:55:09 +01001893 */
Camilla Berglund93a1d1c2012-09-07 01:01:34 +02001894GLFWAPI const char* glfwGetJoystickName(int joy);
Camilla Berglund3249f812010-09-07 17:34:51 +02001895
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001896/*! @brief Sets the clipboard to the specified string.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001897 *
1898 * This function sets the system clipboard to the specified, UTF-8 encoded
1899 * string. The string is copied before returning, so you don't have to retain
1900 * it afterwards.
1901 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001902 * @param[in] window The window that will own the clipboard contents.
1903 * @param[in] string A UTF-8 encoded string.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001904 *
Camilla Berglunda3ff29a2012-12-02 15:47:10 +01001905 * @note This function may only be called from the main thread.
1906 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001907 * @sa glfwGetClipboardString
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001908 *
1909 * @ingroup clipboard
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001910 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001911GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001912
1913/*! @brief Retrieves the contents of the clipboard as a string.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001914 *
1915 * This function returns the contents of the system clipboard, if it contains
1916 * or is convertible to a UTF-8 encoded string.
1917 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001918 * @param[in] window The window that will request the clipboard contents.
Camilla Berglund71d2b572013-03-12 15:33:05 +01001919 * @return The contents of the clipboard as a UTF-8 encoded string, or `NULL`
Camilla Berglund5d6256c2013-02-25 17:53:02 +01001920 * if an error occurred.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001921 *
Camilla Berglunda3ff29a2012-12-02 15:47:10 +01001922 * @note This function may only be called from the main thread.
1923 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001924 * @note The returned string is valid only until the next call to @ref
1925 * glfwGetClipboardString or @ref glfwSetClipboardString.
1926 *
1927 * @sa glfwSetClipboardString
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001928 *
1929 * @ingroup clipboard
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001930 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001931GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window);
Ralph Eastwood31c91542011-09-21 10:09:47 +01001932
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001933/*! @brief Returns the value of the GLFW timer.
1934 *
1935 * This function returns the value of the GLFW timer. Unless the timer has
1936 * been set using @ref glfwSetTime, the timer measures time elapsed since GLFW
1937 * was initialized.
1938 *
Camilla Berglund5d6256c2013-02-25 17:53:02 +01001939 * @return The current value, in seconds, or zero if an error occurred.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001940 *
1941 * @remarks This function may be called from secondary threads.
1942 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001943 * @note The resolution of the timer is system dependent, but is usually on the
1944 * order of a few micro- or nanoseconds. It uses the highest-resolution
1945 * monotonic time source on each supported platform.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001946 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001947 * @ingroup time
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001948 */
Camilla Berglund9a716692010-09-08 16:40:43 +02001949GLFWAPI double glfwGetTime(void);
Camilla Berglund3249f812010-09-07 17:34:51 +02001950
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001951/*! @brief Sets the GLFW timer.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001952 *
1953 * This function sets the value of the GLFW timer. It then continues to count
1954 * up from that value.
1955 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001956 * @param[in] time The new value, in seconds.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001957 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001958 * @note The resolution of the timer is system dependent, but is usually on the
1959 * order of a few micro- or nanoseconds. It uses the highest-resolution
1960 * monotonic time source on each supported platform.
Camilla Berglunde248fb62013-03-29 14:06:23 +01001961 *
1962 * @ingroup time
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001963 */
1964GLFWAPI void glfwSetTime(double time);
1965
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001966/*! @brief Makes the context of the specified window current for the calling
1967 * thread.
1968 *
1969 * This function makes the context of the specified window current on the
1970 * calling thread. A context can only be made current on a single thread at
Camilla Berglund8282a8f2013-04-10 23:01:12 +02001971 * a time and each thread can have only a single current context at a time.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001972 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001973 * @param[in] window The window whose context to make current, or `NULL` to
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001974 * detach the current context.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001975 *
1976 * @remarks This function may be called from secondary threads.
1977 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001978 * @sa glfwGetCurrentContext
Camilla Berglunde248fb62013-03-29 14:06:23 +01001979 *
1980 * @ingroup context
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001981 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001982GLFWAPI void glfwMakeContextCurrent(GLFWwindow* window);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001983
Camilla Berglund2d5fb772013-03-18 19:11:02 +01001984/*! @brief Returns the window whose context is current on the calling thread.
1985 *
1986 * This function returns the window whose context is current on the calling
1987 * thread.
1988 *
Camilla Berglund71d2b572013-03-12 15:33:05 +01001989 * @return The window whose context is current, or `NULL` if no window's
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001990 * context is current.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001991 *
1992 * @remarks This function may be called from secondary threads.
1993 *
1994 * @sa glfwMakeContextCurrent
Camilla Berglunde248fb62013-03-29 14:06:23 +01001995 *
1996 * @ingroup context
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001997 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01001998GLFWAPI GLFWwindow* glfwGetCurrentContext(void);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01001999
2000/*! @brief Swaps the front and back buffers of the specified window.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01002001 *
2002 * This function swaps the front and back buffers of the specified window. If
2003 * the swap interval is greater than zero, the GPU driver waits the specified
2004 * number of screen updates before swapping the buffers.
2005 *
Camilla Berglund9492fc52013-01-17 17:51:12 +01002006 * @param[in] window The window whose buffers to swap.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002007 *
2008 * @remarks This function may be called from secondary threads.
2009 *
Camilla Berglund401033c2013-03-12 19:17:07 +01002010 * @par New in GLFW 3
2011 * This function no longer calls @ref glfwPollEvents. You need to call it or
2012 * @ref glfwWaitEvents yourself.
2013 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002014 * @sa glfwSwapInterval
Camilla Berglunde248fb62013-03-29 14:06:23 +01002015 *
2016 * @ingroup context
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002017 */
Camilla Berglund9af960e2013-01-05 21:13:28 +01002018GLFWAPI void glfwSwapBuffers(GLFWwindow* window);
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002019
2020/*! @brief Sets the swap interval for the current context.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01002021 *
2022 * This function sets the swap interval for the current context, i.e. the
2023 * number of screen updates to wait before swapping the buffers of a window and
Camilla Berglund8282a8f2013-04-10 23:01:12 +02002024 * returning from @ref glfwSwapBuffers. This is sometimes called 'vertical
2025 * synchronization', 'vertical retrace synchronization' or 'vsync'.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01002026 *
2027 * @param[in] interval The minimum number of screen updates to wait for
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002028 * until the buffers are swapped by @ref glfwSwapBuffers.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002029 *
2030 * @remarks This function may be called from secondary threads.
2031 *
Camilla Berglund8282a8f2013-04-10 23:01:12 +02002032 * @remarks Contexts that support either of the `WGL_EXT_swap_control_tear` and
2033 * `GLX_EXT_swap_control_tear` extensions also accept negative swap intervals,
2034 * which allow the driver to swap even if a frame arrives a little bit late.
2035 * You can check for the presence of these extensions using @ref
2036 * glfwExtensionSupported. For more information about swap tearing, see the
2037 * extension specifications.
2038 *
2039 * @note Some GPU drivers do not honor the requested swap interval, either
2040 * because of user settings that override the request or due to bugs in the
2041 * driver.
2042 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002043 * @sa glfwSwapBuffers
Camilla Berglunde248fb62013-03-29 14:06:23 +01002044 *
2045 * @ingroup context
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002046 */
2047GLFWAPI void glfwSwapInterval(int interval);
2048
Camilla Berglund2d5fb772013-03-18 19:11:02 +01002049/*! @brief Returns whether the specified extension is available.
2050 *
2051 * This function returns whether the specified OpenGL or platform-specific
2052 * context creation API extension is supported by the current context. For
2053 * example, on Windows both the OpenGL and WGL extension strings are checked.
2054 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002055 * @param[in] extension The ASCII encoded name of the extension.
Camilla Berglund71d2b572013-03-12 15:33:05 +01002056 * @return `GL_TRUE` if the extension is available, or `GL_FALSE` otherwise.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002057 *
2058 * @remarks This function may be called from secondary threads.
2059 *
Camilla Berglund2d5fb772013-03-18 19:11:02 +01002060 * @note As this functions searches one or more extension strings on each call,
2061 * it is recommended that you cache its results if it's going to be used
Camilla Berglund8282a8f2013-04-10 23:01:12 +02002062 * frequently. The extension strings will not change during the lifetime of
Camilla Berglund2d5fb772013-03-18 19:11:02 +01002063 * a context, so there is no danger in doing this.
Camilla Berglunde248fb62013-03-29 14:06:23 +01002064 *
2065 * @ingroup context
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002066 */
2067GLFWAPI int glfwExtensionSupported(const char* extension);
2068
Camilla Berglund2d5fb772013-03-18 19:11:02 +01002069/*! @brief Returns the address of the specified function for the current
2070 * context.
2071 *
2072 * This function returns the address of the specified client API function, if
2073 * it is supported by the current context.
2074 *
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002075 * @param[in] procname The ASCII encoded name of the function.
Camilla Berglund71d2b572013-03-12 15:33:05 +01002076 * @return The address of the function, or `NULL` if the function is
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002077 * unavailable.
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002078 *
2079 * @remarks This function may be called from secondary threads.
Camilla Berglund2d5fb772013-03-18 19:11:02 +01002080 *
2081 * @note The addresses of these functions are not guaranteed to be the same for
2082 * all contexts, especially if they use different client APIs or even different
2083 * context creation hints.
2084 *
2085 * @ingroup context
Camilla Berglundbce2cd62012-11-22 16:38:24 +01002086 */
Camilla Berglundbf42c3c2012-06-05 00:16:40 +02002087GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname);
Camilla Berglund3249f812010-09-07 17:34:51 +02002088
Camilla Berglund3249f812010-09-07 17:34:51 +02002089
Camilla Berglund4afc67c2011-07-27 17:09:17 +02002090/*************************************************************************
2091 * Global definition cleanup
2092 *************************************************************************/
2093
2094/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */
2095
Camilla Berglund4afc67c2011-07-27 17:09:17 +02002096#ifdef GLFW_WINGDIAPI_DEFINED
2097 #undef WINGDIAPI
2098 #undef GLFW_WINGDIAPI_DEFINED
2099#endif
2100
2101#ifdef GLFW_CALLBACK_DEFINED
2102 #undef CALLBACK
2103 #undef GLFW_CALLBACK_DEFINED
2104#endif
2105
2106/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */
2107
2108
Camilla Berglund3249f812010-09-07 17:34:51 +02002109#ifdef __cplusplus
2110}
2111#endif
2112
Camilla Berglundf8df91d2013-01-15 01:59:56 +01002113#endif /* _glfw3_h_ */
Camilla Berglund3249f812010-09-07 17:34:51 +02002114