This commit is contained in:
dabreegster 2021-02-07 03:13:50 +00:00
parent bb287d1416
commit df44d24aee
30 changed files with 479 additions and 442 deletions

View File

@ -1,5 +1,5 @@
<!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 `BUILT_TIME_UTC` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>game::pregame::built_info::BUILT_TIME_UTC - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[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><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a></p><script>window.sidebarCurrent = {name: "BUILT_TIME_UTC", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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="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/game/home/runner/work/abstreet/abstreet/target/debug/build/game-00b039a36f4c038f/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = &quot;Sat, 06 Feb 2021 23:26:36 +0000&quot;;</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
<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="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/game/home/runner/work/abstreet/abstreet/target/debug/build/game-00b039a36f4c038f/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = &quot;Sun, 07 Feb 2021 03:11:40 +0000&quot;;</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -122,7 +122,7 @@
<span class="doccomment">/// The output of `rustdoc -V`</span>
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;rustdoc 1.49.0 (e1884a8e3 2020-12-29)&quot;</span>;
<span class="doccomment">/// The built-time in RFC2822, UTC</span>
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;Sat, 06 Feb 2021 23:26:36 +0000&quot;</span>;
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;Sun, 07 Feb 2021 03:11:40 +0000&quot;</span>;
<span class="doccomment">/// The target architecture, given by `cfg!(target_arch)`.</span>
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">CFG_TARGET_ARCH</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;x86_64&quot;</span>;
<span class="doccomment">/// The endianness, given by `cfg!(target_endian)`.</span>

View File

@ -598,6 +598,54 @@
<span id="595">595</span>
<span id="596">596</span>
<span id="597">597</span>
<span id="598">598</span>
<span id="599">599</span>
<span id="600">600</span>
<span id="601">601</span>
<span id="602">602</span>
<span id="603">603</span>
<span id="604">604</span>
<span id="605">605</span>
<span id="606">606</span>
<span id="607">607</span>
<span id="608">608</span>
<span id="609">609</span>
<span id="610">610</span>
<span id="611">611</span>
<span id="612">612</span>
<span id="613">613</span>
<span id="614">614</span>
<span id="615">615</span>
<span id="616">616</span>
<span id="617">617</span>
<span id="618">618</span>
<span id="619">619</span>
<span id="620">620</span>
<span id="621">621</span>
<span id="622">622</span>
<span id="623">623</span>
<span id="624">624</span>
<span id="625">625</span>
<span id="626">626</span>
<span id="627">627</span>
<span id="628">628</span>
<span id="629">629</span>
<span id="630">630</span>
<span id="631">631</span>
<span id="632">632</span>
<span id="633">633</span>
<span id="634">634</span>
<span id="635">635</span>
<span id="636">636</span>
<span id="637">637</span>
<span id="638">638</span>
<span id="639">639</span>
<span id="640">640</span>
<span id="641">641</span>
<span id="642">642</span>
<span id="643">643</span>
<span id="644">644</span>
<span id="645">645</span>
</pre><div class="example-wrap"><pre class="rust ">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">cell</span>::<span class="ident">Cell</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">rc</span>::<span class="ident">Rc</span>;
@ -613,6 +661,64 @@
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">&quot;wasm-backend&quot;</span>)]</span>
<span class="kw">pub</span> <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">backend_glow_wasm</span>::<span class="ident">setup</span>;
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">unsafe</span> <span class="kw">fn</span> <span class="ident">build_program</span>(
<span class="ident">gl</span>: <span class="kw-2">&amp;</span><span class="ident">glow</span>::<span class="ident">Context</span>,
<span class="ident">vertex_shader_src</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>,
<span class="ident">fragment_shader_src</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">anyhow</span>::<span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">glow</span>::<span class="ident">Program</span><span class="op">&gt;</span> {
<span class="kw">let</span> <span class="ident">program</span> <span class="op">=</span> <span class="ident">gl</span>.<span class="ident">create_program</span>().<span class="ident">expect</span>(<span class="string">&quot;Cannot create program&quot;</span>);
<span class="kw">let</span> <span class="ident">shaders</span> <span class="op">=</span> [
<span class="ident">compile_shader</span>(<span class="ident">gl</span>, <span class="ident">glow</span>::<span class="ident">VERTEX_SHADER</span>, <span class="ident">vertex_shader_src</span>)<span class="question-mark">?</span>,
<span class="ident">compile_shader</span>(<span class="ident">gl</span>, <span class="ident">glow</span>::<span class="ident">FRAGMENT_SHADER</span>, <span class="ident">fragment_shader_src</span>)<span class="question-mark">?</span>,
];
<span class="kw">for</span> <span class="ident">shader</span> <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="ident">shaders</span> {
<span class="ident">gl</span>.<span class="ident">attach_shader</span>(<span class="ident">program</span>, <span class="kw-2">*</span><span class="ident">shader</span>);
}
<span class="ident">gl</span>.<span class="ident">link_program</span>(<span class="ident">program</span>);
<span class="kw">if</span> <span class="op">!</span><span class="ident">gl</span>.<span class="ident">get_program_link_status</span>(<span class="ident">program</span>) {
<span class="macro">error</span><span class="macro">!</span>(<span class="string">&quot;Linking error: {}&quot;</span>, <span class="ident">gl</span>.<span class="ident">get_program_info_log</span>(<span class="ident">program</span>));
<span class="macro">panic</span><span class="macro">!</span>(<span class="ident">gl</span>.<span class="ident">get_program_info_log</span>(<span class="ident">program</span>));
}
<span class="kw">for</span> <span class="ident">shader</span> <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="ident">shaders</span> {
<span class="ident">gl</span>.<span class="ident">detach_shader</span>(<span class="ident">program</span>, <span class="kw-2">*</span><span class="ident">shader</span>);
<span class="ident">gl</span>.<span class="ident">delete_shader</span>(<span class="kw-2">*</span><span class="ident">shader</span>);
}
<span class="ident">gl</span>.<span class="ident">use_program</span>(<span class="prelude-val">Some</span>(<span class="ident">program</span>));
<span class="ident">gl</span>.<span class="ident">enable</span>(<span class="ident">glow</span>::<span class="ident">SCISSOR_TEST</span>);
<span class="ident">gl</span>.<span class="ident">enable</span>(<span class="ident">glow</span>::<span class="ident">DEPTH_TEST</span>);
<span class="ident">gl</span>.<span class="ident">depth_func</span>(<span class="ident">glow</span>::<span class="ident">LEQUAL</span>);
<span class="ident">gl</span>.<span class="ident">enable</span>(<span class="ident">glow</span>::<span class="ident">BLEND</span>);
<span class="ident">gl</span>.<span class="ident">blend_func_separate</span>(
<span class="ident">glow</span>::<span class="ident">ONE</span>,
<span class="ident">glow</span>::<span class="ident">ONE_MINUS_SRC_ALPHA</span>,
<span class="ident">glow</span>::<span class="ident">ONE_MINUS_DST_ALPHA</span>,
<span class="ident">glow</span>::<span class="ident">ONE</span>,
);
<span class="prelude-val">Ok</span>(<span class="ident">program</span>)
}
<span class="kw">unsafe</span> <span class="kw">fn</span> <span class="ident">compile_shader</span>(
<span class="ident">gl</span>: <span class="kw-2">&amp;</span><span class="ident">glow</span>::<span class="ident">Context</span>,
<span class="ident">shader_type</span>: <span class="ident">u32</span>,
<span class="ident">shader_source</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">anyhow</span>::<span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">glow</span>::<span class="ident">Shader</span><span class="op">&gt;</span> {
<span class="kw">let</span> <span class="ident">shader</span> <span class="op">=</span> <span class="ident">gl</span>.<span class="ident">create_shader</span>(<span class="ident">shader_type</span>).<span class="ident">map_err</span>(<span class="op">|</span><span class="ident">e</span><span class="op">|</span> <span class="macro">anyhow</span><span class="macro">!</span>(<span class="ident">e</span>))<span class="question-mark">?</span>;
<span class="ident">gl</span>.<span class="ident">shader_source</span>(<span class="ident">shader</span>, <span class="ident">shader_source</span>);
<span class="ident">gl</span>.<span class="ident">compile_shader</span>(<span class="ident">shader</span>);
<span class="kw">if</span> <span class="op">!</span><span class="ident">gl</span>.<span class="ident">get_shader_compile_status</span>(<span class="ident">shader</span>) {
<span class="macro">bail</span><span class="macro">!</span>(<span class="string">&quot;error compiling shader: {}&quot;</span>, <span class="ident">gl</span>.<span class="ident">get_shader_info_log</span>(<span class="ident">shader</span>));
}
<span class="prelude-val">Ok</span>(<span class="ident">shader</span>)
}
<span class="comment">// Represents one frame that&#39;s gonna be drawn</span>
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">GfxCtxInnards</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span><span class="op">&gt;</span> {
<span class="ident">gl</span>: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a</span> <span class="ident">glow</span>::<span class="ident">Context</span>,
@ -1019,182 +1125,172 @@
<span class="doccomment">///</span>
<span class="doccomment">/// Implementation is based on the the description of ArrayTextures from:</span>
<span class="doccomment">/// https://www.khronos.org/opengl/wiki/Array_Texture.</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">load_textures</span>(
<span class="ident">gl</span>: <span class="kw-2">&amp;</span><span class="ident">glow</span>::<span class="ident">Context</span>,
<span class="ident">image_bytes</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;</span>,
<span class="ident">sprite_length</span>: <span class="ident">u32</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>(), <span class="ident">Box</span><span class="op">&lt;</span><span class="ident">dyn</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span><span class="op">&gt;</span><span class="op">&gt;</span> {
<span class="kw">let</span> <span class="ident">dynamic_img</span> <span class="op">=</span> <span class="ident">image</span>::<span class="ident">load_from_memory</span>(<span class="kw-2">&amp;</span><span class="ident">image_bytes</span>)<span class="question-mark">?</span>;
<span class="kw">let</span> <span class="ident">img</span> <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="ident">image</span>::<span class="ident">DynamicImage</span>::<span class="ident">ImageRgba8</span>(<span class="ident">img</span>) <span class="op">=</span> <span class="ident">dynamic_img</span> {
<span class="ident">img</span>
} <span class="kw">else</span> {
<span class="macro">todo</span><span class="macro">!</span>(<span class="string">&quot;support other image formats&quot;</span>);
};
<span class="doccomment">///</span>
<span class="doccomment">/// OpenGL texture arrays expect each texture&#39;s bytes to be contiguous, but it&#39;s conventional to</span>
<span class="doccomment">/// store textures in a grid within a single spritesheet image, where a row and column traverses</span>
<span class="doccomment">/// multiple sprites.</span>
<span class="doccomment">///</span>
<span class="doccomment">/// For example, if we had 6 textures, A-F, the input spritesheet bytes would be like:</span>
<span class="doccomment">/// [[AAA, BBB, CCC],</span>
<span class="doccomment">/// [AAA, BBB, CCC]</span>
<span class="doccomment">/// [AAA, BBB, CCC],</span>
<span class="doccomment">/// [DDD, EEE, FFF],</span>
<span class="doccomment">/// [DDD, EEE, FFF],</span>
<span class="doccomment">/// [DDD, EEE, FFF]]</span>
<span class="doccomment">///</span>
<span class="doccomment">/// Which we need to convert to:</span>
<span class="doccomment">/// [[AAAAAAAAA],</span>
<span class="doccomment">/// [BBBBBBBBB],</span>
<span class="doccomment">/// [CCCCCCCCC],</span>
<span class="doccomment">/// [DDDDDDDDD],</span>
<span class="doccomment">/// [EEEEEEEEE],</span>
<span class="doccomment">/// [FFFFFFFFF]]</span>
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">SpriteTexture</span> {
<span class="ident">texture_bytes</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;</span>,
<span class="ident">sprite_width</span>: <span class="ident">u32</span>,
<span class="ident">sprite_height</span>: <span class="ident">u32</span>,
<span class="ident">sprite_count</span>: <span class="ident">u32</span>,
}
<span class="kw">let</span> <span class="ident">format</span> <span class="op">=</span> <span class="ident">glow</span>::<span class="ident">RGBA</span>;
<span class="kw">let</span> <span class="ident">target</span> <span class="op">=</span> <span class="ident">glow</span>::<span class="ident">TEXTURE_2D_ARRAY</span>;
<span class="kw">let</span> <span class="ident">mipmap_level</span> <span class="op">=</span> <span class="number">1</span>;
<span class="kw">let</span> <span class="ident">internal_format</span> <span class="op">=</span> <span class="ident">glow</span>::<span class="ident">RGBA</span>;
<span class="kw">let</span> <span class="ident">bytes_per_pixel</span> <span class="op">=</span> <span class="number">4</span>;
<span class="kw">impl</span> <span class="ident">SpriteTexture</span> {
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(
<span class="ident">sprite_bytes</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;</span>,
<span class="ident">sprite_width</span>: <span class="ident">u32</span>,
<span class="ident">sprite_height</span>: <span class="ident">u32</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">anyhow</span>::<span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="self">Self</span><span class="op">&gt;</span> {
<span class="kw">let</span> <span class="ident">dynamic_img</span> <span class="op">=</span> <span class="ident">image</span>::<span class="ident">load_from_memory</span>(<span class="kw-2">&amp;</span><span class="ident">sprite_bytes</span>)<span class="question-mark">?</span>;
<span class="kw">let</span> <span class="ident">texture_id</span> <span class="op">=</span> <span class="kw">unsafe</span> { <span class="ident">gl</span>.<span class="ident">create_texture</span>()<span class="question-mark">?</span> };
<span class="kw">unsafe</span> {
<span class="ident">gl</span>.<span class="ident">bind_texture</span>(<span class="ident">target</span>, <span class="prelude-val">Some</span>(<span class="ident">texture_id</span>));
}
<span class="kw">let</span> <span class="ident">img</span> <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="ident">image</span>::<span class="ident">DynamicImage</span>::<span class="ident">ImageRgba8</span>(<span class="ident">img</span>) <span class="op">=</span> <span class="ident">dynamic_img</span> {
<span class="ident">img</span>
} <span class="kw">else</span> {
<span class="macro">todo</span><span class="macro">!</span>(<span class="string">&quot;support other image formats&quot;</span>);
};
<span class="kw">let</span> (<span class="ident">img_width</span>, <span class="ident">img_height</span>) <span class="op">=</span> <span class="ident">img</span>.<span class="ident">dimensions</span>();
<span class="kw">let</span> <span class="ident">sprite_height</span> <span class="op">=</span> <span class="ident">sprite_length</span>;
<span class="kw">let</span> <span class="ident">sprites_per_row</span> <span class="op">=</span> <span class="ident">img_width</span> <span class="op">/</span> <span class="ident">sprite_length</span>;
<span class="kw">let</span> <span class="ident">sprites_per_column</span> <span class="op">=</span> <span class="ident">img_height</span> <span class="op">/</span> <span class="ident">sprite_length</span>;
<span class="kw">let</span> <span class="ident">sprite_count</span> <span class="op">=</span> <span class="ident">sprites_per_row</span> <span class="op">*</span> <span class="ident">sprites_per_column</span>;
<span class="kw">let</span> <span class="ident">bytes_per_pixel</span> <span class="op">=</span> <span class="number">4</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="ident">sprites_per_row</span> <span class="op">*</span> <span class="ident">sprite_length</span>,
<span class="ident">img_width</span>,
<span class="string">&quot;sprites must align exactly&quot;</span>
);
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="ident">sprites_per_column</span> <span class="op">*</span> <span class="ident">sprite_height</span>,
<span class="ident">img_height</span>,
<span class="string">&quot;sprites must align exactly&quot;</span>
);
<span class="kw">let</span> (<span class="ident">img_width</span>, <span class="ident">img_height</span>) <span class="op">=</span> <span class="ident">img</span>.<span class="ident">dimensions</span>();
<span class="kw">let</span> <span class="ident">sprites_per_row</span> <span class="op">=</span> <span class="ident">img_width</span> <span class="op">/</span> <span class="ident">sprite_width</span>;
<span class="kw">let</span> <span class="ident">sprites_per_column</span> <span class="op">=</span> <span class="ident">img_height</span> <span class="op">/</span> <span class="ident">sprite_height</span>;
<span class="kw">let</span> <span class="ident">sprite_count</span> <span class="op">=</span> <span class="ident">sprites_per_row</span> <span class="op">*</span> <span class="ident">sprites_per_column</span>;
<span class="macro">info</span><span class="macro">!</span>(
<span class="string">&quot;img_size: {}x{}px ({} px), sprite_size: {}x{}px, sprites: {}x{} ({} sprites)&quot;</span>,
<span class="ident">img_width</span>,
<span class="ident">img_height</span>,
<span class="ident">img</span>.<span class="ident">pixels</span>().<span class="ident">len</span>(),
<span class="ident">sprite_length</span>,
<span class="ident">sprite_height</span>,
<span class="ident">sprites_per_row</span>,
<span class="ident">sprites_per_column</span>,
<span class="ident">sprite_count</span>
);
<span class="comment">// Allocate the storage.</span>
<span class="kw">unsafe</span> {
<span class="ident">gl</span>.<span class="ident">tex_storage_3d</span>(
<span class="ident">target</span>,
<span class="ident">mipmap_level</span>,
<span class="ident">internal_format</span>,
<span class="ident">sprite_length</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="ident">sprite_height</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="ident">sprite_count</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="ident">sprites_per_row</span> <span class="op">*</span> <span class="ident">sprite_width</span>,
<span class="ident">img_width</span>,
<span class="string">&quot;sprites must align exactly&quot;</span>
);
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="ident">sprites_per_column</span> <span class="op">*</span> <span class="ident">sprite_height</span>,
<span class="ident">img_height</span>,
<span class="string">&quot;sprites must align exactly&quot;</span>
);
}
<span class="comment">// Upload pixel data.</span>
<span class="comment">//</span>
<span class="comment">// From: https://www.khronos.org/opengl/wiki/Array_Texture#Creation_and_Management</span>
<span class="comment">// &gt; The first 0 refers to the mipmap level (level 0, since there&#39;s only 1)</span>
<span class="comment">// &gt; The following 2 zeroes refers to the x and y offsets in case you only want to</span>
<span class="comment">// &gt; specify a subrectangle.</span>
<span class="comment">// &gt; The final 0 refers to the layer index offset (we start from index 0 and have 2</span>
<span class="comment">// &gt; levels).</span>
<span class="comment">// &gt; Altogether you can specify a 3D box subset of the overall texture, but only one</span>
<span class="comment">// &gt; mip level at a time.</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">formatted_pixel_bytes</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;</span> <span class="op">=</span>
<span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">img</span>.<span class="ident">pixels</span>().<span class="ident">len</span>() <span class="op">*</span> <span class="ident">bytes_per_pixel</span>);
<span class="macro">info</span><span class="macro">!</span>(
<span class="string">&quot;img_size: {}x{}px ({} px), sprite_size: {}x{}px, sprites: {}x{} ({} sprites)&quot;</span>,
<span class="ident">img_width</span>,
<span class="ident">img_height</span>,
<span class="ident">img</span>.<span class="ident">pixels</span>().<span class="ident">len</span>(),
<span class="ident">sprite_width</span>,
<span class="ident">sprite_height</span>,
<span class="ident">sprites_per_row</span>,
<span class="ident">sprites_per_column</span>,
<span class="ident">sprite_count</span>
);
<span class="comment">// In order to avoid branching in our shader logic, all shapes are rendered with a texture.</span>
<span class="comment">// Even &quot;non-textured&quot; styles like Fill::Color, use a &quot;default&quot; no-op (pure white) texture,</span>
<span class="comment">// which we generate here.</span>
<span class="ident">formatted_pixel_bytes</span>.<span class="ident">append</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="macro">vec</span><span class="macro">!</span>[
<span class="number">255</span>;
(<span class="ident">sprite_length</span> <span class="op">*</span> <span class="ident">sprite_height</span>) <span class="kw">as</span> <span class="ident">usize</span>
<span class="op">*</span> <span class="ident">bytes_per_pixel</span>
]);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">texture_bytes</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">img</span>.<span class="ident">pixels</span>().<span class="ident">len</span>() <span class="op">*</span> <span class="ident">bytes_per_pixel</span>);
<span class="comment">// OpenGL texture arrays expect each texture&#39;s bytes to be contiguous, but it&#39;s conventional to</span>
<span class="comment">// store textures in a grid within a single spritesheet image, where a row and column traverses</span>
<span class="comment">// multiple sprites.</span>
<span class="comment">//</span>
<span class="comment">// For example, if we had 6 textures, A-F, the input spritesheet bytes would be like:</span>
<span class="comment">// [[AAA, BBB, CCC],</span>
<span class="comment">// [AAA, BBB, CCC]</span>
<span class="comment">// [AAA, BBB, CCC],</span>
<span class="comment">// [DDD, EEE, FFF],</span>
<span class="comment">// [DDD, EEE, FFF],</span>
<span class="comment">// [DDD, EEE, FFF]]</span>
<span class="comment">//</span>
<span class="comment">// Which we need to convert to:</span>
<span class="comment">// [[AAAAAAAAA],</span>
<span class="comment">// [BBBBBBBBB],</span>
<span class="comment">// [CCCCCCCCC],</span>
<span class="comment">// [DDDDDDDDD],</span>
<span class="comment">// [EEEEEEEEE],</span>
<span class="comment">// [FFFFFFFFF]]</span>
<span class="kw">use</span> <span class="ident">image</span>::<span class="ident">GenericImageView</span>;
<span class="kw">for</span> <span class="ident">y</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">sprites_per_column</span> {
<span class="kw">for</span> <span class="ident">x</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">sprites_per_row</span> {
<span class="kw">let</span> <span class="ident">sprite_cell</span> <span class="op">=</span> <span class="ident">img</span>.<span class="ident">view</span>(
<span class="ident">x</span> <span class="op">*</span> <span class="ident">sprite_length</span>,
<span class="ident">y</span> <span class="op">*</span> <span class="ident">sprite_height</span>,
<span class="ident">sprite_length</span>,
<span class="ident">sprite_height</span>,
);
<span class="kw">for</span> <span class="ident">p</span> <span class="kw">in</span> <span class="ident">sprite_cell</span>.<span class="ident">pixels</span>() {
<span class="ident">formatted_pixel_bytes</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&amp;</span><span class="ident">p</span>.<span class="number">2</span> .<span class="number">0</span>);
<span class="comment">// In order to avoid branching in our shader logic, all shapes are rendered with a texture.</span>
<span class="comment">// Even &quot;non-textured&quot; styles like Fill::Color, use a &quot;default&quot; no-op (pure white) texture,</span>
<span class="comment">// which we generate here.</span>
<span class="ident">texture_bytes</span>.<span class="ident">append</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="macro">vec</span><span class="macro">!</span>[
<span class="number">255</span>;
(<span class="ident">sprite_width</span> <span class="op">*</span> <span class="ident">sprite_height</span>) <span class="kw">as</span> <span class="ident">usize</span>
<span class="op">*</span> <span class="ident">bytes_per_pixel</span>
]);
<span class="kw">use</span> <span class="ident">image</span>::<span class="ident">GenericImageView</span>;
<span class="kw">for</span> <span class="ident">y</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">sprites_per_column</span> {
<span class="kw">for</span> <span class="ident">x</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">sprites_per_row</span> {
<span class="kw">let</span> <span class="ident">sprite_cell</span> <span class="op">=</span> <span class="ident">img</span>.<span class="ident">view</span>(
<span class="ident">x</span> <span class="op">*</span> <span class="ident">sprite_width</span>,
<span class="ident">y</span> <span class="op">*</span> <span class="ident">sprite_height</span>,
<span class="ident">sprite_width</span>,
<span class="ident">sprite_height</span>,
);
<span class="kw">for</span> <span class="ident">p</span> <span class="kw">in</span> <span class="ident">sprite_cell</span>.<span class="ident">pixels</span>() {
<span class="ident">texture_bytes</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&amp;</span><span class="ident">p</span>.<span class="number">2</span> .<span class="number">0</span>);
}
}
}
<span class="prelude-val">Ok</span>(<span class="self">Self</span> {
<span class="ident">texture_bytes</span>,
<span class="ident">sprite_width</span>,
<span class="ident">sprite_height</span>,
<span class="ident">sprite_count</span>,
})
}
<span class="comment">// prepare and generate mipmaps</span>
<span class="kw">unsafe</span> {
<span class="ident">gl</span>.<span class="ident">tex_sub_image_3d</span>(
<span class="ident">target</span>,
<span class="number">0</span>,
<span class="number">0</span>,
<span class="number">0</span>,
<span class="number">0</span>,
<span class="ident">sprite_length</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="ident">sprite_height</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="ident">sprite_count</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="ident">format</span>,
<span class="ident">glow</span>::<span class="ident">UNSIGNED_BYTE</span>,
<span class="ident">glow</span>::<span class="ident">PixelUnpackData</span>::<span class="ident">Slice</span>(<span class="kw-2">&amp;</span><span class="ident">formatted_pixel_bytes</span>),
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused</span>)]</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">upload_webgl1</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">_gl</span>: <span class="kw-2">&amp;</span><span class="ident">glow</span>::<span class="ident">Context</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">anyhow</span>::<span class="prelude-ty">Result</span><span class="op">&lt;</span>()<span class="op">&gt;</span> {
<span class="macro">warn</span><span class="macro">!</span>(
<span class="string">&quot;texture uploading for WebGL 1.0 is not yet supported. Enable WebGL 2.0 on your \
browser.&quot;</span>
);
<span class="ident">gl</span>.<span class="ident">tex_image_3d</span>(
<span class="ident">target</span>,
<span class="number">0</span>,
<span class="ident">format</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="ident">sprite_length</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="ident">sprite_height</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="ident">sprite_count</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="number">0</span>,
<span class="ident">format</span>,
<span class="ident">glow</span>::<span class="ident">UNSIGNED_BYTE</span>,
<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="ident">formatted_pixel_bytes</span>),
);
<span class="ident">gl</span>.<span class="ident">tex_image_3d</span>(
<span class="ident">target</span>,
<span class="number">1</span>,
<span class="ident">format</span> <span class="kw">as</span> <span class="ident">i32</span>,
(<span class="ident">sprite_length</span> <span class="op">/</span> <span class="number">2</span>) <span class="kw">as</span> <span class="ident">i32</span>,
(<span class="ident">sprite_height</span> <span class="op">/</span> <span class="number">2</span>) <span class="kw">as</span> <span class="ident">i32</span>,
<span class="ident">sprite_count</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="number">0</span>,
<span class="ident">format</span>,
<span class="ident">glow</span>::<span class="ident">UNSIGNED_BYTE</span>,
<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="ident">formatted_pixel_bytes</span>),
);
<span class="ident">gl</span>.<span class="ident">tex_image_3d</span>(
<span class="ident">target</span>,
<span class="number">2</span>,
<span class="ident">format</span> <span class="kw">as</span> <span class="ident">i32</span>,
(<span class="ident">sprite_length</span> <span class="op">/</span> <span class="number">4</span>) <span class="kw">as</span> <span class="ident">i32</span>,
(<span class="ident">sprite_height</span> <span class="op">/</span> <span class="number">4</span>) <span class="kw">as</span> <span class="ident">i32</span>,
<span class="ident">sprite_count</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="number">0</span>,
<span class="ident">format</span>,
<span class="ident">glow</span>::<span class="ident">UNSIGNED_BYTE</span>,
<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="ident">formatted_pixel_bytes</span>),
);
<span class="ident">gl</span>.<span class="ident">generate_mipmap</span>(<span class="ident">target</span>);
<span class="prelude-val">Ok</span>(())
}
<span class="prelude-val">Ok</span>(())
<span class="comment">// Utilizes `tex_storage_3d` which isn&#39;t supported by WebGL 1.0.</span>
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused</span>)]</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">upload_gl2</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">gl</span>: <span class="kw-2">&amp;</span><span class="ident">glow</span>::<span class="ident">Context</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">anyhow</span>::<span class="prelude-ty">Result</span><span class="op">&lt;</span>()<span class="op">&gt;</span> {
<span class="kw">let</span> <span class="ident">texture_id</span> <span class="op">=</span> <span class="kw">unsafe</span> {
<span class="ident">gl</span>.<span class="ident">create_texture</span>()
.<span class="ident">map_err</span>(<span class="op">|</span><span class="ident">err</span><span class="op">|</span> <span class="macro">anyhow</span><span class="macro">!</span>(<span class="string">&quot;error creating texture: {}&quot;</span>, <span class="ident">err</span>))<span class="question-mark">?</span>
};
<span class="kw">let</span> <span class="ident">format</span> <span class="op">=</span> <span class="ident">glow</span>::<span class="ident">RGBA</span>;
<span class="kw">let</span> <span class="ident">target</span> <span class="op">=</span> <span class="ident">glow</span>::<span class="ident">TEXTURE_2D_ARRAY</span>;
<span class="kw">let</span> <span class="ident">mipmap_levels</span>: <span class="ident">u32</span> <span class="op">=</span> <span class="number">2</span>;
<span class="kw">let</span> <span class="ident">internal_format</span> <span class="op">=</span> <span class="ident">glow</span>::<span class="ident">RGBA</span>;
<span class="kw">unsafe</span> {
<span class="ident">gl</span>.<span class="ident">bind_texture</span>(<span class="ident">target</span>, <span class="prelude-val">Some</span>(<span class="ident">texture_id</span>));
}
<span class="comment">// Allocate the storage.</span>
<span class="kw">unsafe</span> {
<span class="ident">gl</span>.<span class="ident">tex_storage_3d</span>(
<span class="ident">target</span>,
<span class="ident">mipmap_levels</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="ident">internal_format</span>,
<span class="self">self</span>.<span class="ident">sprite_width</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="self">self</span>.<span class="ident">sprite_height</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="self">self</span>.<span class="ident">sprite_count</span> <span class="kw">as</span> <span class="ident">i32</span>,
);
}
<span class="kw">unsafe</span> {
<span class="comment">// Upload pixel data for each mipmap level</span>
<span class="kw">for</span> <span class="ident">mipmap_level</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">mipmap_levels</span> {
<span class="kw">let</span> <span class="ident">width</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">sprite_width</span> <span class="kw">as</span> <span class="ident">i32</span> <span class="op">/</span> <span class="number">2i32</span>.<span class="ident">pow</span>(<span class="ident">mipmap_level</span>);
<span class="kw">let</span> <span class="ident">height</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">sprite_height</span> <span class="kw">as</span> <span class="ident">i32</span> <span class="op">/</span> <span class="number">2i32</span>.<span class="ident">pow</span>(<span class="ident">mipmap_level</span>);
<span class="ident">gl</span>.<span class="ident">tex_image_3d</span>(
<span class="ident">target</span>,
<span class="ident">mipmap_level</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="ident">format</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="ident">width</span>,
<span class="ident">height</span>,
<span class="self">self</span>.<span class="ident">sprite_count</span> <span class="kw">as</span> <span class="ident">i32</span>,
<span class="number">0</span>,
<span class="ident">format</span>,
<span class="ident">glow</span>::<span class="ident">UNSIGNED_BYTE</span>,
<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">texture_bytes</span>),
);
}
<span class="ident">gl</span>.<span class="ident">generate_mipmap</span>(<span class="ident">target</span>);
}
<span class="prelude-val">Ok</span>(())
}
}
</pre></div>
</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -1,159 +1,104 @@
<!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="Source of the Rust file `widgetry/src/backend_glow_native.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>backend_glow_native.rs - source</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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[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><a href='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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"><pre class="line-numbers"><span id="1"> 1</span>
<span id="2"> 2</span>
<span id="3"> 3</span>
<span id="4"> 4</span>
<span id="5"> 5</span>
<span id="6"> 6</span>
<span id="7"> 7</span>
<span id="8"> 8</span>
<span id="9"> 9</span>
<span id="10"> 10</span>
<span id="11"> 11</span>
<span id="12"> 12</span>
<span id="13"> 13</span>
<span id="14"> 14</span>
<span id="15"> 15</span>
<span id="16"> 16</span>
<span id="17"> 17</span>
<span id="18"> 18</span>
<span id="19"> 19</span>
<span id="20"> 20</span>
<span id="21"> 21</span>
<span id="22"> 22</span>
<span id="23"> 23</span>
<span id="24"> 24</span>
<span id="25"> 25</span>
<span id="26"> 26</span>
<span id="27"> 27</span>
<span id="28"> 28</span>
<span id="29"> 29</span>
<span id="30"> 30</span>
<span id="31"> 31</span>
<span id="32"> 32</span>
<span id="33"> 33</span>
<span id="34"> 34</span>
<span id="35"> 35</span>
<span id="36"> 36</span>
<span id="37"> 37</span>
<span id="38"> 38</span>
<span id="39"> 39</span>
<span id="40"> 40</span>
<span id="41"> 41</span>
<span id="42"> 42</span>
<span id="43"> 43</span>
<span id="44"> 44</span>
<span id="45"> 45</span>
<span id="46"> 46</span>
<span id="47"> 47</span>
<span id="48"> 48</span>
<span id="49"> 49</span>
<span id="50"> 50</span>
<span id="51"> 51</span>
<span id="52"> 52</span>
<span id="53"> 53</span>
<span id="54"> 54</span>
<span id="55"> 55</span>
<span id="56"> 56</span>
<span id="57"> 57</span>
<span id="58"> 58</span>
<span id="59"> 59</span>
<span id="60"> 60</span>
<span id="61"> 61</span>
<span id="62"> 62</span>
<span id="63"> 63</span>
<span id="64"> 64</span>
<span id="65"> 65</span>
<span id="66"> 66</span>
<span id="67"> 67</span>
<span id="68"> 68</span>
<span id="69"> 69</span>
<span id="70"> 70</span>
<span id="71"> 71</span>
<span id="72"> 72</span>
<span id="73"> 73</span>
<span id="74"> 74</span>
<span id="75"> 75</span>
<span id="76"> 76</span>
<span id="77"> 77</span>
<span id="78"> 78</span>
<span id="79"> 79</span>
<span id="80"> 80</span>
<span id="81"> 81</span>
<span id="82"> 82</span>
<span id="83"> 83</span>
<span id="84"> 84</span>
<span id="85"> 85</span>
<span id="86"> 86</span>
<span id="87"> 87</span>
<span id="88"> 88</span>
<span id="89"> 89</span>
<span id="90"> 90</span>
<span id="91"> 91</span>
<span id="92"> 92</span>
<span id="93"> 93</span>
<span id="94"> 94</span>
<span id="95"> 95</span>
<span id="96"> 96</span>
<span id="97"> 97</span>
<span id="98"> 98</span>
<span id="99"> 99</span>
<span id="100">100</span>
<span id="101">101</span>
<span id="102">102</span>
<span id="103">103</span>
<span id="104">104</span>
<span id="105">105</span>
<span id="106">106</span>
<span id="107">107</span>
<span id="108">108</span>
<span id="109">109</span>
<span id="110">110</span>
<span id="111">111</span>
<span id="112">112</span>
<span id="113">113</span>
<span id="114">114</span>
<span id="115">115</span>
<span id="116">116</span>
<span id="117">117</span>
<span id="118">118</span>
<span id="119">119</span>
<span id="120">120</span>
<span id="121">121</span>
<span id="122">122</span>
<span id="123">123</span>
<span id="124">124</span>
<span id="125">125</span>
<span id="126">126</span>
<span id="127">127</span>
<span id="128">128</span>
<span id="129">129</span>
<span id="130">130</span>
<span id="131">131</span>
<span id="132">132</span>
<span id="133">133</span>
<span id="134">134</span>
<span id="135">135</span>
<span id="136">136</span>
<span id="137">137</span>
<span id="138">138</span>
<span id="139">139</span>
<span id="140">140</span>
<span id="141">141</span>
<span id="142">142</span>
<span id="143">143</span>
<span id="144">144</span>
<span id="145">145</span>
<span id="146">146</span>
<span id="147">147</span>
<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"><pre class="line-numbers"><span id="1"> 1</span>
<span id="2"> 2</span>
<span id="3"> 3</span>
<span id="4"> 4</span>
<span id="5"> 5</span>
<span id="6"> 6</span>
<span id="7"> 7</span>
<span id="8"> 8</span>
<span id="9"> 9</span>
<span id="10">10</span>
<span id="11">11</span>
<span id="12">12</span>
<span id="13">13</span>
<span id="14">14</span>
<span id="15">15</span>
<span id="16">16</span>
<span id="17">17</span>
<span id="18">18</span>
<span id="19">19</span>
<span id="20">20</span>
<span id="21">21</span>
<span id="22">22</span>
<span id="23">23</span>
<span id="24">24</span>
<span id="25">25</span>
<span id="26">26</span>
<span id="27">27</span>
<span id="28">28</span>
<span id="29">29</span>
<span id="30">30</span>
<span id="31">31</span>
<span id="32">32</span>
<span id="33">33</span>
<span id="34">34</span>
<span id="35">35</span>
<span id="36">36</span>
<span id="37">37</span>
<span id="38">38</span>
<span id="39">39</span>
<span id="40">40</span>
<span id="41">41</span>
<span id="42">42</span>
<span id="43">43</span>
<span id="44">44</span>
<span id="45">45</span>
<span id="46">46</span>
<span id="47">47</span>
<span id="48">48</span>
<span id="49">49</span>
<span id="50">50</span>
<span id="51">51</span>
<span id="52">52</span>
<span id="53">53</span>
<span id="54">54</span>
<span id="55">55</span>
<span id="56">56</span>
<span id="57">57</span>
<span id="58">58</span>
<span id="59">59</span>
<span id="60">60</span>
<span id="61">61</span>
<span id="62">62</span>
<span id="63">63</span>
<span id="64">64</span>
<span id="65">65</span>
<span id="66">66</span>
<span id="67">67</span>
<span id="68">68</span>
<span id="69">69</span>
<span id="70">70</span>
<span id="71">71</span>
<span id="72">72</span>
<span id="73">73</span>
<span id="74">74</span>
<span id="75">75</span>
<span id="76">76</span>
<span id="77">77</span>
<span id="78">78</span>
<span id="79">79</span>
<span id="80">80</span>
<span id="81">81</span>
<span id="82">82</span>
<span id="83">83</span>
<span id="84">84</span>
<span id="85">85</span>
<span id="86">86</span>
<span id="87">87</span>
<span id="88">88</span>
<span id="89">89</span>
<span id="90">90</span>
<span id="91">91</span>
<span id="92">92</span>
<span id="93">93</span>
<span id="94">94</span>
</pre><div class="example-wrap"><pre class="rust ">
<span class="kw">use</span> <span class="ident">glow</span>::<span class="ident">HasContext</span>;
<span class="kw">use</span> <span class="ident">abstutil</span>::<span class="ident">Timer</span>;
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">backend_glow</span>::{<span class="ident">GfxCtxInnards</span>, <span class="ident">PrerenderInnards</span>};
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">backend_glow</span>::{<span class="ident">build_program</span>, <span class="ident">GfxCtxInnards</span>, <span class="ident">PrerenderInnards</span>, <span class="ident">SpriteTexture</span>};
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">ScreenDims</span>;
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">setup</span>(
@ -188,64 +133,39 @@
<span class="kw">let</span> <span class="ident">gl</span> <span class="op">=</span> <span class="kw">unsafe</span> {
<span class="ident">glow</span>::<span class="ident">Context</span>::<span class="ident">from_loader_function</span>(<span class="op">|</span><span class="ident">s</span><span class="op">|</span> <span class="ident">windowed_context</span>.<span class="ident">get_proc_address</span>(<span class="ident">s</span>) <span class="kw">as</span> <span class="kw-2">*</span><span class="kw">const</span> <span class="kw">_</span>)
};
<span class="kw">let</span> <span class="ident">program</span> <span class="op">=</span> <span class="kw">unsafe</span> { <span class="ident">gl</span>.<span class="ident">create_program</span>().<span class="ident">expect</span>(<span class="string">&quot;Cannot create program&quot;</span>) };
<span class="kw">unsafe</span> {
<span class="kw">let</span> <span class="ident">shaders</span> <span class="op">=</span> <span class="ident">compile_shaders</span>(
<span class="kw">let</span> <span class="ident">program</span> <span class="op">=</span> <span class="kw">unsafe</span> {
<span class="ident">build_program</span>(
<span class="kw-2">&amp;</span><span class="ident">gl</span>,
<span class="macro">include_str</span><span class="macro">!</span>(<span class="string">&quot;../shaders/vertex_140.glsl&quot;</span>),
<span class="macro">include_str</span><span class="macro">!</span>(<span class="string">&quot;../shaders/fragment_140.glsl&quot;</span>),
)
.<span class="ident">or_else</span>(<span class="op">|</span><span class="ident">err</span><span class="op">|</span> {
<span class="macro">warn</span><span class="macro">!</span>(
<span class="string">&quot;unable to compile default shaderrs, falling back to v300. error: {:?}&quot;</span>,
<span class="string">&quot;unable to build program with default shaderrs, falling back to v300. error: {:?}&quot;</span>,
<span class="ident">err</span>
);
<span class="ident">compile_shaders</span>(
<span class="ident">build_program</span>(
<span class="kw-2">&amp;</span><span class="ident">gl</span>,
<span class="macro">include_str</span><span class="macro">!</span>(<span class="string">&quot;../shaders/vertex_300.glsl&quot;</span>),
<span class="macro">include_str</span><span class="macro">!</span>(<span class="string">&quot;../shaders/fragment_300.glsl&quot;</span>),
)
})
.<span class="ident">unwrap_or_else</span>(<span class="op">|</span><span class="ident">err</span><span class="op">|</span> {
<span class="macro">panic</span><span class="macro">!</span>(<span class="string">&quot;error building shader: {:?}&quot;</span>, <span class="ident">err</span>);
});
<span class="kw">for</span> <span class="ident">shader</span> <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="ident">shaders</span> {
<span class="ident">gl</span>.<span class="ident">attach_shader</span>(<span class="ident">program</span>, <span class="kw-2">*</span><span class="ident">shader</span>);
}
<span class="ident">gl</span>.<span class="ident">link_program</span>(<span class="ident">program</span>);
<span class="kw">if</span> <span class="op">!</span><span class="ident">gl</span>.<span class="ident">get_program_link_status</span>(<span class="ident">program</span>) {
<span class="macro">panic</span><span class="macro">!</span>(<span class="ident">gl</span>.<span class="ident">get_program_info_log</span>(<span class="ident">program</span>));
}
<span class="kw">for</span> <span class="ident">shader</span> <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="ident">shaders</span> {
<span class="ident">gl</span>.<span class="ident">detach_shader</span>(<span class="ident">program</span>, <span class="kw-2">*</span><span class="ident">shader</span>);
<span class="ident">gl</span>.<span class="ident">delete_shader</span>(<span class="kw-2">*</span><span class="ident">shader</span>);
}
<span class="ident">gl</span>.<span class="ident">use_program</span>(<span class="prelude-val">Some</span>(<span class="ident">program</span>));
<span class="ident">gl</span>.<span class="ident">enable</span>(<span class="ident">glow</span>::<span class="ident">SCISSOR_TEST</span>);
<span class="ident">gl</span>.<span class="ident">enable</span>(<span class="ident">glow</span>::<span class="ident">DEPTH_TEST</span>);
<span class="ident">gl</span>.<span class="ident">depth_func</span>(<span class="ident">glow</span>::<span class="ident">LEQUAL</span>);
<span class="ident">gl</span>.<span class="ident">enable</span>(<span class="ident">glow</span>::<span class="ident">BLEND</span>);
<span class="ident">gl</span>.<span class="ident">blend_func_separate</span>(
<span class="ident">glow</span>::<span class="ident">ONE</span>,
<span class="ident">glow</span>::<span class="ident">ONE_MINUS_SRC_ALPHA</span>,
<span class="ident">glow</span>::<span class="ident">ONE_MINUS_DST_ALPHA</span>,
<span class="ident">glow</span>::<span class="ident">ONE</span>,
);
}
<span class="macro">panic</span><span class="macro">!</span>(<span class="string">&quot;error building program: {:?}&quot;</span>, <span class="ident">err</span>);
})
};
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="string">&quot;load textures&quot;</span>);
<span class="kw">crate</span>::<span class="ident">backend_glow</span>::<span class="ident">load_textures</span>(
<span class="kw-2">&amp;</span><span class="ident">gl</span>,
<span class="kw">let</span> <span class="ident">sprite_texture</span> <span class="op">=</span> <span class="ident">SpriteTexture</span>::<span class="ident">new</span>(
<span class="macro">include_bytes</span><span class="macro">!</span>(<span class="string">&quot;../textures/spritesheet.png&quot;</span>).<span class="ident">to_vec</span>(),
<span class="number">64</span>,
<span class="number">64</span>,
)
.<span class="ident">unwrap</span>();
.<span class="ident">expect</span>(<span class="string">&quot;failed to format texture sprite sheet&quot;</span>);
<span class="ident">sprite_texture</span>
.<span class="ident">upload_gl2</span>(<span class="kw-2">&amp;</span><span class="ident">gl</span>)
.<span class="ident">expect</span>(<span class="string">&quot;failed to upload textures&quot;</span>);
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="string">&quot;load textures&quot;</span>);
(
@ -270,31 +190,5 @@
<span class="self">self</span>.<span class="number">0</span>.<span class="ident">swap_buffers</span>().<span class="ident">unwrap</span>();
}
}
<span class="kw">unsafe</span> <span class="kw">fn</span> <span class="ident">compile_shaders</span>(
<span class="ident">gl</span>: <span class="kw-2">&amp;</span><span class="ident">glow</span>::<span class="ident">Context</span>,
<span class="ident">vertex_source</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>,
<span class="ident">fragment_source</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>[<span class="ident">u32</span>; <span class="number">2</span>], <span class="ident">Box</span><span class="op">&lt;</span><span class="ident">dyn</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span><span class="op">&gt;</span><span class="op">&gt;</span> {
<span class="kw">unsafe</span> <span class="kw">fn</span> <span class="ident">compile_shader</span>(
<span class="ident">gl</span>: <span class="kw-2">&amp;</span><span class="ident">glow</span>::<span class="ident">Context</span>,
<span class="ident">shader_type</span>: <span class="ident">u32</span>,
<span class="ident">shader_source</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">u32</span>, <span class="ident">Box</span><span class="op">&lt;</span><span class="ident">dyn</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span><span class="op">&gt;</span><span class="op">&gt;</span> {
<span class="kw">let</span> <span class="ident">shader</span> <span class="op">=</span> <span class="ident">gl</span>.<span class="ident">create_shader</span>(<span class="ident">shader_type</span>)<span class="question-mark">?</span>;
<span class="ident">gl</span>.<span class="ident">shader_source</span>(<span class="ident">shader</span>, <span class="ident">shader_source</span>);
<span class="ident">gl</span>.<span class="ident">compile_shader</span>(<span class="ident">shader</span>);
<span class="kw">if</span> <span class="ident">gl</span>.<span class="ident">get_shader_compile_status</span>(<span class="ident">shader</span>) {
<span class="prelude-val">Ok</span>(<span class="ident">shader</span>)
} <span class="kw">else</span> {
<span class="prelude-val">Err</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;error compiling shader: {}&quot;</span>, <span class="ident">gl</span>.<span class="ident">get_shader_info_log</span>(<span class="ident">shader</span>)).<span class="ident">into</span>())
}
};
<span class="prelude-val">Ok</span>([
<span class="ident">compile_shader</span>(<span class="ident">gl</span>, <span class="ident">glow</span>::<span class="ident">VERTEX_SHADER</span>, <span class="ident">vertex_source</span>)<span class="question-mark">?</span>,
<span class="ident">compile_shader</span>(<span class="ident">gl</span>, <span class="ident">glow</span>::<span class="ident">FRAGMENT_SHADER</span>, <span class="ident">fragment_source</span>)<span class="question-mark">?</span>,
])
}
</pre></div>
</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
<!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 `build_program` fn in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, build_program"><title>widgetry::backend_glow::build_program - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[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><a href='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a></p><script>window.sidebarCurrent = {name: "build_program", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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="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/widgetry/backend_glow.rs.html#15-56" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a>::<wbr><a class="fn" href="">build_program</a></span></h1><pre class="rust fn">pub(crate) unsafe fn build_program(<br>&nbsp;&nbsp;&nbsp;&nbsp;gl: &amp;Context, <br>&nbsp;&nbsp;&nbsp;&nbsp;vertex_shader_src: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;fragment_shader_src: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.38/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;Program&gt;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -0,0 +1,4 @@
<!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 `compile_shader` fn in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, compile_shader"><title>widgetry::backend_glow::compile_shader - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[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><a href='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a></p><script>window.sidebarCurrent = {name: "compile_shader", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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="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/widgetry/backend_glow.rs.html#58-71" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a>::<wbr><a class="fn" href="">compile_shader</a></span></h1><pre class="rust fn">unsafe fn compile_shader(<br>&nbsp;&nbsp;&nbsp;&nbsp;gl: &amp;Context, <br>&nbsp;&nbsp;&nbsp;&nbsp;shader_type: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;shader_source: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.38/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;Shader&gt;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -1,21 +0,0 @@
<!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 `load_textures` fn in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, load_textures"><title>widgetry::backend_glow::load_textures - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[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><a href='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a></p><script>window.sidebarCurrent = {name: "load_textures", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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="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/widgetry/backend_glow.rs.html#421-597" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a>::<wbr><a class="fn" href="">load_textures</a></span></h1><pre class="rust fn">pub fn load_textures(<br>&nbsp;&nbsp;&nbsp;&nbsp;gl: &amp;Context, <br>&nbsp;&nbsp;&nbsp;&nbsp;image_bytes: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;sprite_length: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</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/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>&gt;&gt;</pre><div class="docblock"><p>Uploads a sprite sheet of textures to the GPU so they can be used by Fill::Texture and
friends to paint shapes.</p>
<p><code>path</code> - image file which is a grid of images.
<code>sprite_length</code> - the width and height of an individual cell in the image grid</p>
<p>The image file can have any number of sprites, but they must all be the same size.</p>
<p>Once uploaded, textures are addressed by their id, starting from 1, from left to right, top to
bottom, like so:</p>
<p>┌─┬─┬─┐
│1│2│3│
├─┼─┼─┤
│4│5│6│
├─┼─┼─┤
│7│8│9│
└─┴─┴─┘</p>
<p>Texture(0) is reserved for a pure white (no-op) texture.</p>
<p>Implementation is based on the the description of ArrayTextures from:
https://www.khronos.org/opengl/wiki/Array_Texture.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -1,12 +1,12 @@
<!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 `backend_glow` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, backend_glow"><title>widgetry::backend_glow - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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><a href='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module backend_glow</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class="location"><a href="../index.html">widgetry</a></p><script>window.sidebarCurrent = {name: "backend_glow", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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="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/widgetry/backend_glow.rs.html#1-597" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">widgetry</a>::<wbr><a class="mod" href="">backend_glow</a></span></h1><h2 id="reexports" class="section-header"><a href="#reexports">Re-exports</a></h2>
<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="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/widgetry/backend_glow.rs.html#1-645" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">widgetry</a>::<wbr><a class="mod" href="">backend_glow</a></span></h1><h2 id="reexports" class="section-header"><a href="#reexports">Re-exports</a></h2>
<table><tr><td><code>pub use crate::backend_glow_native::<a class="fn" href="../../widgetry/backend_glow_native/fn.setup.html" title="fn widgetry::backend_glow_native::setup">setup</a>;</code></td></tr></table><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.Buffer.html" title="widgetry::backend_glow::Buffer struct">Buffer</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.Drawable.html" title="widgetry::backend_glow::Drawable struct">Drawable</a></td><td class="docblock-short"><p>Geometry that's been uploaded to the GPU once and can be quickly redrawn many times. Create by
creating a <code>GeomBatch</code> and calling <code>ctx.upload(batch)</code>.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.GfxCtxInnards.html" title="widgetry::backend_glow::GfxCtxInnards struct">GfxCtxInnards</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.PrerenderInnards.html" title="widgetry::backend_glow::PrerenderInnards struct">PrerenderInnards</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.VertexArray.html" title="widgetry::backend_glow::VertexArray struct">VertexArray</a></td><td class="docblock-short"></td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
<table><tr class="module-item"><td><a class="fn" href="fn.load_textures.html" title="widgetry::backend_glow::load_textures fn">load_textures</a></td><td class="docblock-short"><p>Uploads a sprite sheet of textures to the GPU so they can be used by Fill::Texture and
</td></tr><tr class="module-item"><td><a class="struct" href="struct.GfxCtxInnards.html" title="widgetry::backend_glow::GfxCtxInnards struct">GfxCtxInnards</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.PrerenderInnards.html" title="widgetry::backend_glow::PrerenderInnards struct">PrerenderInnards</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.SpriteTexture.html" title="widgetry::backend_glow::SpriteTexture struct">SpriteTexture</a></td><td class="docblock-short"><p>Uploads a sprite sheet of textures to the GPU so they can be used by Fill::Texture and
friends to paint shapes.</p>
</td></tr></table><h2 id="types" class="section-header"><a href="#types">Type Definitions</a></h2>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.VertexArray.html" title="widgetry::backend_glow::VertexArray struct">VertexArray</a></td><td class="docblock-short"></td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
<table><tr class="module-item"><td><a class="fn" href="fn.build_program.html" title="widgetry::backend_glow::build_program fn">build_program</a><a title="unsafe function" href="#"><sup></sup></a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="fn" href="fn.compile_shader.html" title="widgetry::backend_glow::compile_shader fn">compile_shader</a><a title="unsafe function" href="#"><sup></sup></a></td><td class="docblock-short"></td></tr></table><h2 id="types" class="section-header"><a href="#types">Type Definitions</a></h2>
<table><tr class="module-item"><td><a class="type" href="type.WindowAdapter.html" title="widgetry::backend_glow::WindowAdapter type">WindowAdapter</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -1 +1 @@
initSidebarItems({"fn":[["load_textures","Uploads a sprite sheet of textures to the GPU so they can be used by Fill::Texture and friends to paint shapes."]],"struct":[["Buffer",""],["Drawable","Geometry that's been uploaded to the GPU once and can be quickly redrawn many times. Create by creating a `GeomBatch` and calling `ctx.upload(batch)`."],["GfxCtxInnards",""],["PrerenderInnards",""],["VertexArray",""]],"type":[["WindowAdapter",""]]});
initSidebarItems({"fn":[["build_program",""],["compile_shader",""]],"struct":[["Buffer",""],["Drawable","Geometry that's been uploaded to the GPU once and can be quickly redrawn many times. Create by creating a `GeomBatch` and calling `ctx.upload(batch)`."],["GfxCtxInnards",""],["PrerenderInnards",""],["SpriteTexture","Uploads a sprite sheet of textures to the GPU so they can be used by Fill::Texture and friends to paint shapes."],["VertexArray",""]],"type":[["WindowAdapter",""]]});

