31 lines
9.9 KiB
HTML
31 lines
9.9 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A draw function used to draw `PhaseItem`s."><title>Draw in bevy_render::render_phase - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bevy_render" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="icon" href="https://bevyengine.org/assets/icon.png"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../bevy_render/index.html"><img src="https://bevyengine.org/assets/icon.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../bevy_render/index.html"><img src="https://bevyengine.org/assets/icon.png" alt="logo"></a><h2><a href="../../bevy_render/index.html">bevy_<wbr>render</a><span class="version">0.15.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Draw</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.draw" title="draw">draw</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.prepare" title="prepare">prepare</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In bevy_<wbr>render::<wbr>render_<wbr>phase</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">bevy_render</a>::<wbr><a href="index.html">render_phase</a></span><h1>Trait <span class="trait">Draw</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/bevy_render/render_phase/draw.rs.html#20-35">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Draw<P: <a class="trait" href="trait.PhaseItem.html" title="trait bevy_render::render_phase::PhaseItem">PhaseItem</a>>:
|
|
<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>
|
|
+ <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>
|
|
+ 'static {
|
|
// Required method
|
|
fn <a href="#tymethod.draw" class="fn">draw</a><'w>(
|
|
&mut self,
|
|
world: &'w <a class="struct" href="../../bevy_ecs/world/struct.World.html" title="struct bevy_ecs::world::World">World</a>,
|
|
pass: &mut <a class="struct" href="struct.TrackedRenderPass.html" title="struct bevy_render::render_phase::TrackedRenderPass">TrackedRenderPass</a><'w>,
|
|
view: <a class="struct" href="../../bevy_ecs/entity/struct.Entity.html" title="struct bevy_ecs::entity::Entity">Entity</a>,
|
|
item: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&P</a>,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.unit.html">()</a>, <a class="enum" href="enum.DrawError.html" title="enum bevy_render::render_phase::DrawError">DrawError</a>>;
|
|
|
|
// Provided method
|
|
fn <a href="#method.prepare" class="fn">prepare</a>(&mut self, world: &<a class="struct" href="../../bevy_ecs/world/struct.World.html" title="struct bevy_ecs::world::World">World</a>) { ... }
|
|
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A draw function used to draw <a href="trait.PhaseItem.html" title="trait bevy_render::render_phase::PhaseItem"><code>PhaseItem</code></a>s.</p>
|
|
<p>The draw function can retrieve and query the required ECS data from the render world.</p>
|
|
<p>This trait can either be implemented directly or implicitly composed out of multiple modular
|
|
<a href="trait.RenderCommand.html" title="trait bevy_render::render_phase::RenderCommand"><code>RenderCommand</code></a>s. For more details and an example see the <a href="trait.RenderCommand.html" title="trait bevy_render::render_phase::RenderCommand"><code>RenderCommand</code></a> documentation.</p>
|
|
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.draw" class="method"><a class="src rightside" href="../../src/bevy_render/render_phase/draw.rs.html#28-34">Source</a><h4 class="code-header">fn <a href="#tymethod.draw" class="fn">draw</a><'w>(
|
|
&mut self,
|
|
world: &'w <a class="struct" href="../../bevy_ecs/world/struct.World.html" title="struct bevy_ecs::world::World">World</a>,
|
|
pass: &mut <a class="struct" href="struct.TrackedRenderPass.html" title="struct bevy_render::render_phase::TrackedRenderPass">TrackedRenderPass</a><'w>,
|
|
view: <a class="struct" href="../../bevy_ecs/entity/struct.Entity.html" title="struct bevy_ecs::entity::Entity">Entity</a>,
|
|
item: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&P</a>,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.unit.html">()</a>, <a class="enum" href="enum.DrawError.html" title="enum bevy_render::render_phase::DrawError">DrawError</a>></h4></section></summary><div class="docblock"><p>Draws a <a href="trait.PhaseItem.html" title="trait bevy_render::render_phase::PhaseItem"><code>PhaseItem</code></a> by issuing zero or more <code>draw</code> calls via the <a href="struct.TrackedRenderPass.html" title="struct bevy_render::render_phase::TrackedRenderPass"><code>TrackedRenderPass</code></a>.</p>
|
|
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.prepare" class="method"><a class="src rightside" href="../../src/bevy_render/render_phase/draw.rs.html#25">Source</a><h4 class="code-header">fn <a href="#method.prepare" class="fn">prepare</a>(&mut self, world: &<a class="struct" href="../../bevy_ecs/world/struct.World.html" title="struct bevy_ecs::world::World">World</a>)</h4></section></summary><div class="docblock"><p>Prepares the draw function to be used. This is called once and only once before the phase
|
|
begins. There may be zero or more <a href="trait.Draw.html#tymethod.draw" title="method bevy_render::render_phase::Draw::draw"><code>draw</code></a> calls following a call to this function.
|
|
Implementing this is optional.</p>
|
|
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Draw%3CP%3E-for-RenderCommandState%3CP,+C%3E" class="impl"><a class="src rightside" href="../../src/bevy_render/render_phase/draw.rs.html#300-338">Source</a><a href="#impl-Draw%3CP%3E-for-RenderCommandState%3CP,+C%3E" class="anchor">§</a><h3 class="code-header">impl<P: <a class="trait" href="trait.PhaseItem.html" title="trait bevy_render::render_phase::PhaseItem">PhaseItem</a>, C: <a class="trait" href="trait.RenderCommand.html" title="trait bevy_render::render_phase::RenderCommand">RenderCommand</a><P> + <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static> <a class="trait" href="trait.Draw.html" title="trait bevy_render::render_phase::Draw">Draw</a><P> for <a class="struct" href="struct.RenderCommandState.html" title="struct bevy_render::render_phase::RenderCommandState">RenderCommandState</a><P, C><div class="where">where
|
|
C::<a class="associatedtype" href="trait.RenderCommand.html#associatedtype.Param" title="type bevy_render::render_phase::RenderCommand::Param">Param</a>: <a class="trait" href="../../bevy_ecs/system/system_param/trait.ReadOnlySystemParam.html" title="trait bevy_ecs::system::system_param::ReadOnlySystemParam">ReadOnlySystemParam</a>,</div></h3></section></div><script src="../../trait.impl/bevy_render/render_phase/draw/trait.Draw.js" async></script></section></div></main></body></html> |