mirror of
https://github.com/neogeek23/rusty_snek_gaem.git
synced 2026-02-04 19:18:44 +00:00
50 lines
18 KiB
HTML
50 lines
18 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ContextBuilder` struct in crate `glutin`."><meta name="keywords" content="rust, rustlang, rust-lang, ContextBuilder"><title>glutin::ContextBuilder - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><p class='location'>Struct ContextBuilder</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.gl_attr">gl_attr</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.with_gl">with_gl</a><a href="#method.with_gl_profile">with_gl_profile</a><a href="#method.with_gl_debug_flag">with_gl_debug_flag</a><a href="#method.with_gl_robustness">with_gl_robustness</a><a href="#method.with_vsync">with_vsync</a><a href="#method.with_shared_lists">with_shared_lists</a><a href="#method.with_multisampling">with_multisampling</a><a href="#method.with_depth_buffer">with_depth_buffer</a><a href="#method.with_stencil_buffer">with_stencil_buffer</a><a href="#method.with_pixel_format">with_pixel_format</a><a href="#method.with_stereoscopy">with_stereoscopy</a><a href="#method.with_srgb">with_srgb</a><a href="#method.with_double_buffer">with_double_buffer</a><a href="#method.with_hardware_acceleration">with_hardware_acceleration</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='index.html'>glutin</a></p><script>window.sidebarCurrent = {name: 'ContextBuilder', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>glutin</a>::<wbr><a class="struct" href=''>ContextBuilder</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/glutin/lib.rs.html#168-173' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct ContextBuilder<'a> {
|
||
pub gl_attr: <a class="struct" href="../glutin/struct.GlAttributes.html" title="struct glutin::GlAttributes">GlAttributes</a><&'a <a class="struct" href="../glutin/struct.Context.html" title="struct glutin::Context">Context</a>>,
|
||
// some fields omitted
|
||
}</pre></div><div class='docblock'><p>Object that allows you to build <code>Context</code>s.</p>
|
||
</div><h2 id='fields' class='fields small-section-header'>
|
||
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.gl_attr" class="structfield small-section-header">
|
||
<a href="#structfield.gl_attr" class="anchor field"></a>
|
||
<span id="gl_attr.v" class='invisible'>
|
||
<code>gl_attr: <a class="struct" href="../glutin/struct.GlAttributes.html" title="struct glutin::GlAttributes">GlAttributes</a><&'a <a class="struct" href="../glutin/struct.Context.html" title="struct glutin::Context">Context</a>></code>
|
||
</span></span><div class='docblock'><p>The attributes to use to create the context.</p>
|
||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<'a> <a class="struct" href="../glutin/struct.ContextBuilder.html" title="struct glutin::ContextBuilder">ContextBuilder</a><'a></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#210-358' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.new' class='fnname'>new</a>() -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#212-217' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Initializes a new <code>ContextBuilder</code> with default values.</p>
|
||
</div><h4 id='method.with_gl' class="method"><span id='with_gl.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_gl' class='fnname'>with_gl</a>(self, request: <a class="enum" href="../glutin/enum.GlRequest.html" title="enum glutin::GlRequest">GlRequest</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#221-224' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets how the backend should choose the OpenGL API and version.</p>
|
||
</div><h4 id='method.with_gl_profile' class="method"><span id='with_gl_profile.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_gl_profile' class='fnname'>with_gl_profile</a>(self, profile: <a class="enum" href="../glutin/enum.GlProfile.html" title="enum glutin::GlProfile">GlProfile</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#228-231' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the desired OpenGL context profile.</p>
|
||
</div><h4 id='method.with_gl_debug_flag' class="method"><span id='with_gl_debug_flag.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_gl_debug_flag' class='fnname'>with_gl_debug_flag</a>(self, flag: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#238-241' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the <em>debug</em> flag for the OpenGL context.</p>
|
||
<p>The default value for this flag is <code>cfg!(debug_assertions)</code>, which means that it's enabled
|
||
when you run <code>cargo build</code> and disabled when you run <code>cargo build --release</code>.</p>
|
||
</div><h4 id='method.with_gl_robustness' class="method"><span id='with_gl_robustness.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_gl_robustness' class='fnname'>with_gl_robustness</a>(self, robustness: <a class="enum" href="../glutin/enum.Robustness.html" title="enum glutin::Robustness">Robustness</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#245-248' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the robustness of the OpenGL context. See the docs of <code>Robustness</code>.</p>
|
||
</div><h4 id='method.with_vsync' class="method"><span id='with_vsync.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_vsync' class='fnname'>with_vsync</a>(self, vsync: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#254-257' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Requests that the window has vsync enabled.</p>
|
||
<p>By default, vsync is not enabled.</p>
|
||
</div><h4 id='method.with_shared_lists' class="method"><span id='with_shared_lists.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_shared_lists' class='fnname'>with_shared_lists</a>(self, other: &'a <a class="struct" href="../glutin/struct.Context.html" title="struct glutin::Context">Context</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#261-264' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Share the display lists with the given <code>Context</code>.</p>
|
||
</div><h4 id='method.with_multisampling' class="method"><span id='with_multisampling.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_multisampling' class='fnname'>with_multisampling</a>(self, samples: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#273-282' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the multisampling level to request. A value of <code>0</code> indicates that multisampling must
|
||
not be enabled.</p>
|
||
<h1 id="panic" class="section-header"><a href="#panic">Panic</a></h1>
|
||
<p>Will panic if <code>samples</code> is not a power of two.</p>
|
||
</div><h4 id='method.with_depth_buffer' class="method"><span id='with_depth_buffer.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_depth_buffer' class='fnname'>with_depth_buffer</a>(self, bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#286-289' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the number of bits in the depth buffer.</p>
|
||
</div><h4 id='method.with_stencil_buffer' class="method"><span id='with_stencil_buffer.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_stencil_buffer' class='fnname'>with_stencil_buffer</a>(self, bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#293-296' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the number of bits in the stencil buffer.</p>
|
||
</div><h4 id='method.with_pixel_format' class="method"><span id='with_pixel_format.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_pixel_format' class='fnname'>with_pixel_format</a>(self, color_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, alpha_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#300-304' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the number of bits in the color buffer.</p>
|
||
</div><h4 id='method.with_stereoscopy' class="method"><span id='with_stereoscopy.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_stereoscopy' class='fnname'>with_stereoscopy</a>(self) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#308-311' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Request the backend to be stereoscopic.</p>
|
||
</div><h4 id='method.with_srgb' class="method"><span id='with_srgb.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_srgb' class='fnname'>with_srgb</a>(self, srgb_enabled: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#317-320' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets whether sRGB should be enabled on the window.</p>
|
||
<p>The default value is <code>false</code>.</p>
|
||
</div><h4 id='method.with_double_buffer' class="method"><span id='with_double_buffer.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_double_buffer' class='fnname'>with_double_buffer</a>(self, double_buffer: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#335-338' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets whether double buffering should be enabled.</p>
|
||
<p>The default value is <code>None</code>.</p>
|
||
<h2 id="platform-specific" class="section-header"><a href="#platform-specific">Platform-specific</a></h2>
|
||
<p>This option will be taken into account on the following platforms:</p>
|
||
<ul>
|
||
<li>MacOS</li>
|
||
<li>Linux using GLX with X</li>
|
||
<li>Windows using WGL</li>
|
||
</ul>
|
||
</div><h4 id='method.with_hardware_acceleration' class="method"><span id='with_hardware_acceleration.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_hardware_acceleration' class='fnname'>with_hardware_acceleration</a>(self, acceleration: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#354-357' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets whether hardware acceleration is required.</p>
|
||
<p>The default value is <code>Some(true)</code></p>
|
||
<h2 id="platform-specific-1" class="section-header"><a href="#platform-specific-1">Platform-specific</a></h2>
|
||
<p>This option will be taken into account on the following platforms:</p>
|
||
<ul>
|
||
<li>MacOS</li>
|
||
<li>Linux using EGL with either X or Wayland</li>
|
||
<li>Windows using EGL or WGL</li>
|
||
<li>Android using EGL</li>
|
||
</ul>
|
||
</div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../glutin/struct.ContextBuilder.html" title="struct glutin::ContextBuilder">ContextBuilder</a><'a></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../glutin/struct.ContextBuilder.html" title="struct glutin::ContextBuilder">ContextBuilder</a><'a></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g. <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "glutin";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html> |