View File

@ -1,11 +1,11 @@
<!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 `Buffer` struct in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, Buffer"><title>widgetry::backend_glow::Buffer - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></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><a href='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct Buffer</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.id">id</a><a href="#structfield.was_destroyed">was_destroyed</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.destroy">destroy</a><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Drop">Drop</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-Downcast">Downcast</a><a href="#impl-DowncastSync">DowncastSync</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-Same%3CT%3E">Same&lt;T&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a></p><script>window.sidebarCurrent = {name: "Buffer", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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="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/widgetry/backend_glow.rs.html#167-170" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a>::<wbr><a class="struct" href="">Buffer</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">struct Buffer {
<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="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/widgetry/backend_glow.rs.html#225-228" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a>::<wbr><a class="struct" href="">Buffer</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">struct Buffer {
id: &lt;Context as HasContext&gt;::Buffer,
was_destroyed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
}</pre></div><h2 id="fields" class="fields small-section-header">
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.id" class="structfield small-section-header"><a href="#structfield.id" class="anchor field"></a><code>id: &lt;Context as HasContext&gt;::Buffer</code></span><span id="structfield.was_destroyed" class="structfield small-section-header"><a href="#structfield.was_destroyed" class="anchor field"></a><code>was_destroyed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#172-186" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>fn <a href="#method.new" class="fnname">new</a>(gl: &amp;Context) -&gt; <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#173-179" title="goto source code">[src]</a></h4><h4 id="method.destroy" class="method"><code>fn <a href="#method.destroy" class="fnname">destroy</a>(&amp;mut self, gl: &amp;Context)</code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#181-185" title="goto source code">[src]</a></h4></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Drop" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#188-195" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#189-194" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.id" class="structfield small-section-header"><a href="#structfield.id" class="anchor field"></a><code>id: &lt;Context as HasContext&gt;::Buffer</code></span><span id="structfield.was_destroyed" class="structfield small-section-header"><a href="#structfield.was_destroyed" class="anchor field"></a><code>was_destroyed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#230-244" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>fn <a href="#method.new" class="fnname">new</a>(gl: &amp;Context) -&gt; <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#231-237" title="goto source code">[src]</a></h4><h4 id="method.destroy" class="method"><code>fn <a href="#method.destroy" class="fnname">destroy</a>(&amp;mut self, gl: &amp;Context)</code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#239-243" title="goto source code">[src]</a></h4></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Drop" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#246-253" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#247-252" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></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-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">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="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">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="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>

