mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 14:49:19 +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: Context guide</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,13 +102,17 @@ Context creation hints</h2>
|
||||
<h2><a class="anchor" id="context_sharing"></a>
|
||||
Context object sharing</h2>
|
||||
<p>When creating a window and its OpenGL or OpenGL ES context with <a class="el" href="group__window.html#ga5c336fddf2cbb5b92f65f10fb6043344">glfwCreateWindow</a>, you can specify another window whose context the new one should share its objects (textures, vertex and element buffers, etc.) with.</p>
|
||||
<div class="fragment"><div class="line"><a class="code" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* second_window = <a class="code" href="group__window.html#ga5c336fddf2cbb5b92f65f10fb6043344">glfwCreateWindow</a>(640, 480, <span class="stringliteral">"Second Window"</span>, NULL, first_window);</div></div><!-- fragment --><p>Object sharing is implemented by the operating system and graphics driver. On platforms where it is possible to choose which types of objects are shared, GLFW requests that all types are shared.</p>
|
||||
<div class="fragment"><div class="line"><a class="code" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* second_window = <a class="code" href="group__window.html#ga5c336fddf2cbb5b92f65f10fb6043344">glfwCreateWindow</a>(640, 480, <span class="stringliteral">"Second Window"</span>, NULL, first_window);</div>
|
||||
</div><!-- fragment --><p>Object sharing is implemented by the operating system and graphics driver. On platforms where it is possible to choose which types of objects are shared, GLFW requests that all types are shared.</p>
|
||||
<p>See the relevant chapter of the <a href="https://www.opengl.org/registry/">OpenGL</a> or <a href="https://www.khronos.org/opengles/">OpenGL ES</a> reference documents for more information. The name and number of this chapter unfortunately varies between versions and APIs, but has at times been named <em>Shared Objects and Multiple Contexts</em>.</p>
|
||||
<p>GLFW comes with a barebones object sharing example program called <code>sharing</code>.</p>
|
||||
<h2><a class="anchor" id="context_offscreen"></a>
|
||||
Offscreen contexts</h2>
|
||||
<p>GLFW doesn't support creating contexts without an associated window. However, contexts with hidden windows can be created with the <a class="el" href="window_guide.html#GLFW_VISIBLE_hint">GLFW_VISIBLE</a> window hint.</p>
|
||||
<div class="fragment"><div class="line"><a class="code" href="group__window.html#ga7d9c8c62384b1e2821c4dc48952d2033">glfwWindowHint</a>(<a class="code" href="group__window.html#gafb3cdc45297e06d8f1eb13adc69ca6c4">GLFW_VISIBLE</a>, <a class="code" href="group__init.html#gac877fe3b627d21ef3a0a23e0a73ba8c5">GLFW_FALSE</a>);</div><div class="line"></div><div class="line"><a class="code" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* offscreen_context = <a class="code" href="group__window.html#ga5c336fddf2cbb5b92f65f10fb6043344">glfwCreateWindow</a>(640, 480, <span class="stringliteral">""</span>, NULL, NULL);</div></div><!-- fragment --><p>The window never needs to be shown and its context can be used as a plain offscreen context. Depending on the window manager, the size of a hidden window's framebuffer may not be usable or modifiable, so framebuffer objects are recommended for rendering with such contexts.</p>
|
||||
<div class="fragment"><div class="line"><a class="code" href="group__window.html#ga7d9c8c62384b1e2821c4dc48952d2033">glfwWindowHint</a>(<a class="code" href="group__window.html#gafb3cdc45297e06d8f1eb13adc69ca6c4">GLFW_VISIBLE</a>, <a class="code" href="group__init.html#gac877fe3b627d21ef3a0a23e0a73ba8c5">GLFW_FALSE</a>);</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"><a class="code" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* offscreen_context = <a class="code" href="group__window.html#ga5c336fddf2cbb5b92f65f10fb6043344">glfwCreateWindow</a>(640, 480, <span class="stringliteral">""</span>, NULL, NULL);</div>
|
||||
</div><!-- fragment --><p>The window never needs to be shown and its context can be used as a plain offscreen context. Depending on the window manager, the size of a hidden window's framebuffer may not be usable or modifiable, so framebuffer objects are recommended for rendering with such contexts.</p>
|
||||
<p>You should still <a class="el" href="input_guide.html#events">process events</a> as long as you have at least one window, even if none of them are visible.</p>
|
||||
<p><b>macOS:</b> The first time a window is created the menu bar is created. This is not desirable for example when writing a command-line only application. Menu bar creation can be disabled with the <a class="el" href="group__init.html#ga71e0b4ce2f2696a84a9b8c5e12dc70cf">GLFW_COCOA_MENUBAR</a> init hint.</p>
|
||||
<h2><a class="anchor" id="context_less"></a>
|
||||
@@ -119,8 +123,10 @@ Current context</h1>
|
||||
<p>Before you can make OpenGL or OpenGL ES calls, you need to have a current context of the correct type. A context can only be current for a single thread at a time, and a thread can only have a single context current at a time.</p>
|
||||
<p>When moving a context between threads, you must make it non-current on the old thread before making it current on the new one.</p>
|
||||
<p>The context of a window is made current with <a class="el" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a>.</p>
|
||||
<div class="fragment"><div class="line"><a class="code" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a>(window);</div></div><!-- fragment --><p>The window of the current context is returned by <a class="el" href="group__context.html#gac84759b1f6c2d271a4fea8ae89ec980d">glfwGetCurrentContext</a>.</p>
|
||||
<div class="fragment"><div class="line"><a class="code" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window = <a class="code" href="group__context.html#gac84759b1f6c2d271a4fea8ae89ec980d">glfwGetCurrentContext</a>();</div></div><!-- fragment --><p>The following GLFW functions require a context to be current. Calling any these functions without a current context will generate a <a class="el" href="group__errors.html#gaa8290386e9528ccb9e42a3a4e16fc0d0">GLFW_NO_CURRENT_CONTEXT</a> error.</p>
|
||||
<div class="fragment"><div class="line"><a class="code" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a>(window);</div>
|
||||
</div><!-- fragment --><p>The window of the current context is returned by <a class="el" href="group__context.html#gac84759b1f6c2d271a4fea8ae89ec980d">glfwGetCurrentContext</a>.</p>
|
||||
<div class="fragment"><div class="line"><a class="code" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window = <a class="code" href="group__context.html#gac84759b1f6c2d271a4fea8ae89ec980d">glfwGetCurrentContext</a>();</div>
|
||||
</div><!-- fragment --><p>The following GLFW functions require a context to be current. Calling any these functions without a current context will generate a <a class="el" href="group__errors.html#gaa8290386e9528ccb9e42a3a4e16fc0d0">GLFW_NO_CURRENT_CONTEXT</a> error.</p>
|
||||
<ul>
|
||||
<li><a class="el" href="group__context.html#ga6d4e0cdf151b5e579bd67f13202994ed">glfwSwapInterval</a></li>
|
||||
<li><a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a></li>
|
||||
@@ -144,13 +150,33 @@ Loading extension with a loader library</h2>
|
||||
<p>An extension loader library is the easiest and best way to access both OpenGL and OpenGL ES extensions and modern versions of the core OpenGL or OpenGL ES APIs. They will take care of all the details of declaring and loading everything you need. One such library is <a href="https://github.com/Dav1dde/glad">glad</a> and there are several others.</p>
|
||||
<p>The following example will use glad but all extension loader libraries work similarly.</p>
|
||||
<p>First you need to generate the source files using the glad Python script. This example generates a loader for any version of OpenGL, which is the default for both GLFW and glad, but loaders for OpenGL ES, as well as loaders for specific API versions and extension sets can be generated. The generated files are written to the <code>output</code> directory.</p>
|
||||
<div class="fragment"><div class="line">python main.py --generator c --no-loader --out-path output</div></div><!-- fragment --><p>The <code>--no-loader</code> option is added because GLFW already provides a function for loading OpenGL and OpenGL ES function pointers, one that automatically uses the selected context creation API, and glad can call this instead of having to implement its own. There are several other command-line options as well. See the glad documentation for details.</p>
|
||||
<div class="fragment"><div class="line">python main.py --generator c --no-loader --out-path output</div>
|
||||
</div><!-- fragment --><p>The <code>--no-loader</code> option is added because GLFW already provides a function for loading OpenGL and OpenGL ES function pointers, one that automatically uses the selected context creation API, and glad can call this instead of having to implement its own. There are several other command-line options as well. See the glad documentation for details.</p>
|
||||
<p>Add the generated <code>output/src/glad.c</code>, <code>output/include/glad/glad.h</code> and <code>output/include/KHR/khrplatform.h</code> files to your build. Then you need to include the glad header file, which will replace the OpenGL header of your development environment. By including the glad header before the GLFW header, it suppresses the development environment's OpenGL or OpenGL ES header.</p>
|
||||
<div class="fragment"><div class="line"><span class="preprocessor">#include <glad/glad.h></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="glfw3_8h.html">GLFW/glfw3.h</a>></span></div></div><!-- fragment --><p>Finally you need to initialize glad once you have a suitable current context.</p>
|
||||
<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>, NULL, NULL);</div><div class="line"><span class="keywordflow">if</span> (!window)</div><div class="line">{</div><div class="line"> ...</div><div class="line">}</div><div class="line"></div><div class="line"><a class="code" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a>(window);</div><div class="line"></div><div class="line">gladLoadGLLoader((GLADloadproc) <a class="code" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a>);</div></div><!-- fragment --><p>Once glad has been loaded, you have access to all OpenGL core and extension functions supported by both the context you created and the glad loader you generated and you are ready to start rendering.</p>
|
||||
<div class="fragment"><div class="line"><span class="preprocessor">#include <glad/glad.h></span></div>
|
||||
<div class="line"><span class="preprocessor">#include <<a class="code" href="glfw3_8h.html">GLFW/glfw3.h</a>></span></div>
|
||||
</div><!-- fragment --><p>Finally you need to initialize glad once you have a suitable current context.</p>
|
||||
<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>, NULL, NULL);</div>
|
||||
<div class="line"><span class="keywordflow">if</span> (!window)</div>
|
||||
<div class="line">{</div>
|
||||
<div class="line"> ...</div>
|
||||
<div class="line">}</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"><a class="code" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a>(window);</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line">gladLoadGLLoader((GLADloadproc) <a class="code" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a>);</div>
|
||||
</div><!-- fragment --><p>Once glad has been loaded, you have access to all OpenGL core and extension functions supported by both the context you created and the glad loader you generated and you are ready to start rendering.</p>
|
||||
<p>You can specify a minimum required OpenGL or OpenGL ES version with <a class="el" href="window_guide.html#window_hints_ctx">context hints</a>. If your needs are more complex, you can check the actual OpenGL or OpenGL ES version with <a class="el" href="window_guide.html#window_attribs_ctx">context attributes</a>, or you can check whether a specific version is supported by the current context with the <code>GLAD_GL_VERSION_x_x</code> booleans.</p>
|
||||
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (GLAD_GL_VERSION_3_2)</div><div class="line">{</div><div class="line"> <span class="comment">// Call OpenGL 3.2+ specific code</span></div><div class="line">}</div></div><!-- fragment --><p>To check whether a specific extension is supported, use the <code>GLAD_GL_xxx</code> booleans.</p>
|
||||
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (GLAD_GL_ARB_debug_output)</div><div class="line">{</div><div class="line"> <span class="comment">// Use GL_ARB_debug_output</span></div><div class="line">}</div></div><!-- fragment --><h2><a class="anchor" id="context_glext_manual"></a>
|
||||
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (GLAD_GL_VERSION_3_2)</div>
|
||||
<div class="line">{</div>
|
||||
<div class="line"> <span class="comment">// Call OpenGL 3.2+ specific code</span></div>
|
||||
<div class="line">}</div>
|
||||
</div><!-- fragment --><p>To check whether a specific extension is supported, use the <code>GLAD_GL_xxx</code> booleans.</p>
|
||||
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (GLAD_GL_ARB_debug_output)</div>
|
||||
<div class="line">{</div>
|
||||
<div class="line"> <span class="comment">// Use GL_ARB_debug_output</span></div>
|
||||
<div class="line">}</div>
|
||||
</div><!-- fragment --><h2><a class="anchor" id="context_glext_manual"></a>
|
||||
Loading extensions manually</h2>
|
||||
<p><b>Do not use this technique</b> unless it is absolutely necessary. An <a class="el" href="context_guide.html#context_glext_auto">extension loader library</a> will save you a ton of tedious, repetitive, error prone work.</p>
|
||||
<p>To use a certain extension, you must first check whether the context supports that extension and then, if it introduces new functions, retrieve the pointers to those functions. GLFW provides <a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a> and <a class="el" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a> for manual loading of extensions and new API functions.</p>
|
||||
@@ -160,20 +186,64 @@ The glext.h header</h3>
|
||||
<p>The <code>glext.h</code> extension header is a continually updated file that defines the interfaces for all OpenGL extensions. The latest version of this can always be found at the <a href="https://www.opengl.org/registry/">OpenGL Registry</a>. There are also extension headers for the various versions of OpenGL ES at the <a href="https://www.khronos.org/registry/gles/">OpenGL ES Registry</a>. It it strongly recommended that you use your own copy of the extension header, as the one included in your development environment may be several years out of date and may not include the extensions you wish to use.</p>
|
||||
<p>The header defines function pointer types for all functions of all extensions it supports. These have names like <code>PFNGLGETDEBUGMESSAGELOGARBPROC</code> (for <code>glGetDebugMessageLogARB</code>), i.e. the name is made uppercase and <code>PFN</code> (pointer to function) and <code>PROC</code> (procedure) are added to the ends.</p>
|
||||
<p>To include the extension header, define <a class="el" href="build_guide.html#GLFW_INCLUDE_GLEXT">GLFW_INCLUDE_GLEXT</a> before including the GLFW header.</p>
|
||||
<div class="fragment"><div class="line"><span class="preprocessor">#define GLFW_INCLUDE_GLEXT</span></div><div class="line"><span class="preprocessor">#include <GLFW/glfw3.h></span></div></div><!-- fragment --><h3><a class="anchor" id="context_glext_string"></a>
|
||||
<div class="fragment"><div class="line"><span class="preprocessor">#define GLFW_INCLUDE_GLEXT</span></div>
|
||||
<div class="line"><span class="preprocessor">#include <GLFW/glfw3.h></span></div>
|
||||
</div><!-- fragment --><h3><a class="anchor" id="context_glext_string"></a>
|
||||
Checking for extensions</h3>
|
||||
<p>A given machine may not actually support the extension (it may have older drivers or a graphics card that lacks the necessary hardware features), so it is necessary to check at run-time whether the context supports the extension. This is done with <a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a>(<span class="stringliteral">"GL_ARB_debug_output"</span>))</div><div class="line">{</div><div class="line"> <span class="comment">// The extension is supported by the current context</span></div><div class="line">}</div></div><!-- fragment --><p>The argument is a null terminated ASCII string with the extension name. If the extension is supported, <a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a> returns <code>GLFW_TRUE</code>, otherwise it returns <code>GLFW_FALSE</code>.</p>
|
||||
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a>(<span class="stringliteral">"GL_ARB_debug_output"</span>))</div>
|
||||
<div class="line">{</div>
|
||||
<div class="line"> <span class="comment">// The extension is supported by the current context</span></div>
|
||||
<div class="line">}</div>
|
||||
</div><!-- fragment --><p>The argument is a null terminated ASCII string with the extension name. If the extension is supported, <a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a> returns <code>GLFW_TRUE</code>, otherwise it returns <code>GLFW_FALSE</code>.</p>
|
||||
<h3><a class="anchor" id="context_glext_proc"></a>
|
||||
Fetching function pointers</h3>
|
||||
<p>Many extensions, though not all, require the use of new OpenGL functions. These functions often do not have entry points in the client API libraries of your operating system, making it necessary to fetch them at run time. You can retrieve pointers to these functions with <a class="el" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a>.</p>
|
||||
<div class="fragment"><div class="line">PFNGLGETDEBUGMESSAGELOGARBPROC pfnGetDebugMessageLog = <a class="code" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a>(<span class="stringliteral">"glGetDebugMessageLogARB"</span>);</div></div><!-- fragment --><p>In general, you should avoid giving the function pointer variables the (exact) same name as the function, as this may confuse your linker. Instead, you can use a different prefix, like above, or some other naming scheme.</p>
|
||||
<div class="fragment"><div class="line">PFNGLGETDEBUGMESSAGELOGARBPROC pfnGetDebugMessageLog = <a class="code" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a>(<span class="stringliteral">"glGetDebugMessageLogARB"</span>);</div>
|
||||
</div><!-- fragment --><p>In general, you should avoid giving the function pointer variables the (exact) same name as the function, as this may confuse your linker. Instead, you can use a different prefix, like above, or some other naming scheme.</p>
|
||||
<p>Now that all the pieces have been introduced, here is what they might look like when used together.</p>
|
||||
<div class="fragment"><div class="line"><span class="preprocessor">#define GLFW_INCLUDE_GLEXT</span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="glfw3_8h.html">GLFW/glfw3.h</a>></span></div><div class="line"></div><div class="line"><span class="preprocessor">#define glGetDebugMessageLogARB pfnGetDebugMessageLog</span></div><div class="line">PFNGLGETDEBUGMESSAGELOGARBPROC pfnGetDebugMessageLog;</div><div class="line"></div><div class="line"><span class="comment">// Flag indicating whether the extension is supported</span></div><div class="line"><span class="keywordtype">int</span> has_ARB_debug_output = 0;</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> load_extensions(<span class="keywordtype">void</span>)</div><div class="line">{</div><div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a>(<span class="stringliteral">"GL_ARB_debug_output"</span>))</div><div class="line"> {</div><div class="line"> pfnGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGARBPROC)</div><div class="line"> <a class="code" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a>(<span class="stringliteral">"glGetDebugMessageLogARB"</span>);</div><div class="line"> has_ARB_debug_output = 1;</div><div class="line"> }</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> some_function(<span class="keywordtype">void</span>)</div><div class="line">{</div><div class="line"> <span class="keywordflow">if</span> (has_ARB_debug_output)</div><div class="line"> {</div><div class="line"> <span class="comment">// Now the extension function can be called as usual</span></div><div class="line"> glGetDebugMessageLogARB(...);</div><div class="line"> }</div><div class="line">}</div></div><!-- fragment --> </div></div><!-- PageDoc -->
|
||||
</div><!-- contents -->
|
||||
<div class="fragment"><div class="line"><span class="preprocessor">#define GLFW_INCLUDE_GLEXT</span></div>
|
||||
<div class="line"><span class="preprocessor">#include <<a class="code" href="glfw3_8h.html">GLFW/glfw3.h</a>></span></div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"><span class="preprocessor">#define glGetDebugMessageLogARB pfnGetDebugMessageLog</span></div>
|
||||
<div class="line">PFNGLGETDEBUGMESSAGELOGARBPROC pfnGetDebugMessageLog;</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"><span class="comment">// Flag indicating whether the extension is supported</span></div>
|
||||
<div class="line"><span class="keywordtype">int</span> has_ARB_debug_output = 0;</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"><span class="keywordtype">void</span> load_extensions(<span class="keywordtype">void</span>)</div>
|
||||
<div class="line">{</div>
|
||||
<div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a>(<span class="stringliteral">"GL_ARB_debug_output"</span>))</div>
|
||||
<div class="line"> {</div>
|
||||
<div class="line"> pfnGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGARBPROC)</div>
|
||||
<div class="line"> <a class="code" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a>(<span class="stringliteral">"glGetDebugMessageLogARB"</span>);</div>
|
||||
<div class="line"> has_ARB_debug_output = 1;</div>
|
||||
<div class="line"> }</div>
|
||||
<div class="line">}</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"><span class="keywordtype">void</span> some_function(<span class="keywordtype">void</span>)</div>
|
||||
<div class="line">{</div>
|
||||
<div class="line"> <span class="keywordflow">if</span> (has_ARB_debug_output)</div>
|
||||
<div class="line"> {</div>
|
||||
<div class="line"> <span class="comment">// Now the extension function can be called as usual</span></div>
|
||||
<div class="line"> glGetDebugMessageLogARB(...);</div>
|
||||
<div class="line"> }</div>
|
||||
<div class="line">}</div>
|
||||
</div><!-- fragment --> </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__context_html_gac84759b1f6c2d271a4fea8ae89ec980d"><div class="ttname"><a href="group__context.html#gac84759b1f6c2d271a4fea8ae89ec980d">glfwGetCurrentContext</a></div><div class="ttdeci">GLFWwindow * glfwGetCurrentContext(void)</div><div class="ttdoc">Returns the window whose context is current on the calling thread.</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__context_html_ga87425065c011cef1ebd6aac75e059dfa"><div class="ttname"><a href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a></div><div class="ttdeci">int glfwExtensionSupported(const char *extension)</div><div class="ttdoc">Returns whether the specified extension is available.</div></div>
|
||||
<div class="ttc" id="agroup__context_html_ga1c04dc242268f827290fe40aa1c91157"><div class="ttname"><a href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a></div><div class="ttdeci">void glfwMakeContextCurrent(GLFWwindow *window)</div><div class="ttdoc">Makes the context of the specified window current for the calling thread.</div></div>
|
||||
<div class="ttc" id="agroup__init_html_gac877fe3b627d21ef3a0a23e0a73ba8c5"><div class="ttname"><a href="group__init.html#gac877fe3b627d21ef3a0a23e0a73ba8c5">GLFW_FALSE</a></div><div class="ttdeci">#define GLFW_FALSE</div><div class="ttdoc">Zero.</div><div class="ttdef"><b>Definition:</b> glfw3.h:289</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__context_html_ga35f1837e6f666781842483937612f163"><div class="ttname"><a href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a></div><div class="ttdeci">GLFWglproc glfwGetProcAddress(const char *procname)</div><div class="ttdoc">Returns the address of the specified function for the current context.</div></div>
|
||||
<div class="ttc" id="agroup__window_html_ga7d9c8c62384b1e2821c4dc48952d2033"><div class="ttname"><a href="group__window.html#ga7d9c8c62384b1e2821c4dc48952d2033">glfwWindowHint</a></div><div class="ttdeci">void glfwWindowHint(int hint, int value)</div><div class="ttdoc">Sets the specified window hint to the desired value.</div></div>
|
||||
<div class="ttc" id="agroup__window_html_gafb3cdc45297e06d8f1eb13adc69ca6c4"><div class="ttname"><a href="group__window.html#gafb3cdc45297e06d8f1eb13adc69ca6c4">GLFW_VISIBLE</a></div><div class="ttdeci">#define GLFW_VISIBLE</div><div class="ttdoc">Window visibility window hint and attribute.</div><div class="ttdef"><b>Definition:</b> glfw3.h:782</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