mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 20:39:18 +02:00
maintenance: glfw update to v 3.3.2
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.15"/>
|
||||
<meta name="generator" content="Doxygen 1.8.16"/>
|
||||
<title>GLFW: Moving from GLFW 2 to 3</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.8.15 -->
|
||||
<!-- Generated by Doxygen 1.8.16 -->
|
||||
<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');
|
||||
@@ -102,8 +102,10 @@ Changed and removed features</h1>
|
||||
<h2><a class="anchor" id="moving_renamed_files"></a>
|
||||
Renamed library and header file</h2>
|
||||
<p>The GLFW 3 header is named <a class="el" href="glfw3_8h.html">glfw3.h</a> and moved to the <code>GLFW</code> directory, to avoid collisions with the headers of other major versions. Similarly, the GLFW 3 library is named <code>glfw3,</code> except when it's installed as a shared library on Unix-like systems, where it uses the <a href="https://en.wikipedia.org/wiki/soname">soname</a> <code>libglfw.so.3</code>.</p>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include <GL/glfw.h></span></div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include <<a class="code" href="glfw3_8h.html">GLFW/glfw3.h</a>></span></div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include <GL/glfw.h></span></div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include <<a class="code" href="glfw3_8h.html">GLFW/glfw3.h</a>></span></div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<h2><a class="anchor" id="moving_threads"></a>
|
||||
Removal of threading functions</h2>
|
||||
<p>The threading functions have been removed, including the per-thread sleep function. They were fairly primitive, under-used, poorly integrated and took time away from the focus of GLFW (i.e. context, input and window). There are better threading libraries available and native threading support is available in both <a href="https://en.cppreference.com/w/cpp/thread">C++11</a> and <a href="https://en.cppreference.com/w/c/thread">C11</a>, both of which are gaining traction.</p>
|
||||
@@ -119,43 +121,76 @@ Removal of image and texture loading</h2>
|
||||
<h2><a class="anchor" id="moving_stdcall"></a>
|
||||
Removal of GLFWCALL macro</h2>
|
||||
<p>The <code>GLFWCALL</code> macro, which made callback functions use <a href="https://msdn.microsoft.com/en-us/library/zxk0tw93.aspx">__stdcall</a> on Windows, has been removed. GLFW is written in C, not Pascal. Removing this macro means there's one less thing for application programmers to remember, i.e. the requirement to mark all callback functions with <code>GLFWCALL</code>. It also simplifies the creation of DLLs and DLL link libraries, as there's no need to explicitly disable <code>@n</code> entry point suffixes.</p>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> GLFWCALL callback_function(...);</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> callback_function(...);</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> GLFWCALL callback_function(...);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> callback_function(...);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<h2><a class="anchor" id="moving_window_handles"></a>
|
||||
Window handle parameters</h2>
|
||||
<p>Because GLFW 3 supports multiple windows, window handle parameters have been added to all window-related GLFW functions and callbacks. The handle of a newly created window is returned by <a class="el" href="group__window.html#ga5c336fddf2cbb5b92f65f10fb6043344">glfwCreateWindow</a> (formerly <code>glfwOpenWindow</code>). Window handles are pointers to the <a href="https://en.wikipedia.org/wiki/Opaque_data_type">opaque</a> type <a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>.</p>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><a class="code" href="group__window.html#ga5d877f09e968cef7a360b513306f17ff">glfwSetWindowTitle</a>(<span class="stringliteral">"New Window Title"</span>);</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><a class="code" href="group__window.html#ga5d877f09e968cef7a360b513306f17ff">glfwSetWindowTitle</a>(window, <span class="stringliteral">"New Window Title"</span>);</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><a class="code" href="group__window.html#ga5d877f09e968cef7a360b513306f17ff">glfwSetWindowTitle</a>(<span class="stringliteral">"New Window Title"</span>);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><a class="code" href="group__window.html#ga5d877f09e968cef7a360b513306f17ff">glfwSetWindowTitle</a>(window, <span class="stringliteral">"New Window Title"</span>);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<h2><a class="anchor" id="moving_monitor"></a>
|
||||
Explicit monitor selection</h2>
|
||||
<p>GLFW 3 provides support for multiple monitors. To request a full screen mode window, instead of passing <code>GLFW_FULLSCREEN</code> you specify which monitor you wish the window to use. The <a class="el" href="group__monitor.html#ga721867d84c6d18d6790d64d2847ca0b1">glfwGetPrimaryMonitor</a> function returns the monitor that GLFW 2 would have selected, but there are many other <a class="el" href="monitor_guide.html">monitor functions</a>. Monitor handles are pointers to the <a href="https://en.wikipedia.org/wiki/Opaque_data_type">opaque</a> type <a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a>.</p>
|
||||
<dl class="section user"><dt>Old basic full screen</dt><dd><div class="fragment"><div class="line">glfwOpenWindow(640, 480, 8, 8, 8, 0, 24, 0, GLFW_FULLSCREEN);</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New basic full screen</dt><dd><div class="fragment"><div class="line">window = <a class="code" href="group__window.html#ga5c336fddf2cbb5b92f65f10fb6043344">glfwCreateWindow</a>(640, 480, <span class="stringliteral">"My Window"</span>, <a class="code" href="group__monitor.html#ga721867d84c6d18d6790d64d2847ca0b1">glfwGetPrimaryMonitor</a>(), NULL);</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>Old basic full screen</dt><dd><div class="fragment"><div class="line">glfwOpenWindow(640, 480, 8, 8, 8, 0, 24, 0, GLFW_FULLSCREEN);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New basic full screen</dt><dd><div class="fragment"><div class="line">window = <a class="code" href="group__window.html#ga5c336fddf2cbb5b92f65f10fb6043344">glfwCreateWindow</a>(640, 480, <span class="stringliteral">"My Window"</span>, <a class="code" href="group__monitor.html#ga721867d84c6d18d6790d64d2847ca0b1">glfwGetPrimaryMonitor</a>(), NULL);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section note"><dt>Note</dt><dd>The framebuffer bit depth parameters of <code>glfwOpenWindow</code> have been turned into <a class="el" href="window_guide.html#window_hints">window hints</a>, but as they have been given <a class="el" href="window_guide.html#window_hints_values">sane defaults</a> you rarely need to set these hints.</dd></dl>
|
||||
<h2><a class="anchor" id="moving_autopoll"></a>
|
||||
Removal of automatic event polling</h2>
|
||||
<p>GLFW 3 does not automatically poll for events in <a class="el" href="group__window.html#ga15a5a1ee5b3c2ca6b15ca209a12efd14">glfwSwapBuffers</a>, meaning you need to call <a class="el" href="group__window.html#ga37bd57223967b4211d60ca1a0bf3c832">glfwPollEvents</a> or <a class="el" href="group__window.html#ga554e37d781f0a997656c26b2c56c835e">glfwWaitEvents</a> yourself. Unlike buffer swap, which acts on a single window, the event processing functions act on all windows at once.</p>
|
||||
<dl class="section user"><dt>Old basic main loop</dt><dd><div class="fragment"><div class="line"><span class="keywordflow">while</span> (...)</div><div class="line">{</div><div class="line"> <span class="comment">// Process input</span></div><div class="line"> <span class="comment">// Render output</span></div><div class="line"> <a class="code" href="group__window.html#ga15a5a1ee5b3c2ca6b15ca209a12efd14">glfwSwapBuffers</a>();</div><div class="line">}</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New basic main loop</dt><dd><div class="fragment"><div class="line"><span class="keywordflow">while</span> (...)</div><div class="line">{</div><div class="line"> <span class="comment">// Process input</span></div><div class="line"> <span class="comment">// Render output</span></div><div class="line"> <a class="code" href="group__window.html#ga15a5a1ee5b3c2ca6b15ca209a12efd14">glfwSwapBuffers</a>(window);</div><div class="line"> <a class="code" href="group__window.html#ga37bd57223967b4211d60ca1a0bf3c832">glfwPollEvents</a>();</div><div class="line">}</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>Old basic main loop</dt><dd><div class="fragment"><div class="line"><span class="keywordflow">while</span> (...)</div>
|
||||
<div class="line">{</div>
|
||||
<div class="line"> <span class="comment">// Process input</span></div>
|
||||
<div class="line"> <span class="comment">// Render output</span></div>
|
||||
<div class="line"> <a class="code" href="group__window.html#ga15a5a1ee5b3c2ca6b15ca209a12efd14">glfwSwapBuffers</a>();</div>
|
||||
<div class="line">}</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New basic main loop</dt><dd><div class="fragment"><div class="line"><span class="keywordflow">while</span> (...)</div>
|
||||
<div class="line">{</div>
|
||||
<div class="line"> <span class="comment">// Process input</span></div>
|
||||
<div class="line"> <span class="comment">// Render output</span></div>
|
||||
<div class="line"> <a class="code" href="group__window.html#ga15a5a1ee5b3c2ca6b15ca209a12efd14">glfwSwapBuffers</a>(window);</div>
|
||||
<div class="line"> <a class="code" href="group__window.html#ga37bd57223967b4211d60ca1a0bf3c832">glfwPollEvents</a>();</div>
|
||||
<div class="line">}</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<h2><a class="anchor" id="moving_context"></a>
|
||||
Explicit context management</h2>
|
||||
<p>Each GLFW 3 window has its own OpenGL context and only you, the application programmer, can know which context should be current on which thread at any given time. Therefore, GLFW 3 leaves that decision to you.</p>
|
||||
<p>This means that you need to call <a class="el" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a> after creating a window before you can call any OpenGL functions.</p>
|
||||
<h2><a class="anchor" id="moving_hidpi"></a>
|
||||
Separation of window and framebuffer sizes</h2>
|
||||
<p>Window positions and sizes now use screen coordinates, which may not be the same as pixels on machines with high-DPI monitors. This is important as OpenGL uses pixels, not screen coordinates. For example, the rectangle specified with <code>glViewport</code> needs to use pixels. Therefore, framebuffer size functions have been added. You can retrieve the size of the framebuffer of a window with <a class="el" href="group__window.html#ga0e2637a4161afb283f5300c7f94785c9">glfwGetFramebufferSize</a> function. A framebuffer size callback has also been added, which can be set with <a class="el" href="group__window.html#ga3203461a5303bf289f2e05f854b2f7cf">glfwSetFramebufferSizeCallback</a>.</p>
|
||||
<dl class="section user"><dt>Old basic viewport setup</dt><dd><div class="fragment"><div class="line"><a class="code" href="group__window.html#gaeea7cbc03373a41fb51cfbf9f2a5d4c6">glfwGetWindowSize</a>(&width, &height);</div><div class="line">glViewport(0, 0, width, height);</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New basic viewport setup</dt><dd><div class="fragment"><div class="line"><a class="code" href="group__window.html#ga0e2637a4161afb283f5300c7f94785c9">glfwGetFramebufferSize</a>(window, &width, &height);</div><div class="line">glViewport(0, 0, width, height);</div></div><!-- fragment --></dd></dl>
|
||||
<p>Window positions and sizes now use screen coordinates, which may not be the same as pixels on machines with high-DPI monitors. This is important as OpenGL uses pixels, not screen coordinates. For example, the rectangle specified with <code>glViewport</code> needs to use pixels. Therefore, framebuffer size functions have been added. You can retrieve the size of the framebuffer of a window with <a class="el" href="group__window.html#ga0e2637a4161afb283f5300c7f94785c9">glfwGetFramebufferSize</a> function. A framebuffer size callback has also been added, which can be set with <a class="el" href="group__window.html#gab3fb7c3366577daef18c0023e2a8591f">glfwSetFramebufferSizeCallback</a>.</p>
|
||||
<dl class="section user"><dt>Old basic viewport setup</dt><dd><div class="fragment"><div class="line"><a class="code" href="group__window.html#gaeea7cbc03373a41fb51cfbf9f2a5d4c6">glfwGetWindowSize</a>(&width, &height);</div>
|
||||
<div class="line">glViewport(0, 0, width, height);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New basic viewport setup</dt><dd><div class="fragment"><div class="line"><a class="code" href="group__window.html#ga0e2637a4161afb283f5300c7f94785c9">glfwGetFramebufferSize</a>(window, &width, &height);</div>
|
||||
<div class="line">glViewport(0, 0, width, height);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<h2><a class="anchor" id="moving_window_close"></a>
|
||||
Window closing changes</h2>
|
||||
<p>The <code>GLFW_OPENED</code> window parameter has been removed. As long as the window has not been destroyed, whether through <a class="el" href="group__window.html#gacdf43e51376051d2c091662e9fe3d7b2">glfwDestroyWindow</a> or <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a>, the window is "open".</p>
|
||||
<p>A user attempting to close a window is now just an event like any other. Unlike GLFW 2, windows and contexts created with GLFW 3 will never be destroyed unless you choose them to be. Each window now has a close flag that is set to <code>GLFW_TRUE</code> when the user attempts to close that window. By default, nothing else happens and the window stays visible. It is then up to you to either destroy the window, take some other action or ignore the request.</p>
|
||||
<p>You can query the close flag at any time with <a class="el" href="group__window.html#ga24e02fbfefbb81fc45320989f8140ab5">glfwWindowShouldClose</a> and set it at any time with <a class="el" href="group__window.html#ga49c449dde2a6f87d996f4daaa09d6708">glfwSetWindowShouldClose</a>.</p>
|
||||
<dl class="section user"><dt>Old basic main loop</dt><dd><div class="fragment"><div class="line"><span class="keywordflow">while</span> (glfwGetWindowParam(GLFW_OPENED))</div><div class="line">{</div><div class="line"> ...</div><div class="line">}</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New basic main loop</dt><dd><div class="fragment"><div class="line"><span class="keywordflow">while</span> (!<a class="code" href="group__window.html#ga24e02fbfefbb81fc45320989f8140ab5">glfwWindowShouldClose</a>(window))</div><div class="line">{</div><div class="line"> ...</div><div class="line">}</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>Old basic main loop</dt><dd><div class="fragment"><div class="line"><span class="keywordflow">while</span> (glfwGetWindowParam(GLFW_OPENED))</div>
|
||||
<div class="line">{</div>
|
||||
<div class="line"> ...</div>
|
||||
<div class="line">}</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New basic main loop</dt><dd><div class="fragment"><div class="line"><span class="keywordflow">while</span> (!<a class="code" href="group__window.html#ga24e02fbfefbb81fc45320989f8140ab5">glfwWindowShouldClose</a>(window))</div>
|
||||
<div class="line">{</div>
|
||||
<div class="line"> ...</div>
|
||||
<div class="line">}</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<p>The close callback no longer returns a value. Instead, it is called after the close flag has been set so it can override its value, if it chooses to, before event processing completes. You may however not call <a class="el" href="group__window.html#gacdf43e51376051d2c091662e9fe3d7b2">glfwDestroyWindow</a> from the close callback (or any other window related callback).</p>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">int</span> GLFWCALL window_close_callback(<span class="keywordtype">void</span>);</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> window_close_callback(<a class="code" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window);</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">int</span> GLFWCALL window_close_callback(<span class="keywordtype">void</span>);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> window_close_callback(<a class="code" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section note"><dt>Note</dt><dd>GLFW never clears the close flag to <code>GLFW_FALSE</code>, meaning you can use it for other reasons to close the window as well, for example the user choosing Quit from an in-game menu.</dd></dl>
|
||||
<h2><a class="anchor" id="moving_hints"></a>
|
||||
Persistent window hints</h2>
|
||||
@@ -167,18 +202,22 @@ Video mode enumeration</h2>
|
||||
<h2><a class="anchor" id="moving_char_up"></a>
|
||||
Removal of character actions</h2>
|
||||
<p>The action parameter of the <a class="el" href="group__input.html#gabf24451c7ceb1952bc02b17a0d5c3e5f">character callback</a> has been removed. This was an artefact of the origin of GLFW, i.e. being developed in English by a Swede. However, many keyboard layouts require more than one key to produce characters with diacritical marks. Even the Swedish keyboard layout requires this for uncommon cases like ü.</p>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> GLFWCALL character_callback(<span class="keywordtype">int</span> character, <span class="keywordtype">int</span> action);</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> character_callback(<a class="code" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window, <span class="keywordtype">int</span> character);</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> GLFWCALL character_callback(<span class="keywordtype">int</span> character, <span class="keywordtype">int</span> action);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> character_callback(<a class="code" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window, <span class="keywordtype">int</span> character);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<h2><a class="anchor" id="moving_cursorpos"></a>
|
||||
Cursor position changes</h2>
|
||||
<p>The <code>glfwGetMousePos</code> function has been renamed to <a class="el" href="group__input.html#ga01d37b6c40133676b9cea60ca1d7c0cc">glfwGetCursorPos</a>, <code>glfwSetMousePos</code> to <a class="el" href="group__input.html#ga04b03af936d906ca123c8f4ee08b39e7">glfwSetCursorPos</a> and <code>glfwSetMousePosCallback</code> to <a class="el" href="group__input.html#ga7dad39486f2c7591af7fb25134a2501d">glfwSetCursorPosCallback</a>.</p>
|
||||
<p>The <code>glfwGetMousePos</code> function has been renamed to <a class="el" href="group__input.html#ga01d37b6c40133676b9cea60ca1d7c0cc">glfwGetCursorPos</a>, <code>glfwSetMousePos</code> to <a class="el" href="group__input.html#ga04b03af936d906ca123c8f4ee08b39e7">glfwSetCursorPos</a> and <code>glfwSetMousePosCallback</code> to <a class="el" href="group__input.html#gac1f879ab7435d54d4d79bb469fe225d7">glfwSetCursorPosCallback</a>.</p>
|
||||
<p>The cursor position is now <code>double</code> instead of <code>int</code>, both for the direct functions and for the callback. Some platforms can provide sub-pixel cursor movement and this data is now passed on to the application where available. On platforms where this is not provided, the decimal part is zero.</p>
|
||||
<p>GLFW 3 only allows you to position the cursor within a window using <a class="el" href="group__input.html#ga04b03af936d906ca123c8f4ee08b39e7">glfwSetCursorPos</a> (formerly <code>glfwSetMousePos</code>) when that window is active. Unless the window is active, the function fails silently.</p>
|
||||
<h2><a class="anchor" id="moving_wheel"></a>
|
||||
Wheel position replaced by scroll offsets</h2>
|
||||
<p>The <code>glfwGetMouseWheel</code> function has been removed. Scrolling is the input of offsets and has no absolute position. The mouse wheel callback has been replaced by a <a class="el" href="group__input.html#ga4687e2199c60a18a8dd1da532e6d75c9">scroll callback</a> that receives two-dimensional floating point scroll offsets. This allows you to receive precise scroll data from for example modern touchpads.</p>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> GLFWCALL mouse_wheel_callback(<span class="keywordtype">int</span> position);</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> scroll_callback(<a class="code" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window, <span class="keywordtype">double</span> xoffset, <span class="keywordtype">double</span> yoffset);</div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> GLFWCALL mouse_wheel_callback(<span class="keywordtype">int</span> position);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> scroll_callback(<a class="code" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window, <span class="keywordtype">double</span> xoffset, <span class="keywordtype">double</span> yoffset);</div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>Removed functions</dt><dd><code>glfwGetMouseWheel</code></dd></dl>
|
||||
<h2><a class="anchor" id="moving_repeat"></a>
|
||||
Key repeat action</h2>
|
||||
@@ -210,8 +249,11 @@ Automatic termination</h2>
|
||||
<h2><a class="anchor" id="moving_glu"></a>
|
||||
GLU header inclusion</h2>
|
||||
<p>GLFW 3 does not by default include the GLU header and GLU itself has been deprecated by <a href="https://en.wikipedia.org/wiki/Khronos_Group">Khronos</a>. <b>New projects should not use GLU</b>, but if you need it for legacy code that has been moved to GLFW 3, you can request that the GLFW header includes it by defining <a class="el" href="build_guide.html#GLFW_INCLUDE_GLU">GLFW_INCLUDE_GLU</a> before the inclusion of the GLFW header.</p>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include <GL/glfw.h></span></div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#define GLFW_INCLUDE_GLU</span></div><div class="line"><span class="preprocessor">#include <GLFW/glfw3.h></span></div></div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>Old syntax</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include <GL/glfw.h></span></div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<dl class="section user"><dt>New syntax</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#define GLFW_INCLUDE_GLU</span></div>
|
||||
<div class="line"><span class="preprocessor">#include <GLFW/glfw3.h></span></div>
|
||||
</div><!-- fragment --></dd></dl>
|
||||
<p>There are many libraries that offer replacements for the functionality offered by GLU. For the matrix helper functions, see math libraries like <a href="https://github.com/g-truc/glm">GLM</a> (for C++), <a href="https://github.com/datenwolf/linmath.h">linmath.h</a> (for C) and others. For the tessellation functions, see for example <a href="https://github.com/memononen/libtess2">libtess2</a>.</p>
|
||||
<h1><a class="anchor" id="moving_tables"></a>
|
||||
Name change tables</h1>
|
||||
@@ -235,9 +277,9 @@ Renamed functions</h2>
|
||||
<tr class="markdownTableRowOdd">
|
||||
<td class="markdownTableBodyNone"><code>glfwSetMousePos</code> </td><td class="markdownTableBodyNone"><a class="el" href="group__input.html#ga04b03af936d906ca123c8f4ee08b39e7">glfwSetCursorPos</a> </td><td class="markdownTableBodyNone"></td></tr>
|
||||
<tr class="markdownTableRowEven">
|
||||
<td class="markdownTableBodyNone"><code>glfwSetMousePosCallback</code> </td><td class="markdownTableBodyNone"><a class="el" href="group__input.html#ga7dad39486f2c7591af7fb25134a2501d">glfwSetCursorPosCallback</a> </td><td class="markdownTableBodyNone"></td></tr>
|
||||
<td class="markdownTableBodyNone"><code>glfwSetMousePosCallback</code> </td><td class="markdownTableBodyNone"><a class="el" href="group__input.html#gac1f879ab7435d54d4d79bb469fe225d7">glfwSetCursorPosCallback</a> </td><td class="markdownTableBodyNone"></td></tr>
|
||||
<tr class="markdownTableRowOdd">
|
||||
<td class="markdownTableBodyNone"><code>glfwSetMouseWheelCallback</code> </td><td class="markdownTableBodyNone"><a class="el" href="group__input.html#gacf02eb10504352f16efda4593c3ce60e">glfwSetScrollCallback</a> </td><td class="markdownTableBodyNone">Accepts two-dimensional scroll offsets as doubles </td></tr>
|
||||
<td class="markdownTableBodyNone"><code>glfwSetMouseWheelCallback</code> </td><td class="markdownTableBodyNone"><a class="el" href="group__input.html#ga571e45a030ae4061f746ed56cb76aede">glfwSetScrollCallback</a> </td><td class="markdownTableBodyNone">Accepts two-dimensional scroll offsets as doubles </td></tr>
|
||||
<tr class="markdownTableRowEven">
|
||||
<td class="markdownTableBodyNone"><code>glfwGetJoystickPos</code> </td><td class="markdownTableBodyNone"><a class="el" href="group__input.html#gaa8806536731e92c061bc70bcff6edbd0">glfwGetJoystickAxes</a> </td><td class="markdownTableBodyNone"></td></tr>
|
||||
<tr class="markdownTableRowOdd">
|
||||
@@ -303,11 +345,21 @@ Renamed tokens</h2>
|
||||
<tr class="markdownTableRowOdd">
|
||||
<td class="markdownTableBodyNone"><code>GLFW_KEY_RSUPER</code> </td><td class="markdownTableBodyNone"><code>GLFW_KEY_RIGHT_SUPER</code> </td><td class="markdownTableBodyNone"></td></tr>
|
||||
</table>
|
||||
</div></div><!-- PageDoc -->
|
||||
</div><!-- contents -->
|
||||
</div></div><!-- contents -->
|
||||
</div><!-- PageDoc -->
|
||||
<div class="ttc" id="aglfw3_8h_html"><div class="ttname"><a href="glfw3_8h.html">glfw3.h</a></div><div class="ttdoc">The header of the GLFW 3 API.</div></div>
|
||||
<div class="ttc" id="agroup__window_html_ga5d877f09e968cef7a360b513306f17ff"><div class="ttname"><a href="group__window.html#ga5d877f09e968cef7a360b513306f17ff">glfwSetWindowTitle</a></div><div class="ttdeci">void glfwSetWindowTitle(GLFWwindow *window, const char *title)</div><div class="ttdoc">Sets the title of the specified window.</div></div>
|
||||
<div class="ttc" id="agroup__window_html_ga3c96d80d363e67d13a41b5d1821f3242"><div class="ttname"><a href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a></div><div class="ttdeci">struct GLFWwindow GLFWwindow</div><div class="ttdoc">Opaque window object.</div><div class="ttdef"><b>Definition:</b> glfw3.h:1152</div></div>
|
||||
<div class="ttc" id="agroup__window_html_ga15a5a1ee5b3c2ca6b15ca209a12efd14"><div class="ttname"><a href="group__window.html#ga15a5a1ee5b3c2ca6b15ca209a12efd14">glfwSwapBuffers</a></div><div class="ttdeci">void glfwSwapBuffers(GLFWwindow *window)</div><div class="ttdoc">Swaps the front and back buffers of the specified window.</div></div>
|
||||
<div class="ttc" id="agroup__window_html_ga24e02fbfefbb81fc45320989f8140ab5"><div class="ttname"><a href="group__window.html#ga24e02fbfefbb81fc45320989f8140ab5">glfwWindowShouldClose</a></div><div class="ttdeci">int glfwWindowShouldClose(GLFWwindow *window)</div><div class="ttdoc">Checks the close flag of the specified window.</div></div>
|
||||
<div class="ttc" id="agroup__window_html_ga37bd57223967b4211d60ca1a0bf3c832"><div class="ttname"><a href="group__window.html#ga37bd57223967b4211d60ca1a0bf3c832">glfwPollEvents</a></div><div class="ttdeci">void glfwPollEvents(void)</div><div class="ttdoc">Processes all pending events.</div></div>
|
||||
<div class="ttc" id="agroup__monitor_html_ga721867d84c6d18d6790d64d2847ca0b1"><div class="ttname"><a href="group__monitor.html#ga721867d84c6d18d6790d64d2847ca0b1">glfwGetPrimaryMonitor</a></div><div class="ttdeci">GLFWmonitor * glfwGetPrimaryMonitor(void)</div><div class="ttdoc">Returns the primary monitor.</div></div>
|
||||
<div class="ttc" id="agroup__window_html_ga5c336fddf2cbb5b92f65f10fb6043344"><div class="ttname"><a href="group__window.html#ga5c336fddf2cbb5b92f65f10fb6043344">glfwCreateWindow</a></div><div class="ttdeci">GLFWwindow * glfwCreateWindow(int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)</div><div class="ttdoc">Creates a window and its associated context.</div></div>
|
||||
<div class="ttc" id="agroup__window_html_gaeea7cbc03373a41fb51cfbf9f2a5d4c6"><div class="ttname"><a href="group__window.html#gaeea7cbc03373a41fb51cfbf9f2a5d4c6">glfwGetWindowSize</a></div><div class="ttdeci">void glfwGetWindowSize(GLFWwindow *window, int *width, int *height)</div><div class="ttdoc">Retrieves the size of the content area of the specified window.</div></div>
|
||||
<div class="ttc" id="agroup__window_html_ga0e2637a4161afb283f5300c7f94785c9"><div class="ttname"><a href="group__window.html#ga0e2637a4161afb283f5300c7f94785c9">glfwGetFramebufferSize</a></div><div class="ttdeci">void glfwGetFramebufferSize(GLFWwindow *window, int *width, int *height)</div><div class="ttdoc">Retrieves the size of the framebuffer of the specified window.</div></div>
|
||||
<address class="footer">
|
||||
<p>
|
||||
Last update on Tue Apr 16 2019 for GLFW 3.3.0
|
||||
Last update on Mon Jan 20 2020 for GLFW 3.3.2
|
||||
</p>
|
||||
</address>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user