grakopro/dependencies/glfw-3.3.8.bin.WIN64/docs/html/group__init.html

546 lines
37 KiB
HTML
Raw Normal View History

2024-01-23 02:09:19 +01:00
<!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&amp;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&amp;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> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<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">&#160;</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">&#160;</td><td class="mdescRight">Error codes. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</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&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga2744fbb29b5631bb28802dbe0cf36eba">GLFW_TRUE</a>&#160;&#160;&#160;1</td></tr>
<tr class="memdesc:ga2744fbb29b5631bb28802dbe0cf36eba"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:gac877fe3b627d21ef3a0a23e0a73ba8c5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#gac877fe3b627d21ef3a0a23e0a73ba8c5">GLFW_FALSE</a>&#160;&#160;&#160;0</td></tr>
<tr class="memdesc:gac877fe3b627d21ef3a0a23e0a73ba8c5"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:gab9c0534709fda03ec8959201da3a9a18"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#gab9c0534709fda03ec8959201da3a9a18">GLFW_JOYSTICK_HAT_BUTTONS</a>&#160;&#160;&#160;0x00050001</td></tr>
<tr class="memdesc:gab9c0534709fda03ec8959201da3a9a18"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:gab937983147a3158d45f88fad7129d9f2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#gab937983147a3158d45f88fad7129d9f2">GLFW_COCOA_CHDIR_RESOURCES</a>&#160;&#160;&#160;0x00051001</td></tr>
<tr class="memdesc:gab937983147a3158d45f88fad7129d9f2"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:ga71e0b4ce2f2696a84a9b8c5e12dc70cf"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga71e0b4ce2f2696a84a9b8c5e12dc70cf">GLFW_COCOA_MENUBAR</a>&#160;&#160;&#160;0x00051002</td></tr>
<tr class="memdesc:ga71e0b4ce2f2696a84a9b8c5e12dc70cf"><td class="mdescLeft">&#160;</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">&#160;</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(*&#160;</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">&#160;</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">&#160;</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&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:gaaae48c0a18607ea4a4ba951d939f0901"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:ga110fd1d3f0412822b4f1908c026f724a"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:ga9f8ffaacf3c269cc48eafbf8b9b71197"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:ga026abd003c8e6501981ab1662062f1c0"><td class="memItemLeft" align="right" valign="top">const char *&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:ga944986b4ec0b928d488141f92982aa18"><td class="memItemLeft" align="right" valign="top">int&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:gaff45816610d53f0b83656092a4034f40"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">GLFWerrorfun</a>&#160;</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">&#160;</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">&#160;</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">&#9670;&nbsp;</a></span>GLFW_VERSION_MAJOR</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_VERSION_MAJOR&#160;&#160;&#160;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">&#9670;&nbsp;</a></span>GLFW_VERSION_MINOR</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_VERSION_MINOR&#160;&#160;&#160;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">&#9670;&nbsp;</a></span>GLFW_VERSION_REVISION</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_VERSION_REVISION&#160;&#160;&#160;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">&#9670;&nbsp;</a></span>GLFW_TRUE</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_TRUE&#160;&#160;&#160;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">&#9670;&nbsp;</a></span>GLFW_FALSE</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_FALSE&#160;&#160;&#160;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">&#9670;&nbsp;</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&#160;&#160;&#160;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">&#9670;&nbsp;</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&#160;&#160;&#160;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">&#9670;&nbsp;</a></span>GLFW_COCOA_MENUBAR</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GLFW_COCOA_MENUBAR&#160;&#160;&#160;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">&#9670;&nbsp;</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">&#9670;&nbsp;</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&#160;</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">&#9670;&nbsp;</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&#160;</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">&#9670;&nbsp;</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&#160;</td>
<td class="paramname"><em>hint</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>value</em>&#160;</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">&#9670;&nbsp;</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 *&#160;</td>
<td class="paramname"><em>major</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>minor</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>rev</em>&#160;</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">&#9670;&nbsp;</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&#160;</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">&#9670;&nbsp;</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 **&#160;</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">&#9670;&nbsp;</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>&#160;</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>