1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<title>GLFW: Initialization, version and error reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<div class="glfwheader">
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
<ul class="glfwnavbar">
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
<li><a href="https://www.glfw.org/download.html">Download</a></li>
<li><a href="https://www.glfw.org/community.html">Community</a></li>
</ul>
</div>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#groups">Modules</a> |
<a href="#define-members">Macros</a> |
<a href="#typedef-members">Typedefs</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">Initialization, version and error reference</div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
<p >This is the reference documentation for initialization and termination of the library, version management and error handling. For more task-oriented information, see the <a class="el" href="intro_guide.html">Introduction to the API</a>. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
Modules</h2></td></tr>
<tr class="memitem:group__errors"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__errors.html">Error codes</a></td></tr>
<tr class="memdesc:group__errors"><td class="mdescLeft"> </td><td class="mdescRight">Error codes. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga2744fbb29b5631bb28802dbe0cf36eba"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga2744fbb29b5631bb28802dbe0cf36eba">GLFW_TRUE</a>   1</td></tr>
<tr class="memdesc:ga2744fbb29b5631bb28802dbe0cf36eba"><td class="mdescLeft"> </td><td class="mdescRight">One. <a href="group__init.html#ga2744fbb29b5631bb28802dbe0cf36eba">More...</a><br /></td></tr>
<tr class="separator:ga2744fbb29b5631bb28802dbe0cf36eba"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac877fe3b627d21ef3a0a23e0a73ba8c5"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#gac877fe3b627d21ef3a0a23e0a73ba8c5">GLFW_FALSE</a>   0</td></tr>
<tr class="memdesc:gac877fe3b627d21ef3a0a23e0a73ba8c5"><td class="mdescLeft"> </td><td class="mdescRight">Zero. <a href="group__init.html#gac877fe3b627d21ef3a0a23e0a73ba8c5">More...</a><br /></td></tr>
<tr class="separator:gac877fe3b627d21ef3a0a23e0a73ba8c5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gab9c0534709fda03ec8959201da3a9a18"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#gab9c0534709fda03ec8959201da3a9a18">GLFW_JOYSTICK_HAT_BUTTONS</a>   0x00050001</td></tr>
<tr class="memdesc:gab9c0534709fda03ec8959201da3a9a18"><td class="mdescLeft"> </td><td class="mdescRight">Joystick hat buttons init hint. <a href="group__init.html#gab9c0534709fda03ec8959201da3a9a18">More...</a><br /></td></tr>
<tr class="separator:gab9c0534709fda03ec8959201da3a9a18"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gab937983147a3158d45f88fad7129d9f2"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#gab937983147a3158d45f88fad7129d9f2">GLFW_COCOA_CHDIR_RESOURCES</a>   0x00051001</td></tr>
<tr class="memdesc:gab937983147a3158d45f88fad7129d9f2"><td class="mdescLeft"> </td><td class="mdescRight">macOS specific init hint. <a href="group__init.html#gab937983147a3158d45f88fad7129d9f2">More...</a><br /></td></tr>
<tr class="separator:gab937983147a3158d45f88fad7129d9f2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga71e0b4ce2f2696a84a9b8c5e12dc70cf"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga71e0b4ce2f2696a84a9b8c5e12dc70cf">GLFW_COCOA_MENUBAR</a>   0x00051002</td></tr>
<tr class="memdesc:ga71e0b4ce2f2696a84a9b8c5e12dc70cf"><td class="mdescLeft"> </td><td class="mdescRight">macOS specific init hint. <a href="group__init.html#ga71e0b4ce2f2696a84a9b8c5e12dc70cf">More...</a><br /></td></tr>
<tr class="separator:ga71e0b4ce2f2696a84a9b8c5e12dc70cf"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga8184701785c096b3862a75cda1bf44a3"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">GLFWerrorfun</a>) (int error_code, const char *description)</td></tr>
<tr class="memdesc:ga8184701785c096b3862a75cda1bf44a3"><td class="mdescLeft"> </td><td class="mdescRight">The function pointer type for error callbacks. <a href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">More...</a><br /></td></tr>
<tr class="separator:ga8184701785c096b3862a75cda1bf44a3"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga317aac130a235ab08c6db0834907d85e"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a> (void)</td></tr>
<tr class="memdesc:ga317aac130a235ab08c6db0834907d85e"><td class="mdescLeft"> </td><td class="mdescRight">Initializes the GLFW library. <a href="group__init.html#ga317aac130a235ab08c6db0834907d85e">More...</a><br /></td></tr>
<tr class="separator:ga317aac130a235ab08c6db0834907d85e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaaae48c0a18607ea4a4ba951d939f0901"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a> (void)</td></tr>
<tr class="memdesc:gaaae48c0a18607ea4a4ba951d939f0901"><td class="mdescLeft"> </td><td class="mdescRight">Terminates the GLFW library. <a href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">More...</a><br /></td></tr>
<tr class="separator:gaaae48c0a18607ea4a4ba951d939f0901"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga110fd1d3f0412822b4f1908c026f724a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a> (int hint, int value)</td></tr>
<tr class="memdesc:ga110fd1d3f0412822b4f1908c026f724a"><td class="mdescLeft"> </td><td class="mdescRight">Sets the specified init hint to the desired value. <a href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">More...</a><br /></td></tr>
<tr class="separator:ga110fd1d3f0412822b4f1908c026f724a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga9f8ffaacf3c269cc48eafbf8b9b71197"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a> (int *major, int *minor, int *rev)</td></tr>
<tr class="memdesc:ga9f8ffaacf3c269cc48eafbf8b9b71197"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the version of the GLFW library. <a href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">More...</a><br /></td></tr>
<tr class="separator:ga9f8ffaacf3c269cc48eafbf8b9b71197"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga026abd003c8e6501981ab1662062f1c0"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga026abd003c8e6501981ab1662062f1c0">glfwGetVersionString</a> (void)</td></tr>
<tr class="memdesc:ga026abd003c8e6501981ab1662062f1c0"><td class="mdescLeft"> </td><td class="mdescRight">Returns a string describing the compile-time configuration. <a href="group__init.html#ga026abd003c8e6501981ab1662062f1c0">More...</a><br /></td></tr>
<tr class="separator:ga026abd003c8e6501981ab1662062f1c0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga944986b4ec0b928d488141f92982aa18"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a> (const char **description)</td></tr>
<tr class="memdesc:ga944986b4ec0b928d488141f92982aa18"><td class="mdescLeft"> </td><td class="mdescRight">Returns and clears the last error for the calling thread. <a href="group__init.html#ga944986b4ec0b928d488141f92982aa18">More...</a><br /></td></tr>
<tr class="separator:ga944986b4ec0b928d488141f92982aa18"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaff45816610d53f0b83656092a4034f40"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">GLFWerrorfun</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#gaff45816610d53f0b83656092a4034f40">glfwSetErrorCallback</a> (<a class="el" href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">GLFWerrorfun</a> callback)</td></tr>
<tr class="memdesc:gaff45816610d53f0b83656092a4034f40"><td class="mdescLeft"> </td><td class="mdescRight">Sets the error callback. <a href="group__init.html#gaff45816610d53f0b83656092a4034f40">More...</a><br /></td></tr>
<tr class="separator:gaff45816610d53f0b83656092a4034f40"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga6337d9ea43b22fc529b2bba066b4a576" name="ga6337d9ea43b22fc529b2bba066b4a576"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6337d9ea43b22fc529b2bba066b4a576">◆ </a></span>GLFW_VERSION_MAJOR</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_VERSION_MAJOR   3</td>
</tr>
</table>
</div><div class="memdoc">
<p >The major version number of the GLFW header. This is incremented when the API is changed in non-compatible ways. </p>
</div>
</div>
<a id="gaf80d40f0aea7088ff337606e9c48f7a3" name="gaf80d40f0aea7088ff337606e9c48f7a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf80d40f0aea7088ff337606e9c48f7a3">◆ </a></span>GLFW_VERSION_MINOR</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_VERSION_MINOR   3</td>
</tr>
</table>
</div><div class="memdoc">
<p >The minor version number of the GLFW header. This is incremented when features are added to the API but it remains backward-compatible. </p>
</div>
</div>
<a id="gab72ae2e2035d9ea461abc3495eac0502" name="gab72ae2e2035d9ea461abc3495eac0502"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab72ae2e2035d9ea461abc3495eac0502">◆ </a></span>GLFW_VERSION_REVISION</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_VERSION_REVISION   8</td>
</tr>
</table>
</div><div class="memdoc">
<p >The revision number of the GLFW header. This is incremented when a bug fix release is made that does not contain any API changes. </p>
</div>
</div>
<a id="ga2744fbb29b5631bb28802dbe0cf36eba" name="ga2744fbb29b5631bb28802dbe0cf36eba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2744fbb29b5631bb28802dbe0cf36eba">◆ </a></span>GLFW_TRUE</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_TRUE   1</td>
</tr>
</table>
</div><div class="memdoc">
<p >This is only semantic sugar for the number 1. You can instead use <code>1</code> or <code>true</code> or <code>_True</code> or <code>GL_TRUE</code> or <code>VK_TRUE</code> or anything else that is equal to one. </p>
</div>
</div>
<a id="gac877fe3b627d21ef3a0a23e0a73ba8c5" name="gac877fe3b627d21ef3a0a23e0a73ba8c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac877fe3b627d21ef3a0a23e0a73ba8c5">◆ </a></span>GLFW_FALSE</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_FALSE   0</td>
</tr>
</table>
</div><div class="memdoc">
<p >This is only semantic sugar for the number 0. You can instead use <code>0</code> or <code>false</code> or <code>_False</code> or <code>GL_FALSE</code> or <code>VK_FALSE</code> or anything else that is equal to zero. </p>
</div>
</div>
<a id="gab9c0534709fda03ec8959201da3a9a18" name="gab9c0534709fda03ec8959201da3a9a18"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab9c0534709fda03ec8959201da3a9a18">◆ </a></span>GLFW_JOYSTICK_HAT_BUTTONS</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_JOYSTICK_HAT_BUTTONS   0x00050001</td>
</tr>
</table>
</div><div class="memdoc">
<p >Joystick hat buttons <a class="el" href="intro_guide.html#GLFW_JOYSTICK_HAT_BUTTONS">init hint</a>. </p>
</div>
</div>
<a id="gab937983147a3158d45f88fad7129d9f2" name="gab937983147a3158d45f88fad7129d9f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab937983147a3158d45f88fad7129d9f2">◆ </a></span>GLFW_COCOA_CHDIR_RESOURCES</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_COCOA_CHDIR_RESOURCES   0x00051001</td>
</tr>
</table>
</div><div class="memdoc">
<p >macOS specific <a class="el" href="intro_guide.html#GLFW_COCOA_CHDIR_RESOURCES_hint">init hint</a>. </p>
</div>
</div>
<a id="ga71e0b4ce2f2696a84a9b8c5e12dc70cf" name="ga71e0b4ce2f2696a84a9b8c5e12dc70cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga71e0b4ce2f2696a84a9b8c5e12dc70cf">◆ </a></span>GLFW_COCOA_MENUBAR</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_COCOA_MENUBAR   0x00051002</td>
</tr>
</table>
</div><div class="memdoc">
<p >macOS specific <a class="el" href="intro_guide.html#GLFW_COCOA_MENUBAR_hint">init hint</a>. </p>
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga8184701785c096b3862a75cda1bf44a3" name="ga8184701785c096b3862a75cda1bf44a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8184701785c096b3862a75cda1bf44a3">◆ </a></span>GLFWerrorfun</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* GLFWerrorfun) (int error_code, const char *description)</td>
</tr>
</table>
</div><div class="memdoc">
<p >This is the function pointer type for error callbacks. An error callback function has the following signature: </p><div class="fragment"><div class="line"><span class="keywordtype">void</span> callback_name(<span class="keywordtype">int</span> error_code, <span class="keyword">const</span> <span class="keywordtype">char</span>* description)</div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">error_code</td><td>An <a class="el" href="group__errors.html">error code</a>. Future releases may add more error codes. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">description</td><td>A UTF-8 encoded string describing the error.</td></tr>
</table>
</dd>
</dl>
<dl class="section user"><dt>Pointer lifetime</dt><dd>The error description string is valid until the callback function returns.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#error_handling">Error handling</a> </dd>
<dd>
<a class="el" href="group__init.html#gaff45816610d53f0b83656092a4034f40">glfwSetErrorCallback</a></dd></dl>
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga317aac130a235ab08c6db0834907d85e" name="ga317aac130a235ab08c6db0834907d85e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga317aac130a235ab08c6db0834907d85e">◆ </a></span>glfwInit()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int glfwInit </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p >This function initializes the GLFW library. Before most GLFW functions can be used, GLFW must be initialized, and before an application terminates GLFW should be terminated in order to free any resources allocated during or after initialization.</p>
<p >If this function fails, it calls <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a> before returning. If it succeeds, you should call <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a> before the application exits.</p>
<p >Additional calls to this function after successful initialization but before termination will return <code>GLFW_TRUE</code> immediately.</p>
<dl class="section return"><dt>Returns</dt><dd><code>GLFW_TRUE</code> if successful, or <code>GLFW_FALSE</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd><b>macOS:</b> This function will change the current directory of the application to the <code>Contents/Resources</code> subdirectory of the application's bundle, if present. This can be disabled with the <a class="el" href="group__init.html#gab937983147a3158d45f88fad7129d9f2">GLFW_COCOA_CHDIR_RESOURCES</a> init hint.</dd>
<dd>
<b>X11:</b> This function will set the <code>LC_CTYPE</code> category of the application locale according to the current environment if that category is still "C". This is because the "C" locale breaks Unicode text input.</dd></dl>
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#intro_init">Initialization and termination</a> </dd>
<dd>
<a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a></dd></dl>
<dl class="section since"><dt>Since</dt><dd>Added in version 1.0. </dd></dl>
</div>
</div>
<a id="gaaae48c0a18607ea4a4ba951d939f0901" name="gaaae48c0a18607ea4a4ba951d939f0901"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaae48c0a18607ea4a4ba951d939f0901">◆ </a></span>glfwTerminate()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void glfwTerminate </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p >This function destroys all remaining windows and cursors, restores any modified gamma ramps and frees any other allocated resources. Once this function is called, you must again call <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a> successfully before you will be able to use most GLFW functions.</p>
<p >If GLFW has been successfully initialized, this function should be called before the application exits. If initialization fails, there is no need to call this function, as it is called by <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a> before it returns failure.</p>
<p >This function has no effect if GLFW is not initialized.</p>
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>This function may be called before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>.</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>The contexts of any remaining windows must not be current on any other thread when this function is called.</dd></dl>
<dl class="section user"><dt>Reentrancy</dt><dd>This function must not be called from a callback.</dd></dl>
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#intro_init">Initialization and termination</a> </dd>
<dd>
<a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a></dd></dl>
<dl class="section since"><dt>Since</dt><dd>Added in version 1.0. </dd></dl>
</div>
</div>
<a id="ga110fd1d3f0412822b4f1908c026f724a" name="ga110fd1d3f0412822b4f1908c026f724a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga110fd1d3f0412822b4f1908c026f724a">◆ </a></span>glfwInitHint()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void glfwInitHint </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>hint</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p >This function sets hints for the next initialization of GLFW.</p>
<p >The values you set hints to are never reset by GLFW, but they only take effect during initialization. Once GLFW has been initialized, any values you set will be ignored until the library is terminated and initialized again.</p>
<p >Some hints are platform specific. These may be set on any platform but they will only affect their specific platform. Other platforms will ignore them. Setting these hints requires no platform specific headers or functions.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">hint</td><td>The <a class="el" href="intro_guide.html#init_hints">init hint</a> to set. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The new value of the init hint.</td></tr>
</table>
</dd>
</dl>
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga76f6bb9c4eea73db675f096b404593ce">GLFW_INVALID_ENUM</a> and <a class="el" href="group__errors.html#gaaf2ef9aa8202c2b82ac2d921e554c687">GLFW_INVALID_VALUE</a>.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>This function may be called before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>.</dd></dl>
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
<dl class="section see"><dt>See also</dt><dd>init_hints </dd>
<dd>
<a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e" title="Initializes the GLFW library.">glfwInit</a></dd></dl>
<dl class="section since"><dt>Since</dt><dd>Added in version 3.3. </dd></dl>
</div>
</div>
<a id="ga9f8ffaacf3c269cc48eafbf8b9b71197" name="ga9f8ffaacf3c269cc48eafbf8b9b71197"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9f8ffaacf3c269cc48eafbf8b9b71197">◆ </a></span>glfwGetVersion()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void glfwGetVersion </td>
<td>(</td>
<td class="paramtype">int * </td>
<td class="paramname"><em>major</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>minor</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>rev</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p >This function retrieves the major, minor and revision numbers of the GLFW library. It is intended for when you are using GLFW as a shared library and want to ensure that you are using the minimum required version.</p>
<p >Any or all of the version arguments may be <code>NULL</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">major</td><td>Where to store the major version number, or <code>NULL</code>. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">minor</td><td>Where to store the minor version number, or <code>NULL</code>. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">rev</td><td>Where to store the revision number, or <code>NULL</code>.</td></tr>
</table>
</dd>
</dl>
<dl class="section user"><dt>Errors</dt><dd>None.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>This function may be called before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>.</dd></dl>
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#intro_version">Version management</a> </dd>
<dd>
<a class="el" href="group__init.html#ga026abd003c8e6501981ab1662062f1c0">glfwGetVersionString</a></dd></dl>
<dl class="section since"><dt>Since</dt><dd>Added in version 1.0. </dd></dl>
</div>
</div>
<a id="ga026abd003c8e6501981ab1662062f1c0" name="ga026abd003c8e6501981ab1662062f1c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga026abd003c8e6501981ab1662062f1c0">◆ </a></span>glfwGetVersionString()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char * glfwGetVersionString </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p >This function returns the compile-time generated <a class="el" href="intro_guide.html#intro_version_string">version string</a> of the GLFW library binary. It describes the version, platform, compiler and any platform-specific compile-time options. It should not be confused with the OpenGL or OpenGL ES version string, queried with <code>glGetString</code>.</p>
<p ><b>Do not use the version string</b> to parse the GLFW library version. The <a class="el" href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a> function provides the version of the running library binary in numerical format.</p>
<dl class="section return"><dt>Returns</dt><dd>The ASCII encoded GLFW version string.</dd></dl>
<dl class="section user"><dt>Errors</dt><dd>None.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>This function may be called before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>.</dd></dl>
<dl class="section user"><dt>Pointer lifetime</dt><dd>The returned string is static and compile-time generated.</dd></dl>
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#intro_version">Version management</a> </dd>
<dd>
<a class="el" href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a></dd></dl>
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
</div>
</div>
<a id="ga944986b4ec0b928d488141f92982aa18" name="ga944986b4ec0b928d488141f92982aa18"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga944986b4ec0b928d488141f92982aa18">◆ </a></span>glfwGetError()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int glfwGetError </td>
<td>(</td>
<td class="paramtype">const char ** </td>
<td class="paramname"><em>description</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p >This function returns and clears the <a class="el" href="group__errors.html">error code</a> of the last error that occurred on the calling thread, and optionally a UTF-8 encoded human-readable description of it. If no error has occurred since the last call, it returns <a class="el" href="group__errors.html#gafa30deee5db4d69c4c93d116ed87dbf4">GLFW_NO_ERROR</a> (zero) and the description pointer is set to <code>NULL</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">description</td><td>Where to store the error description pointer, or <code>NULL</code>. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The last error code for the calling thread, or <a class="el" href="group__errors.html#gafa30deee5db4d69c4c93d116ed87dbf4">GLFW_NO_ERROR</a> (zero).</dd></dl>
<dl class="section user"><dt>Errors</dt><dd>None.</dd></dl>
<dl class="section user"><dt>Pointer lifetime</dt><dd>The returned string is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the next error occurs or the library is terminated.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>This function may be called before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>.</dd></dl>
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#error_handling">Error handling</a> </dd>
<dd>
<a class="el" href="group__init.html#gaff45816610d53f0b83656092a4034f40">glfwSetErrorCallback</a></dd></dl>
<dl class="section since"><dt>Since</dt><dd>Added in version 3.3. </dd></dl>
</div>
</div>
<a id="gaff45816610d53f0b83656092a4034f40" name="gaff45816610d53f0b83656092a4034f40"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaff45816610d53f0b83656092a4034f40">◆ </a></span>glfwSetErrorCallback()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">GLFWerrorfun</a> glfwSetErrorCallback </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">GLFWerrorfun</a> </td>
<td class="paramname"><em>callback</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p >This function sets the error callback, which is called with an error code and a human-readable description each time a GLFW error occurs.</p>
<p >The error code is set before the callback is called. Calling <a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a> from the error callback will return the same value as the error code argument.</p>
<p >The error callback is called on the thread where the error occurred. If you are using GLFW from multiple threads, your error callback needs to be written accordingly.</p>
<p >Because the description string may have been generated specifically for that error, it is not guaranteed to be valid after the callback has returned. If you wish to use it after the callback returns, you need to make a copy.</p>
<p >Once set, the error callback remains set even after the library has been terminated.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>The new callback, or <code>NULL</code> to remove the currently set callback. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The previously set callback, or <code>NULL</code> if no callback was set.</dd></dl>
<dl class="section user"><dt>Callback signature</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> callback_name(<span class="keywordtype">int</span> error_code, <span class="keyword">const</span> <span class="keywordtype">char</span>* description)</div>
</div><!-- fragment --> For more information about the callback parameters, see the <a class="el" href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">callback pointer type</a>.</dd></dl>
<dl class="section user"><dt>Errors</dt><dd>None.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>This function may be called before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>.</dd></dl>
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#error_handling">Error handling</a> </dd>
<dd>
<a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a></dd></dl>
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
</div>
</div>
</div><!-- contents -->
<address class="footer">
<p>
Last update on Fri Jul 22 2022 for GLFW 3.3.8
</p>
</address>
</body>
</html>
|