View File

@ -1,7 +1,7 @@
<!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 `Drawable` struct in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, Drawable"><title>widgetry::backend_glow::Drawable - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></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><a href='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct Drawable</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.elem_buffer">elem_buffer</a><a href="#structfield.gl">gl</a><a href="#structfield.num_indices">num_indices</a><a href="#structfield.vert_array">vert_array</a><a href="#structfield.vert_buffer">vert_buffer</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.empty">empty</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Drop">Drop</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-Downcast">Downcast</a><a href="#impl-DowncastSync">DowncastSync</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-Same%3CT%3E">Same&lt;T&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a></p><script>window.sidebarCurrent = {name: "Drawable", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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="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/widgetry/backend_glow.rs.html#111-117" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a>::<wbr><a class="struct" href="">Drawable</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Drawable {
<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="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/widgetry/backend_glow.rs.html#169-175" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a>::<wbr><a class="struct" href="">Drawable</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Drawable {
vert_array: <a class="struct" href="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a>,
vert_buffer: <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a>,
elem_buffer: <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a>,
@ -10,8 +10,8 @@
}</pre></div><div class="docblock"><p>Geometry that's been uploaded to the GPU once and can be quickly redrawn many times. Create by
creating a <code>GeomBatch</code> and calling <code>ctx.upload(batch)</code>.</p>
</div><h2 id="fields" class="fields small-section-header">
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.vert_array" class="structfield small-section-header"><a href="#structfield.vert_array" class="anchor field"></a><code>vert_array: <a class="struct" href="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code></span><span id="structfield.vert_buffer" class="structfield small-section-header"><a href="#structfield.vert_buffer" class="anchor field"></a><code>vert_buffer: <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code></span><span id="structfield.elem_buffer" class="structfield small-section-header"><a href="#structfield.elem_buffer" class="anchor field"></a><code>elem_buffer: <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code></span><span id="structfield.num_indices" class="structfield small-section-header"><a href="#structfield.num_indices" class="anchor field"></a><code>num_indices: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code></span><span id="structfield.gl" class="structfield small-section-header"><a href="#structfield.gl" class="anchor field"></a><code>gl: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Context&gt;</code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#128-133" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.empty" class="method"><code>pub fn <a href="#method.empty" class="fnname">empty</a>(ctx: &amp;<a class="struct" href="../../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>&lt;'_&gt;) -&gt; <a class="struct" href="../../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#130-132" title="goto source code">[src]</a></h4><div class="docblock"><p>This has no effect when drawn.</p>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Drop" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#119-126" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#121-125" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.vert_array" class="structfield small-section-header"><a href="#structfield.vert_array" class="anchor field"></a><code>vert_array: <a class="struct" href="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code></span><span id="structfield.vert_buffer" class="structfield small-section-header"><a href="#structfield.vert_buffer" class="anchor field"></a><code>vert_buffer: <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code></span><span id="structfield.elem_buffer" class="structfield small-section-header"><a href="#structfield.elem_buffer" class="anchor field"></a><code>elem_buffer: <a class="struct" href="../../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code></span><span id="structfield.num_indices" class="structfield small-section-header"><a href="#structfield.num_indices" class="anchor field"></a><code>num_indices: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code></span><span id="structfield.gl" class="structfield small-section-header"><a href="#structfield.gl" class="anchor field"></a><code>gl: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Context&gt;</code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#186-191" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.empty" class="method"><code>pub fn <a href="#method.empty" class="fnname">empty</a>(ctx: &amp;<a class="struct" href="../../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>&lt;'_&gt;) -&gt; <a class="struct" href="../../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#188-190" title="goto source code">[src]</a></h4><div class="docblock"><p>This has no effect when drawn.</p>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Drop" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#177-184" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#179-183" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></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-RefUnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">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="../../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">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="../../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,11 +1,11 @@
<!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 `VertexArray` struct in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, VertexArray"><title>widgetry::backend_glow::VertexArray - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></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><a href='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct VertexArray</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.id">id</a><a href="#structfield.was_destroyed">was_destroyed</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.destroy">destroy</a><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Drop">Drop</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-Downcast">Downcast</a><a href="#impl-DowncastSync">DowncastSync</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-Same%3CT%3E">Same&lt;T&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a></p><script>window.sidebarCurrent = {name: "VertexArray", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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="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/widgetry/backend_glow.rs.html#135-138" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a>::<wbr><a class="struct" href="">VertexArray</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">struct VertexArray {
<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="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/widgetry/backend_glow.rs.html#193-196" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a>::<wbr><a class="struct" href="">VertexArray</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">struct VertexArray {
id: &lt;Context as HasContext&gt;::VertexArray,
was_destroyed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
}</pre></div><h2 id="fields" class="fields small-section-header">
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.id" class="structfield small-section-header"><a href="#structfield.id" class="anchor field"></a><code>id: &lt;Context as HasContext&gt;::VertexArray</code></span><span id="structfield.was_destroyed" class="structfield small-section-header"><a href="#structfield.was_destroyed" class="anchor field"></a><code>was_destroyed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#140-156" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>fn <a href="#method.new" class="fnname">new</a>(gl: &amp;Context) -&gt; <a class="struct" href="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#141-147" title="goto source code">[src]</a></h4><h4 id="method.destroy" class="method"><code>fn <a href="#method.destroy" class="fnname">destroy</a>(&amp;mut self, gl: &amp;Context)</code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#149-155" title="goto source code">[src]</a></h4></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Drop" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#158-165" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#159-164" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.id" class="structfield small-section-header"><a href="#structfield.id" class="anchor field"></a><code>id: &lt;Context as HasContext&gt;::VertexArray</code></span><span id="structfield.was_destroyed" class="structfield small-section-header"><a href="#structfield.was_destroyed" class="anchor field"></a><code>was_destroyed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#198-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>fn <a href="#method.new" class="fnname">new</a>(gl: &amp;Context) -&gt; <a class="struct" href="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#199-205" title="goto source code">[src]</a></h4><h4 id="method.destroy" class="method"><code>fn <a href="#method.destroy" class="fnname">destroy</a>(&amp;mut self, gl: &amp;Context)</code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#207-213" title="goto source code">[src]</a></h4></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Drop" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#216-223" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</code><a class="srclink" href="../../src/widgetry/backend_glow.rs.html#217-222" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></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-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">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="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">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="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>

