rusty_snek_gaem/target/doc/glutin/struct.GlWindow.html
2018-10-28 21:14:05 -05:00

123 lines
44 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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 `GlWindow` struct in crate `glutin`."><meta name="keywords" content="rust, rustlang, rust-lang, GlWindow"><title>glutin::GlWindow - 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">&#9776;</div><p class='location'>Struct GlWindow</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.window">window</a><a href="#method.context">context</a></div><a class="sidebar-title" href="#deref-methods">Methods from Deref&lt;Target=Window&gt;</a><div class="sidebar-links"><a href="#method.set_title">set_title</a><a href="#method.show">show</a><a href="#method.hide">hide</a><a href="#method.get_position">get_position</a><a href="#method.get_inner_position">get_inner_position</a><a href="#method.set_position">set_position</a><a href="#method.get_inner_size">get_inner_size</a><a href="#method.get_outer_size">get_outer_size</a><a href="#method.set_inner_size">set_inner_size</a><a href="#method.set_min_dimensions">set_min_dimensions</a><a href="#method.set_max_dimensions">set_max_dimensions</a><a href="#method.set_resizable">set_resizable</a><a href="#method.get_hidpi_factor">get_hidpi_factor</a><a href="#method.set_cursor">set_cursor</a><a href="#method.set_cursor_position">set_cursor_position</a><a href="#method.grab_cursor">grab_cursor</a><a href="#method.hide_cursor">hide_cursor</a><a href="#method.set_maximized">set_maximized</a><a href="#method.set_fullscreen">set_fullscreen</a><a href="#method.set_decorations">set_decorations</a><a href="#method.set_always_on_top">set_always_on_top</a><a href="#method.set_window_icon">set_window_icon</a><a href="#method.set_ime_spot">set_ime_spot</a><a href="#method.get_current_monitor">get_current_monitor</a><a href="#method.get_available_monitors">get_available_monitors</a><a href="#method.get_primary_monitor">get_primary_monitor</a><a href="#method.id">id</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-GlContext">GlContext</a><a href="#impl-Deref">Deref</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: 'GlWindow', 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=''>GlWindow</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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/glutin/lib.rs.html#205-208' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct GlWindow { /* fields omitted */ }</pre></div><div class='docblock'><p>Represents an OpenGL context and a Window with which it is associated.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">events_loop</span> <span class="op">=</span> <span class="ident">glutin</span>::<span class="ident">EventsLoop</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">window</span> <span class="op">=</span> <span class="ident">glutin</span>::<span class="ident">WindowBuilder</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">glutin</span>::<span class="ident">ContextBuilder</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">gl_window</span> <span class="op">=</span> <span class="ident">glutin</span>::<span class="ident">GlWindow</span>::<span class="ident">new</span>(<span class="ident">window</span>, <span class="ident">context</span>, <span class="kw-2">&amp;</span><span class="ident">events_loop</span>).<span class="ident">unwrap</span>();
<span class="kw">unsafe</span> { <span class="ident">gl_window</span>.<span class="ident">make_current</span>().<span class="ident">unwrap</span>() };
<span class="kw">loop</span> {
<span class="ident">events_loop</span>.<span class="ident">poll_events</span>(<span class="op">|</span><span class="ident">event</span><span class="op">|</span> {
<span class="kw">match</span> <span class="ident">event</span> {
<span class="comment">// process events here</span>
<span class="kw">_</span> <span class="op">=&gt;</span> ()
}
});
<span class="comment">// draw everything here</span>
<span class="ident">gl_window</span>.<span class="ident">swap_buffers</span>();
<span class="ident">std</span>::<span class="ident">thread</span>::<span class="ident">sleep</span>(<span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">Duration</span>::<span class="ident">from_millis</span>(<span class="number">17</span>));
}</pre>
</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 class="struct" href="../glutin/struct.GlWindow.html" title="struct glutin::GlWindow">GlWindow</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#360-390' 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>(<br>&nbsp;&nbsp;&nbsp;&nbsp;window_builder: <a class="struct" href="../glutin/struct.WindowBuilder.html" title="struct glutin::WindowBuilder">WindowBuilder</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;context_builder: <a class="struct" href="../glutin/struct.ContextBuilder.html" title="struct glutin::ContextBuilder">ContextBuilder</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;events_loop: &amp;<a class="struct" href="../glutin/struct.EventsLoop.html" title="struct glutin::EventsLoop">EventsLoop</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, <a class="enum" href="../glutin/enum.CreationError.html" title="enum glutin::CreationError">CreationError</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#366-379' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Builds the given window along with the associated GL context, returning the pair as a
<code>GlWindow</code>.</p>
<p>Error should be very rare and only occur in case of permission denied, incompatible system,
out of memory, etc.</p>
</div><h4 id='method.window' class="method"><span id='window.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.window' class='fnname'>window</a>(&amp;self) -&gt; &amp;<a class="struct" href="../glutin/struct.Window.html" title="struct glutin::Window">Window</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#382-384' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Borrow the inner <code>Window</code>.</p>
</div><h4 id='method.context' class="method"><span id='context.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.context' class='fnname'>context</a>(&amp;self) -&gt; &amp;<a class="struct" href="../glutin/struct.Context.html" title="struct glutin::Context">Context</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#387-389' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Borrow the inner GL <code>Context</code>.</p>
</div></div><h2 id='deref-methods' class='small-section-header'>Methods from <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a>&lt;Target = <a class="struct" href="../glutin/struct.Window.html" title="struct glutin::Window">Window</a>&gt;<a href='#deref-methods' class='anchor'></a></h2><div class='impl-items'><h4 id='method.set_title' class="method"><span id='set_title.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_title' class='fnname'>set_title</a>(&amp;self, title: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#182-184' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Modifies the title of the window.</p>
<p>This is a no-op if the window has already been closed.</p>
</div><h4 id='method.show' class="method"><span id='show.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.show' class='fnname'>show</a>(&amp;self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#193-195' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Shows the window if it was hidden.</p>
<h2 id="platform-specific" class="section-header"><a href="#platform-specific">Platform-specific</a></h2>
<ul>
<li>Has no effect on Android</li>
</ul>
</div><h4 id='method.hide' class="method"><span id='hide.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.hide' class='fnname'>hide</a>(&amp;self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#204-206' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Hides the window if it was visible.</p>
<h2 id="platform-specific-1" class="section-header"><a href="#platform-specific-1">Platform-specific</a></h2>
<ul>
<li>Has no effect on Android</li>
</ul>
</div><h4 id='method.get_position' class="method"><span id='get_position.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_position' class='fnname'>get_position</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../glutin/dpi/struct.LogicalPosition.html" title="struct glutin::dpi::LogicalPosition">LogicalPosition</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#220-222' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the position of the top-left hand corner of the window relative to the
top-left hand corner of the desktop.</p>
<p>Note that the top-left hand corner of the desktop is not necessarily the same as
the screen. If the user uses a desktop with multiple monitors, the top-left hand corner
of the desktop is the top-left hand corner of the monitor at the top-left of the desktop.</p>
<p>The coordinates can be negative if the top-left hand corner of the window is outside
of the visible screen region.</p>
<p>Returns <code>None</code> if the window no longer exists.</p>
</div><h4 id='method.get_inner_position' class="method"><span id='get_inner_position.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_inner_position' class='fnname'>get_inner_position</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../glutin/dpi/struct.LogicalPosition.html" title="struct glutin::dpi::LogicalPosition">LogicalPosition</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#229-231' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the position of the top-left hand corner of the window's client area relative to the
top-left hand corner of the desktop.</p>
<p>The same conditions that apply to <code>get_position</code> apply to this method.</p>
</div><h4 id='method.set_position' class="method"><span id='set_position.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_position' class='fnname'>set_position</a>(&amp;self, position: <a class="struct" href="../glutin/dpi/struct.LogicalPosition.html" title="struct glutin::dpi::LogicalPosition">LogicalPosition</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#239-241' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Modifies the position of the window.</p>
<p>See <code>get_position</code> for more information about the coordinates.</p>
<p>This is a no-op if the window has already been closed.</p>
</div><h4 id='method.get_inner_size' class="method"><span id='get_inner_size.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_inner_size' class='fnname'>get_inner_size</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../glutin/dpi/struct.LogicalSize.html" title="struct glutin::dpi::LogicalSize">LogicalSize</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#251-253' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the logical size of the window's client area.</p>
<p>The client area is the content of the window, excluding the title bar and borders.</p>
<p>Converting the returned <code>LogicalSize</code> to <code>PhysicalSize</code> produces the size your framebuffer should be.</p>
<p>Returns <code>None</code> if the window no longer exists.</p>
</div><h4 id='method.get_outer_size' class="method"><span id='get_outer_size.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_outer_size' class='fnname'>get_outer_size</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../glutin/dpi/struct.LogicalSize.html" title="struct glutin::dpi::LogicalSize">LogicalSize</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#262-264' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the logical size of the entire window.</p>
<p>These dimensions include the title bar and borders. If you don't want that (and you usually don't),
use <code>get_inner_size</code> instead.</p>
<p>Returns <code>None</code> if the window no longer exists.</p>
</div><h4 id='method.set_inner_size' class="method"><span id='set_inner_size.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_inner_size' class='fnname'>set_inner_size</a>(&amp;self, size: <a class="struct" href="../glutin/dpi/struct.LogicalSize.html" title="struct glutin::dpi::LogicalSize">LogicalSize</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#272-274' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Modifies the inner size of the window.</p>
<p>See <code>get_inner_size</code> for more information about the values.</p>
<p>This is a no-op if the window has already been closed.</p>
</div><h4 id='method.set_min_dimensions' class="method"><span id='set_min_dimensions.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_min_dimensions' class='fnname'>set_min_dimensions</a>(&amp;self, dimensions: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../glutin/dpi/struct.LogicalSize.html" title="struct glutin::dpi::LogicalSize">LogicalSize</a>&gt;)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#278-280' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets a minimum dimension size for the window.</p>
</div><h4 id='method.set_max_dimensions' class="method"><span id='set_max_dimensions.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_max_dimensions' class='fnname'>set_max_dimensions</a>(&amp;self, dimensions: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../glutin/dpi/struct.LogicalSize.html" title="struct glutin::dpi::LogicalSize">LogicalSize</a>&gt;)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#284-286' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets a maximum dimension size for the window.</p>
</div><h4 id='method.set_resizable' class="method"><span id='set_resizable.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_resizable' class='fnname'>set_resizable</a>(&amp;self, resizable: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#299-301' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets whether the window is resizable or not.</p>
<p>Note that making the window unresizable doesn't exempt you from handling <code>Resized</code>, as that event can still be
triggered by DPI scaling, entering fullscreen mode, etc.</p>
<h2 id="platform-specific-2" class="section-header"><a href="#platform-specific-2">Platform-specific</a></h2>
<p>This only has an effect on desktop platforms.</p>
<p>Due to a bug in XFCE, this has no effect on Xfwm.</p>
</div><h4 id='method.get_hidpi_factor' class="method"><span id='get_hidpi_factor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_hidpi_factor' class='fnname'>get_hidpi_factor</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#316-318' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the DPI factor that can be used to map logical pixels to physical pixels, and vice versa.</p>
<p>See the <a href="dpi/index.html"><code>dpi</code></a> module for more information.</p>
<p>Note that this value can change depending on user action (for example if the window is
moved to another screen); as such, tracking <code>WindowEvent::HiDpiFactorChanged</code> events is
the most robust way to track the DPI you need to use to draw.</p>
<h2 id="platform-specific-3" class="section-header"><a href="#platform-specific-3">Platform-specific</a></h2>
<ul>
<li><strong>X11:</strong> Can be overridden using the <code>WINIT_HIDPI_FACTOR</code> environment variable.</li>
<li><strong>Android:</strong> Always returns 1.0.</li>
</ul>
</div><h4 id='method.set_cursor' class="method"><span id='set_cursor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_cursor' class='fnname'>set_cursor</a>(&amp;self, cursor: <a class="enum" href="../glutin/enum.MouseCursor.html" title="enum glutin::MouseCursor">MouseCursor</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#323-325' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Modifies the mouse cursor of the window.
Has no effect on Android.</p>
</div><h4 id='method.set_cursor_position' class="method"><span id='set_cursor_position.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_cursor_position' class='fnname'>set_cursor_position</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;position: <a class="struct" href="../glutin/dpi/struct.LogicalPosition.html" title="struct glutin::dpi::LogicalPosition">LogicalPosition</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#329-331' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Changes the position of the cursor in window coordinates.</p>
</div><h4 id='method.grab_cursor' class="method"><span id='grab_cursor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.grab_cursor' class='fnname'>grab_cursor</a>(&amp;self, grab: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#341-343' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Grabs the cursor, preventing it from leaving the window.</p>
<h2 id="platform-specific-4" class="section-header"><a href="#platform-specific-4">Platform-specific</a></h2>
<p>On macOS, this presently merely locks the cursor in a fixed location, which looks visually awkward.</p>
<p>This has no effect on Android or iOS.</p>
</div><h4 id='method.hide_cursor' class="method"><span id='hide_cursor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.hide_cursor' class='fnname'>hide_cursor</a>(&amp;self, hide: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#356-358' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Hides the cursor, making it invisible but still usable.</p>
<h2 id="platform-specific-5" class="section-header"><a href="#platform-specific-5">Platform-specific</a></h2>
<p>On Windows and X11, the cursor is only hidden within the confines of the window.</p>
<p>On macOS, the cursor is hidden as long as the window has input focus, even if the cursor is outside of the
window.</p>
<p>This has no effect on Android or iOS.</p>
</div><h4 id='method.set_maximized' class="method"><span id='set_maximized.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_maximized' class='fnname'>set_maximized</a>(&amp;self, maximized: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#362-364' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the window to maximized or back</p>
</div><h4 id='method.set_fullscreen' class="method"><span id='set_fullscreen.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_fullscreen' class='fnname'>set_fullscreen</a>(&amp;self, monitor: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../glutin/struct.MonitorId.html" title="struct glutin::MonitorId">MonitorId</a>&gt;)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#368-370' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the window to fullscreen or back</p>
</div><h4 id='method.set_decorations' class="method"><span id='set_decorations.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_decorations' class='fnname'>set_decorations</a>(&amp;self, decorations: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#374-376' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Turn window decorations on or off.</p>
</div><h4 id='method.set_always_on_top' class="method"><span id='set_always_on_top.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_always_on_top' class='fnname'>set_always_on_top</a>(&amp;self, always_on_top: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#380-382' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Change whether or not the window will always be on top of other windows.</p>
</div><h4 id='method.set_window_icon' class="method"><span id='set_window_icon.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_window_icon' class='fnname'>set_window_icon</a>(&amp;self, window_icon: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../glutin/struct.Icon.html" title="struct glutin::Icon">Icon</a>&gt;)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#393-395' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the window icon. On Windows and X11, this is typically the small icon in the top-left
corner of the titlebar.</p>
<p>For more usage notes, see <code>WindowBuilder::with_window_icon</code>.</p>
<h2 id="platform-specific-6" class="section-header"><a href="#platform-specific-6">Platform-specific</a></h2>
<p>This only has an effect on Windows and X11.</p>
</div><h4 id='method.set_ime_spot' class="method"><span id='set_ime_spot.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_ime_spot' class='fnname'>set_ime_spot</a>(&amp;self, position: <a class="struct" href="../glutin/dpi/struct.LogicalPosition.html" title="struct glutin::dpi::LogicalPosition">LogicalPosition</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#399-401' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets location of IME candidate box in client area coordinates relative to the top left.</p>
</div><h4 id='method.get_current_monitor' class="method"><span id='get_current_monitor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_current_monitor' class='fnname'>get_current_monitor</a>(&amp;self) -&gt; <a class="struct" href="../glutin/struct.MonitorId.html" title="struct glutin::MonitorId">MonitorId</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#405-407' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the monitor on which the window currently resides</p>
</div><h4 id='method.get_available_monitors' class="method"><div class="important-traits"><div class='tooltip'><span class='tooltiptext'>Important traits for <a class="struct" href="../glutin/struct.AvailableMonitorsIter.html" title="struct glutin::AvailableMonitorsIter">AvailableMonitorsIter</a></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../glutin/struct.AvailableMonitorsIter.html" title="struct glutin::AvailableMonitorsIter">AvailableMonitorsIter</a></h3><code class="content"><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../glutin/struct.AvailableMonitorsIter.html" title="struct glutin::AvailableMonitorsIter">AvailableMonitorsIter</a></span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="struct" href="../glutin/struct.MonitorId.html" title="struct glutin::MonitorId">MonitorId</a>;</span></code></div></div><span id='get_available_monitors.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_available_monitors' class='fnname'>get_available_monitors</a>(&amp;self) -&gt; <a class="struct" href="../glutin/struct.AvailableMonitorsIter.html" title="struct glutin::AvailableMonitorsIter">AvailableMonitorsIter</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#413-416' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the list of all the monitors available on the system.</p>
<p>This is the same as <code>EventsLoop::get_available_monitors</code>, and is provided for convenience.</p>
</div><h4 id='method.get_primary_monitor' class="method"><span id='get_primary_monitor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_primary_monitor' class='fnname'>get_primary_monitor</a>(&amp;self) -&gt; <a class="struct" href="../glutin/struct.MonitorId.html" title="struct glutin::MonitorId">MonitorId</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#422-424' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the primary monitor of the system.</p>
<p>This is the same as <code>EventsLoop::get_primary_monitor</code>, and is provided for convenience.</p>
</div><h4 id='method.id' class="method"><span id='id.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.id' class='fnname'>id</a>(&amp;self) -&gt; <a class="struct" href="../glutin/struct.WindowId.html" title="struct glutin::WindowId">WindowId</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#427-429' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-GlContext' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../glutin/trait.GlContext.html" title="trait glutin::GlContext">GlContext</a> for <a class="struct" href="../glutin/struct.GlWindow.html" title="struct glutin::GlWindow">GlWindow</a></code><a href='#impl-GlContext' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#423-451' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.make_current' class="method"><span id='make_current.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../glutin/trait.GlContext.html#tymethod.make_current' class='fnname'>make_current</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../glutin/enum.ContextError.html" title="enum glutin::ContextError">ContextError</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#424-426' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the context as the current context.</p>
</div><h4 id='method.is_current' class="method"><span id='is_current.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../glutin/trait.GlContext.html#tymethod.is_current' class='fnname'>is_current</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#428-430' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns true if this context is the current one in this thread.</p>
</div><h4 id='method.get_proc_address' class="method"><span id='get_proc_address.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../glutin/trait.GlContext.html#tymethod.get_proc_address' class='fnname'>get_proc_address</a>(&amp;self, addr: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#432-434' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the address of an OpenGL function.</p>
</div><h4 id='method.swap_buffers' class="method"><span id='swap_buffers.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../glutin/trait.GlContext.html#tymethod.swap_buffers' class='fnname'>swap_buffers</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../glutin/enum.ContextError.html" title="enum glutin::ContextError">ContextError</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#436-438' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Swaps the buffers in case of double or triple buffering. <a href="../glutin/trait.GlContext.html#tymethod.swap_buffers">Read more</a></p>
</div><h4 id='method.get_api' class="method"><span id='get_api.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../glutin/trait.GlContext.html#tymethod.get_api' class='fnname'>get_api</a>(&amp;self) -&gt; <a class="enum" href="../glutin/enum.Api.html" title="enum glutin::Api">Api</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#440-442' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the OpenGL API being used.</p>
</div><h4 id='method.get_pixel_format' class="method"><span id='get_pixel_format.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../glutin/trait.GlContext.html#tymethod.get_pixel_format' class='fnname'>get_pixel_format</a>(&amp;self) -&gt; <a class="struct" href="../glutin/struct.PixelFormat.html" title="struct glutin::PixelFormat">PixelFormat</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#444-446' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the pixel format of the main framebuffer of the context.</p>
</div><h4 id='method.resize' class="method"><span id='resize.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../glutin/trait.GlContext.html#tymethod.resize' class='fnname'>resize</a>(&amp;self, size: <a class="struct" href="../glutin/dpi/struct.PhysicalSize.html" title="struct glutin::dpi::PhysicalSize">PhysicalSize</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#448-450' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Resize the GL context. <a href="../glutin/trait.GlContext.html#tymethod.resize">Read more</a></p>
</div></div><h3 id='impl-Deref' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../glutin/struct.GlWindow.html" title="struct glutin::GlWindow">GlWindow</a></code><a href='#impl-Deref' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#453-458' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><span id='Target.t' class='invisible'><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = <a class="struct" href="../glutin/struct.Window.html" title="struct glutin::Window">Window</a></code></span></h4>
<div class='docblock'><p>The resulting type after dereferencing.</p>
</div><h4 id='method.deref' class="method"><span id='deref.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&amp;self) -&gt; &amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" title="type core::ops::deref::Deref::Target">Target</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/glutin/lib.rs.html#455-457' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Dereferences the value.</p>
</div></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 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.GlWindow.html" title="struct glutin::GlWindow">GlWindow</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 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.GlWindow.html" title="struct glutin::GlWindow">GlWindow</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>&#9166;</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>