mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 13:59:19 +02:00
maintenance: glew update to v 2.1.0, glfw update to v3.3
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen 1.8.11"/>
|
||||
<meta name="generator" content="Doxygen 1.8.15"/>
|
||||
<title>GLFW: Introduction to the API</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
@@ -11,9 +11,6 @@
|
||||
<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>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() { init_search(); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
@@ -21,45 +18,31 @@
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<div class="glfwheader">
|
||||
<a href="http://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||
<ul class="glfwnavbar">
|
||||
<li><a href="http://www.glfw.org/documentation.html">Documentation</a></li>
|
||||
<li><a href="http://www.glfw.org/download.html">Download</a></li>
|
||||
<li><a href="http://www.glfw.org/media.html">Media</a></li>
|
||||
<li><a href="http://www.glfw.org/community.html">Community</a></li>
|
||||
<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.8.11 -->
|
||||
<!-- Generated by Doxygen 1.8.15 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||
<li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
|
||||
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
||||
<li><a href="files.html"><span>Files</span></a></li>
|
||||
<li>
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<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:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(document).ready(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */</script>
|
||||
<div id="main-nav"></div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
@@ -75,13 +58,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
</div>
|
||||
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="PageDoc"><div class="header">
|
||||
<div class="headertitle">
|
||||
<div class="title">Introduction to the API </div> </div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="toc"><h3>Table of Contents</h3>
|
||||
<ul><li class="level1"><a href="#intro_init">Initialization and termination</a><ul><li class="level2"><a href="#intro_init_init">Initializing GLFW</a></li>
|
||||
<li class="level2"><a href="#init_hints">Initialization hints</a><ul><li class="level3"><a href="#init_hints_shared">Shared init hints</a></li>
|
||||
<li class="level3"><a href="#init_hints_osx">macOS specific init hints</a></li>
|
||||
<li class="level3"><a href="#init_hints_values">Supported and default values</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="level2"><a href="#intro_init_terminate">Terminating GLFW</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -117,7 +105,9 @@ Initialization and termination</h1>
|
||||
<ul>
|
||||
<li><a class="el" href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a></li>
|
||||
<li><a class="el" href="group__init.html#ga23d47dc013fce2bf58036da66079a657">glfwGetVersionString</a></li>
|
||||
<li><a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a></li>
|
||||
<li><a class="el" href="group__init.html#gaa5d796c3cf7c1a7f02f845486333fb5f">glfwSetErrorCallback</a></li>
|
||||
<li><a class="el" href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a></li>
|
||||
<li><a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a></li>
|
||||
<li><a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a></li>
|
||||
</ul>
|
||||
@@ -125,8 +115,32 @@ Initialization and termination</h1>
|
||||
<h2><a class="anchor" id="intro_init_init"></a>
|
||||
Initializing GLFW</h2>
|
||||
<p>The library is initialized with <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>, which returns <code>GLFW_FALSE</code> if an error occurred.</p>
|
||||
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (!<a class="code" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>())</div><div class="line">{</div><div class="line"> <span class="comment">// Handle initialization failure</span></div><div class="line">}</div></div><!-- fragment --><p>If any part of initialization fails, any parts that succeeded are terminated as if <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a> had been called. The library only needs to be initialized once and additional calls to an already initialized library will simply return <code>GLFW_TRUE</code> immediately.</p>
|
||||
<p>Once the library has been successfully initialized, it should be terminated before the application exits. Modern systems are very good at freeing resources allocated by programs that simply exit, but GLFW sometimes has to change global system settings and these might not be restored without termination.</p>
|
||||
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (!<a class="code" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>())</div><div class="line">{</div><div class="line"> <span class="comment">// Handle initialization failure</span></div><div class="line">}</div></div><!-- fragment --><p>If any part of initialization fails, any parts that succeeded are terminated as if <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a> had been called. The library only needs to be initialized once and additional calls to an already initialized library will return <code>GLFW_TRUE</code> immediately.</p>
|
||||
<p>Once the library has been successfully initialized, it should be terminated before the application exits. Modern systems are very good at freeing resources allocated by programs that exit, but GLFW sometimes has to change global system settings and these might not be restored without termination.</p>
|
||||
<h2><a class="anchor" id="init_hints"></a>
|
||||
Initialization hints</h2>
|
||||
<p>Initialization hints are set before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a> and affect how the library behaves until termination. Hints are set with <a class="el" href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a>.</p>
|
||||
<div class="fragment"><div class="line"><a class="code" href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a>(<a class="code" href="group__init.html#gab9c0534709fda03ec8959201da3a9a18">GLFW_JOYSTICK_HAT_BUTTONS</a>, <a class="code" href="group__init.html#gac877fe3b627d21ef3a0a23e0a73ba8c5">GLFW_FALSE</a>);</div></div><!-- fragment --><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>
|
||||
<h3><a class="anchor" id="init_hints_shared"></a>
|
||||
Shared init hints</h3>
|
||||
<p><a class="anchor" id="GLFW_JOYSTICK_HAT_BUTTONS"></a><b>GLFW_JOYSTICK_HAT_BUTTONS</b> specifies whether to also expose joystick hats as buttons, for compatibility with earlier versions of GLFW that did not have <a class="el" href="group__input.html#ga2d8d0634bb81c180899aeb07477a67ea">glfwGetJoystickHats</a>. Set this with <a class="el" href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a>.</p>
|
||||
<h3><a class="anchor" id="init_hints_osx"></a>
|
||||
macOS specific init hints</h3>
|
||||
<p><a class="anchor" id="GLFW_COCOA_CHDIR_RESOURCES_hint"></a><b>GLFW_COCOA_CHDIR_RESOURCES</b> specifies whether to set the current directory to the application to the <code>Contents/Resources</code> subdirectory of the application's bundle, if present. Set this with <a class="el" href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a>.</p>
|
||||
<p><a class="anchor" id="GLFW_COCOA_MENUBAR_hint"></a><b>GLFW_COCOA_MENUBAR</b> specifies whether to create a basic menu bar, either from a nib or manually, when the first window is created, which is when AppKit is initialized. Set this with <a class="el" href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a>.</p>
|
||||
<h3><a class="anchor" id="init_hints_values"></a>
|
||||
Supported and default values</h3>
|
||||
<table class="markdownTable">
|
||||
<tr class="markdownTableHead">
|
||||
<th class="markdownTableHeadNone">Initialization hint </th><th class="markdownTableHeadNone">Default value </th><th class="markdownTableHeadNone">Supported values </th></tr>
|
||||
<tr class="markdownTableRowOdd">
|
||||
<td class="markdownTableBodyNone"><a class="el" href="intro_guide.html#GLFW_JOYSTICK_HAT_BUTTONS">GLFW_JOYSTICK_HAT_BUTTONS</a> </td><td class="markdownTableBodyNone"><code>GLFW_TRUE</code> </td><td class="markdownTableBodyNone"><code>GLFW_TRUE</code> or <code>GLFW_FALSE</code> </td></tr>
|
||||
<tr class="markdownTableRowEven">
|
||||
<td class="markdownTableBodyNone"><a class="el" href="group__init.html#gab937983147a3158d45f88fad7129d9f2">GLFW_COCOA_CHDIR_RESOURCES</a> </td><td class="markdownTableBodyNone"><code>GLFW_TRUE</code> </td><td class="markdownTableBodyNone"><code>GLFW_TRUE</code> or <code>GLFW_FALSE</code> </td></tr>
|
||||
<tr class="markdownTableRowOdd">
|
||||
<td class="markdownTableBodyNone"><a class="el" href="group__init.html#ga71e0b4ce2f2696a84a9b8c5e12dc70cf">GLFW_COCOA_MENUBAR</a> </td><td class="markdownTableBodyNone"><code>GLFW_TRUE</code> </td><td class="markdownTableBodyNone"><code>GLFW_TRUE</code> or <code>GLFW_FALSE</code> </td></tr>
|
||||
</table>
|
||||
<h2><a class="anchor" id="intro_init_terminate"></a>
|
||||
Terminating GLFW</h2>
|
||||
<p>Before your application exits, you should terminate the GLFW library if it has been initialized. This is done with <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a>.</p>
|
||||
@@ -134,21 +148,26 @@ Terminating GLFW</h2>
|
||||
<p>Once the library is terminated, it is as if it had never been initialized and you will need to initialize it again before being able to use GLFW. If the library was not initialized or had already been terminated, it return immediately.</p>
|
||||
<h1><a class="anchor" id="error_handling"></a>
|
||||
Error handling</h1>
|
||||
<p>Some GLFW functions have return values that indicate an error, but this is often not very helpful when trying to figure out <em>why</em> the error occurred. Some functions also return otherwise valid values on error. Finally, far from all GLFW functions have return values.</p>
|
||||
<p>This is where the error callback comes in. This callback is called whenever an error occurs. It is set with <a class="el" href="group__init.html#gaa5d796c3cf7c1a7f02f845486333fb5f">glfwSetErrorCallback</a>, a function that may be called regardless of whether GLFW is initialized.</p>
|
||||
<div class="fragment"><div class="line"><a class="code" href="group__init.html#gaa5d796c3cf7c1a7f02f845486333fb5f">glfwSetErrorCallback</a>(error_callback);</div></div><!-- fragment --><p>The error callback receives a human-readable description of the error and (when possible) its cause. The description encoded as UTF-8. The callback is also provided with an <a class="el" href="group__errors.html">error code</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="keywordtype">void</span> error_callback(<span class="keywordtype">int</span> error, <span class="keyword">const</span> <span class="keywordtype">char</span>* description)</div><div class="line">{</div><div class="line"> puts(description);</div><div class="line">}</div></div><!-- fragment --><p>The error code indicates the general category of the error. Some error codes, such as <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> has only a single meaning, whereas others like <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a> are used for many different errors.</p>
|
||||
<p>The description string is only valid until the error callback returns, as it may have been generated specifically for that error. This lets GLFW provide much more specific error descriptions but means you must make a copy if you want to keep the description string.</p>
|
||||
<dl class="section note"><dt>Note</dt><dd>Relying on erroneous behavior is not forward compatible. In other words, do not rely on a currently invalid call to generate a specific error, as that same call may in future versions generate a different error or become valid.</dd></dl>
|
||||
<p>Some GLFW functions have return values that indicate an error, but this is often not very helpful when trying to figure out what happened or why it occurred. Other functions have no return value reserved for errors, so error notification needs a separate channel. Finally, far from all GLFW functions have return values.</p>
|
||||
<p>The last <a class="el" href="group__errors.html">error code</a> for the calling thread can be queried at any time with <a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="keywordtype">int</span> code = <a class="code" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a>(NULL);</div><div class="line"></div><div class="line"><span class="keywordflow">if</span> (code != <a class="code" href="group__errors.html#gafa30deee5db4d69c4c93d116ed87dbf4">GLFW_NO_ERROR</a>)</div><div class="line"> handle_error(code);</div></div><!-- fragment --><p>If no error has occurred since the last call, <a class="el" href="group__errors.html#gafa30deee5db4d69c4c93d116ed87dbf4">GLFW_NO_ERROR</a> (zero) is returned. The error is cleared before the function returns.</p>
|
||||
<p>The error code indicates the general category of the error. Some error codes, such as <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> has only a single meaning, whereas others like <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a> are used for many different errors.</p>
|
||||
<p>GLFW often has more information about an error than its general category. You can retrieve a UTF-8 encoded human-readable description along with the error code. If no error has occurred since the last call, the description is set to <code>NULL</code>.</p>
|
||||
<div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span>* description;</div><div class="line"><span class="keywordtype">int</span> code = <a class="code" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a>(&description);</div><div class="line"></div><div class="line"><span class="keywordflow">if</span> (description)</div><div class="line"> display_error_message(code, description);</div></div><!-- fragment --><p>The retrieved description string is only valid until the next error occurs. This means you must make a copy of it if you want to keep it.</p>
|
||||
<p>You can also set an error callback, which will be called each time an error occurs. It is set with <a class="el" href="group__init.html#gaa5d796c3cf7c1a7f02f845486333fb5f">glfwSetErrorCallback</a>.</p>
|
||||
<div class="fragment"><div class="line"><a class="code" href="group__init.html#gaa5d796c3cf7c1a7f02f845486333fb5f">glfwSetErrorCallback</a>(error_callback);</div></div><!-- fragment --><p>The error callback receives the same error code and human-readable description returned by <a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="keywordtype">void</span> error_callback(<span class="keywordtype">int</span> code, <span class="keyword">const</span> <span class="keywordtype">char</span>* description)</div><div class="line">{</div><div class="line"> display_error_message(code, description);</div><div class="line">}</div></div><!-- fragment --><p>The error callback is called after the error is stored, so calling <a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a> from within the error callback returns the same values as the callback argument.</p>
|
||||
<p>The description string passed to the callback is only valid until the error callback returns. This means you must make a copy of it if you want to keep it.</p>
|
||||
<p><b>Reported errors are never fatal.</b> As long as GLFW was successfully initialized, it will remain initialized and in a safe state until terminated regardless of how many errors occur. If an error occurs during initialization that causes <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a> to fail, any part of the library that was initialized will be safely terminated.</p>
|
||||
<p>Do not rely on a currently invalid call to generate a specific error, as in the future that same call may generate a different error or become valid.</p>
|
||||
<h1><a class="anchor" id="coordinate_systems"></a>
|
||||
Coordinate systems</h1>
|
||||
<p>GLFW has two primary coordinate systems: the <em>virtual screen</em> and the window <em>client area</em> or <em>content area</em>. Both use the same unit: <em>virtual screen coordinates</em>, or just <em>screen coordinates</em>, which don't necessarily correspond to pixels.</p>
|
||||
<div class="image">
|
||||
<img src="spaces.svg" width="90%"/>
|
||||
</div>
|
||||
<p>Both the virtual screen and the client area coordinate systems have the X-axis pointing to the right and the Y-axis pointing down.</p>
|
||||
<p>Window and monitor positions are specified as the position of the upper-left corners of their content areas relative to the virtual screen, while cursor positions are specified relative to a window's client area.</p>
|
||||
<p>Because the origin of the window's client area coordinate system is also the point from which the window position is specified, you can translate client area coordinates to the virtual screen by adding the window position. The window frame, when present, extends out from the client area but does not affect the window position.</p>
|
||||
<p>GLFW has two primary coordinate systems: the <em>virtual screen</em> and the window <em>content area</em> or <em>content area</em>. Both use the same unit: <em>virtual screen coordinates</em>, or just <em>screen coordinates</em>, which don't necessarily correspond to pixels.</p>
|
||||
<object type="image/svg+xml" data="spaces.svg" width="90%"></object>
|
||||
/>
|
||||
<p>Both the virtual screen and the content area coordinate systems have the X-axis pointing to the right and the Y-axis pointing down.</p>
|
||||
<p>Window and monitor positions are specified as the position of the upper-left corners of their content areas relative to the virtual screen, while cursor positions are specified relative to a window's content area.</p>
|
||||
<p>Because the origin of the window's content area coordinate system is also the point from which the window position is specified, you can translate content area coordinates to the virtual screen by adding the window position. The window frame, when present, extends out from the content area but does not affect the window position.</p>
|
||||
<p>Almost all positions and sizes in GLFW are measured in screen coordinates relative to one of the two origins above. This includes cursor positions, window positions and sizes, window frame sizes, monitor positions and video mode resolutions.</p>
|
||||
<p>Two exceptions are the <a class="el" href="monitor_guide.html#monitor_size">monitor physical size</a>, which is measured in millimetres, and <a class="el" href="window_guide.html#window_fbsize">framebuffer size</a>, which is measured in pixels.</p>
|
||||
<p>Pixels and screen coordinates may map 1:1 on your machine, but they won't on every other machine, for example on a Mac with a Retina display. The ratio between screen coordinates and pixels may also change at run-time depending on which monitor the window is currently considered to be on.</p>
|
||||
@@ -163,12 +182,9 @@ Pointer lifetimes</h2>
|
||||
<p>Pointer lifetimes are guaranteed not to be shortened in future minor or patch releases.</p>
|
||||
<h2><a class="anchor" id="reentrancy"></a>
|
||||
Reentrancy</h2>
|
||||
<p>GLFW event processing and object creation and destruction are not reentrant. This means that the following functions must not be called from any callback function:</p>
|
||||
<p>GLFW event processing and object destruction are not reentrant. This means that the following functions must not be called from any callback function:</p>
|
||||
<ul>
|
||||
<li><a class="el" href="group__window.html#ga5c336fddf2cbb5b92f65f10fb6043344">glfwCreateWindow</a></li>
|
||||
<li><a class="el" href="group__window.html#gacdf43e51376051d2c091662e9fe3d7b2">glfwDestroyWindow</a></li>
|
||||
<li><a class="el" href="group__input.html#gafca356935e10135016aa49ffa464c355">glfwCreateCursor</a></li>
|
||||
<li><a class="el" href="group__input.html#gaa65f416d03ebbbb5b8db71a489fcb894">glfwCreateStandardCursor</a></li>
|
||||
<li><a class="el" href="group__input.html#ga81b952cd1764274d0db7fb3c5a79ba6a">glfwDestroyCursor</a></li>
|
||||
<li><a class="el" href="group__window.html#ga37bd57223967b4211d60ca1a0bf3c832">glfwPollEvents</a></li>
|
||||
<li><a class="el" href="group__window.html#ga554e37d781f0a997656c26b2c56c835e">glfwWaitEvents</a></li>
|
||||
@@ -178,19 +194,26 @@ Reentrancy</h2>
|
||||
<p>These functions may be made reentrant in future minor or patch releases, but functions not on this list will not be made non-reentrant.</p>
|
||||
<h2><a class="anchor" id="thread_safety"></a>
|
||||
Thread safety</h2>
|
||||
<p>Most GLFW functions must only be called from the main thread, but some may be called from any thread. However, no GLFW function may be called from any thread but the main thread until GLFW has been successfully initialized, including functions that may called before initialization.</p>
|
||||
<p>Most GLFW functions must only be called from the main thread (the thread that calls main), but some may be called from any thread once the library has been initialized. Before initialization the whole library is thread-unsafe.</p>
|
||||
<p>The reference documentation for every GLFW function states whether it is limited to the main thread.</p>
|
||||
<p>Initialization and termination, event processing and the creation and destruction of windows, contexts and cursors are all limited to the main thread due to limitations of one or several platforms.</p>
|
||||
<p>Initialization, termination, event processing and the creation and destruction of windows, cursors and OpenGL and OpenGL ES contexts are all restricted to the main thread due to limitations of one or several platforms.</p>
|
||||
<p>Because event processing must be performed on the main thread, all callbacks except for the error callback will only be called on that thread. The error callback may be called on any thread, as any GLFW function may generate errors.</p>
|
||||
<p>The posting of empty events may be done from any thread. The window user pointer and close flag may also be accessed and modified from any thread, but this is not synchronized by GLFW. The following window related functions may be called from any thread:</p>
|
||||
<p>The error code and description may be queried from any thread.</p>
|
||||
<ul>
|
||||
<li><a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a></li>
|
||||
</ul>
|
||||
<p>Empty events may be posted from any thread.</p>
|
||||
<ul>
|
||||
<li><a class="el" href="group__window.html#gab5997a25187e9fd5c6f2ecbbc8dfd7e9">glfwPostEmptyEvent</a></li>
|
||||
</ul>
|
||||
<p>The window user pointer and close flag may be read and written from any thread, but this is not synchronized by GLFW.</p>
|
||||
<ul>
|
||||
<li><a class="el" href="group__window.html#ga17807ce0f45ac3f8bb50d6dcc59a4e06">glfwGetWindowUserPointer</a></li>
|
||||
<li><a class="el" href="group__window.html#ga3d2fc6026e690ab31a13f78bc9fd3651">glfwSetWindowUserPointer</a></li>
|
||||
<li><a class="el" href="group__window.html#ga24e02fbfefbb81fc45320989f8140ab5">glfwWindowShouldClose</a></li>
|
||||
<li><a class="el" href="group__window.html#ga49c449dde2a6f87d996f4daaa09d6708">glfwSetWindowShouldClose</a></li>
|
||||
</ul>
|
||||
<p>Rendering may be done on any thread. The following context related functions may be called from any thread:</p>
|
||||
<p>These functions for working with OpenGL and OpenGL ES contexts may be called from any thread, but the window object is not synchronized by GLFW.</p>
|
||||
<ul>
|
||||
<li><a class="el" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a></li>
|
||||
<li><a class="el" href="group__context.html#gac84759b1f6c2d271a4fea8ae89ec980d">glfwGetCurrentContext</a></li>
|
||||
@@ -199,22 +222,22 @@ Thread safety</h2>
|
||||
<li><a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a></li>
|
||||
<li><a class="el" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a></li>
|
||||
</ul>
|
||||
<p>The raw timer may be queried from any thread. The following raw timer related functions may be called from any thread:</p>
|
||||
<p>The raw timer functions may be called from any thread.</p>
|
||||
<ul>
|
||||
<li><a class="el" href="group__input.html#ga3289ee876572f6e91f06df3a24824443">glfwGetTimerFrequency</a></li>
|
||||
<li><a class="el" href="group__input.html#ga09b2bd37d328e0b9456c7ec575cc26aa">glfwGetTimerValue</a></li>
|
||||
</ul>
|
||||
<p>The regular timer may be used from any thread, but the reading and writing of the timer offset is not synchronized by GLFW. The following timer related functions may be called from any thread:</p>
|
||||
<p>The regular timer may be used from any thread, but reading and writing the timer offset is not synchronized by GLFW.</p>
|
||||
<ul>
|
||||
<li><a class="el" href="group__input.html#gaa6cf4e7a77158a3b8fd00328b1720a4a">glfwGetTime</a></li>
|
||||
<li><a class="el" href="group__input.html#gaf59589ef6e8b8c8b5ad184b25afd4dc0">glfwSetTime</a></li>
|
||||
</ul>
|
||||
<p>Library version information may be queried from any thread. The following version related functions may be called from any thread:</p>
|
||||
<p>Library version information may be queried from any thread.</p>
|
||||
<ul>
|
||||
<li><a class="el" href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a></li>
|
||||
<li><a class="el" href="group__init.html#ga23d47dc013fce2bf58036da66079a657">glfwGetVersionString</a></li>
|
||||
</ul>
|
||||
<p>Vulkan objects may be created and information queried from any thread. The following Vulkan related functions may be called from any thread:</p>
|
||||
<p>All Vulkan related functions may be called from any thread.</p>
|
||||
<ul>
|
||||
<li><a class="el" href="group__vulkan.html#ga2e7f30931e02464b5bc8d0d4b6f9fe2b">glfwVulkanSupported</a></li>
|
||||
<li><a class="el" href="group__vulkan.html#ga1abcbe61033958f22f63ef82008874b1">glfwGetRequiredInstanceExtensions</a></li>
|
||||
@@ -222,14 +245,14 @@ Thread safety</h2>
|
||||
<li><a class="el" href="group__vulkan.html#gaff3823355cdd7e2f3f9f4d9ea9518d92">glfwGetPhysicalDevicePresentationSupport</a></li>
|
||||
<li><a class="el" href="group__vulkan.html#ga1a24536bec3f80b08ead18e28e6ae965">glfwCreateWindowSurface</a></li>
|
||||
</ul>
|
||||
<p>GLFW uses no synchronization objects internally except for thread-local storage to keep track of the current context for each thread. Synchronization is left to the application.</p>
|
||||
<p>GLFW uses synchronization objects internally only to manage the per-thread context and error states. Additional synchronization is left to the application.</p>
|
||||
<p>Functions that may currently be called from any thread will always remain so, but functions that are currently limited to the main thread may be updated to allow calls from any thread in future releases.</p>
|
||||
<h2><a class="anchor" id="compatibility"></a>
|
||||
Version compatibility</h2>
|
||||
<p>GLFW guarantees source and binary backward compatibility with earlier minor versions of the API. This means that you can drop in a newer version of the library and existing programs will continue to compile and existing binaries will continue to run.</p>
|
||||
<p>GLFW uses <a href="https://semver.org/">Semantic Versioning</a>. This guarantees source and binary backward compatibility with earlier minor versions of the API. This means that you can drop in a newer version of the library and existing programs will continue to compile and existing binaries will continue to run.</p>
|
||||
<p>Once a function or constant has been added, the signature of that function or value of that constant will remain unchanged until the next major version of GLFW. No compatibility of any kind is guaranteed between major versions.</p>
|
||||
<p>Undocumented behavior, i.e. behavior that is not described in the documentation, may change at any time until it is documented.</p>
|
||||
<p>If the reference documentation and the implementation differ, the reference documentation is correct and the implementation will be fixed in the next release.</p>
|
||||
<p>If the reference documentation and the implementation differ, the reference documentation will almost always take precedence and the implementation will be fixed in the next release. The reference documentation will also take precedence over anything stated in a guide.</p>
|
||||
<h2><a class="anchor" id="event_order"></a>
|
||||
Event order</h2>
|
||||
<p>The order of arrival of related events is not guaranteed to be consistent across platforms. The exception is synthetic key and mouse button release events, which are always delivered after the window defocus event.</p>
|
||||
@@ -254,10 +277,11 @@ Version string</h2>
|
||||
<li>Any additional options or APIs</li>
|
||||
</ul>
|
||||
<p>For example, when compiling GLFW 3.0 with MinGW using the Win32 and WGL back ends, the version string may look something like this:</p>
|
||||
<div class="fragment"><div class="line">3.0.0 Win32 WGL MinGW</div></div><!-- fragment --> </div></div><!-- contents -->
|
||||
<div class="fragment"><div class="line">3.0.0 Win32 WGL MinGW</div></div><!-- fragment --> </div></div><!-- PageDoc -->
|
||||
</div><!-- contents -->
|
||||
<address class="footer">
|
||||
<p>
|
||||
Last update on Thu Aug 18 2016 for GLFW 3.2.1
|
||||
Last update on Tue Apr 16 2019 for GLFW 3.3.0
|
||||
</p>
|
||||
</address>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user