View File

@ -1,4 +1,4 @@
<!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 `WindowAdapter` type in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, WindowAdapter"><title>widgetry::backend_glow::WindowAdapter - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[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><a href='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Type Definition WindowAdapter</p><div class="sidebar-elems"><p class="location"><a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a></p><script>window.sidebarCurrent = {name: "WindowAdapter", ty: "type", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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="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/widgetry/backend_glow.rs.html#201" title="goto source code">[src]</a></span><span class="in-band">Type Definition <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a>::<wbr><a class="type" href="">WindowAdapter</a></span></h1><pre class="rust typedef">type WindowAdapter = <a class="struct" href="../../widgetry/backend_glow_native/struct.WindowAdapter.html" title="struct widgetry::backend_glow_native::WindowAdapter">WindowAdapter</a>;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
<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="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/widgetry/backend_glow.rs.html#259" title="goto source code">[src]</a></span><span class="in-band">Type Definition <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow</a>::<wbr><a class="type" href="">WindowAdapter</a></span></h1><pre class="rust typedef">type WindowAdapter = <a class="struct" href="../../widgetry/backend_glow_native/struct.WindowAdapter.html" title="struct widgetry::backend_glow_native::WindowAdapter">WindowAdapter</a>;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -1,4 +0,0 @@
<!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 `compile_shaders` fn in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, compile_shaders"><title>widgetry::backend_glow_native::compile_shaders - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[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><a href='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow_native</a></p><script>window.sidebarCurrent = {name: "compile_shaders", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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="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/widgetry/backend_glow_native.rs.html#123-147" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow_native</a>::<wbr><a class="fn" href="">compile_shaders</a></span></h1><pre class="rust fn">unsafe fn compile_shaders(<br>&nbsp;&nbsp;&nbsp;&nbsp;gl: &amp;Context, <br>&nbsp;&nbsp;&nbsp;&nbsp;vertex_source: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;fragment_source: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</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.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 2]</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>&gt;&gt;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -1,4 +1,4 @@
<!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 `setup` fn in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, setup"><title>widgetry::backend_glow_native::setup - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[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><a href='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow_native</a></p><script>window.sidebarCurrent = {name: "setup", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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="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/widgetry/backend_glow_native.rs.html#8-104" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow_native</a>::<wbr><a class="fn" href="">setup</a></span></h1><pre class="rust fn">pub fn setup(<br>&nbsp;&nbsp;&nbsp;&nbsp;window_title: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;timer: &amp;mut <a class="struct" href="../../abstutil/time/struct.Timer.html" title="struct abstutil::time::Timer">Timer</a>&lt;'_&gt;<br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../widgetry/backend_glow/struct.PrerenderInnards.html" title="struct widgetry::backend_glow::PrerenderInnards">PrerenderInnards</a>, EventLoop&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
<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="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/widgetry/backend_glow_native.rs.html#6-77" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">widgetry</a>::<wbr><a href="index.html">backend_glow_native</a>::<wbr><a class="fn" href="">setup</a></span></h1><pre class="rust fn">pub fn setup(<br>&nbsp;&nbsp;&nbsp;&nbsp;window_title: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;timer: &amp;mut <a class="struct" href="../../abstutil/time/struct.Timer.html" title="struct abstutil::time::Timer">Timer</a>&lt;'_&gt;<br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../widgetry/backend_glow/struct.PrerenderInnards.html" title="struct widgetry::backend_glow::PrerenderInnards">PrerenderInnards</a>, EventLoop&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -1,6 +1,6 @@
<!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 `backend_glow_native` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, backend_glow_native"><title>widgetry::backend_glow_native - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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><a href='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module backend_glow_native</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"><a href="../index.html">widgetry</a></p><script>window.sidebarCurrent = {name: "backend_glow_native", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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="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/widgetry/backend_glow_native.rs.html#1-147" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">widgetry</a>::<wbr><a class="mod" href="">backend_glow_native</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<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="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/widgetry/backend_glow_native.rs.html#1-94" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">widgetry</a>::<wbr><a class="mod" href="">backend_glow_native</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.WindowAdapter.html" title="widgetry::backend_glow_native::WindowAdapter struct">WindowAdapter</a></td><td class="docblock-short"></td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
<table><tr class="module-item"><td><a class="fn" href="fn.compile_shaders.html" title="widgetry::backend_glow_native::compile_shaders fn">compile_shaders</a><a title="unsafe function" href="#"><sup></sup></a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="fn" href="fn.setup.html" title="widgetry::backend_glow_native::setup fn">setup</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
<table><tr class="module-item"><td><a class="fn" href="fn.setup.html" title="widgetry::backend_glow_native::setup fn">setup</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -1 +1 @@
initSidebarItems({"fn":[["compile_shaders",""],["setup",""]],"struct":[["WindowAdapter",""]]});
initSidebarItems({"fn":[["setup",""]],"struct":[["WindowAdapter",""]]});

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<!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 `Drawable` struct in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, Drawable"><title>widgetry::Drawable - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></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><a href='../widgetry/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Struct Drawable</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.elem_buffer">elem_buffer</a><a href="#structfield.gl">gl</a><a href="#structfield.num_indices">num_indices</a><a href="#structfield.vert_array">vert_array</a><a href="#structfield.vert_buffer">vert_buffer</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.empty">empty</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Drop">Drop</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-Downcast">Downcast</a><a href="#impl-DowncastSync">DowncastSync</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-Same%3CT%3E">Same&lt;T&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="index.html">widgetry</a></p><script>window.sidebarCurrent = {name: "Drawable", 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!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<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="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/widgetry/backend_glow.rs.html#111-117" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="index.html">widgetry</a>::<wbr><a class="struct" href="">Drawable</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Drawable {
<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="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/widgetry/backend_glow.rs.html#169-175" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="index.html">widgetry</a>::<wbr><a class="struct" href="">Drawable</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Drawable {
vert_array: <a class="struct" href="../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a>,
vert_buffer: <a class="struct" href="../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a>,
elem_buffer: <a class="struct" href="../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a>,
@ -10,8 +10,8 @@
}</pre></div><div class="docblock"><p>Geometry that's been uploaded to the GPU once and can be quickly redrawn many times. Create by
creating a <code>GeomBatch</code> and calling <code>ctx.upload(batch)</code>.</p>
</div><h2 id="fields" class="fields small-section-header">
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.vert_array" class="structfield small-section-header"><a href="#structfield.vert_array" class="anchor field"></a><code>vert_array: <a class="struct" href="../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code></span><span id="structfield.vert_buffer" class="structfield small-section-header"><a href="#structfield.vert_buffer" class="anchor field"></a><code>vert_buffer: <a class="struct" href="../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code></span><span id="structfield.elem_buffer" class="structfield small-section-header"><a href="#structfield.elem_buffer" class="anchor field"></a><code>elem_buffer: <a class="struct" href="../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code></span><span id="structfield.num_indices" class="structfield small-section-header"><a href="#structfield.num_indices" class="anchor field"></a><code>num_indices: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code></span><span id="structfield.gl" class="structfield small-section-header"><a href="#structfield.gl" class="anchor field"></a><code>gl: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Context&gt;</code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../src/widgetry/backend_glow.rs.html#128-133" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.empty" class="method"><code>pub fn <a href="#method.empty" class="fnname">empty</a>(ctx: &amp;<a class="struct" href="../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>&lt;'_&gt;) -&gt; <a class="struct" href="../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a class="srclink" href="../src/widgetry/backend_glow.rs.html#130-132" title="goto source code">[src]</a></h4><div class="docblock"><p>This has no effect when drawn.</p>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Drop" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../src/widgetry/backend_glow.rs.html#119-126" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</code><a class="srclink" href="../src/widgetry/backend_glow.rs.html#121-125" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.vert_array" class="structfield small-section-header"><a href="#structfield.vert_array" class="anchor field"></a><code>vert_array: <a class="struct" href="../widgetry/backend_glow/struct.VertexArray.html" title="struct widgetry::backend_glow::VertexArray">VertexArray</a></code></span><span id="structfield.vert_buffer" class="structfield small-section-header"><a href="#structfield.vert_buffer" class="anchor field"></a><code>vert_buffer: <a class="struct" href="../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code></span><span id="structfield.elem_buffer" class="structfield small-section-header"><a href="#structfield.elem_buffer" class="anchor field"></a><code>elem_buffer: <a class="struct" href="../widgetry/backend_glow/struct.Buffer.html" title="struct widgetry::backend_glow::Buffer">Buffer</a></code></span><span id="structfield.num_indices" class="structfield small-section-header"><a href="#structfield.num_indices" class="anchor field"></a><code>num_indices: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code></span><span id="structfield.gl" class="structfield small-section-header"><a href="#structfield.gl" class="anchor field"></a><code>gl: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Context&gt;</code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../src/widgetry/backend_glow.rs.html#186-191" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.empty" class="method"><code>pub fn <a href="#method.empty" class="fnname">empty</a>(ctx: &amp;<a class="struct" href="../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>&lt;'_&gt;) -&gt; <a class="struct" href="../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a class="srclink" href="../src/widgetry/backend_glow.rs.html#188-190" title="goto source code">[src]</a></h4><div class="docblock"><p>This has no effect when drawn.</p>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Drop" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../src/widgetry/backend_glow.rs.html#177-184" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</code><a class="srclink" href="../src/widgetry/backend_glow.rs.html#179-183" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></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-RefUnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">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="../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">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="../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../widgetry/struct.Drawable.html" title="struct widgetry::Drawable">Drawable</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>