Skip to content

Commit

Permalink
deploy: e49a93c
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDIMAS committed Oct 27, 2024
1 parent 121f580 commit 688a128
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
4 changes: 2 additions & 2 deletions code/snippets/src/resource/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn block_and_wait(texture_resource: Resource<Texture>) {
}
// ANCHOR_END: block_and_wait

// ANCHOR: embedded_resource
// ANCHOR: embedded_texture
fn embedded_resource() -> Option<Resource<Texture>> {
let data = include_bytes!("texture.png");
TextureResource::load_from_memory(
Expand All @@ -54,4 +54,4 @@ fn embedded_resource() -> Option<Resource<Texture>> {
)
.ok()
}
// ANCHOR_END: embedded_resource
// ANCHOR_END: embedded_texture
16 changes: 13 additions & 3 deletions print.html
Original file line number Diff line number Diff line change
Expand Up @@ -6720,9 +6720,19 @@ <h2 id="internal-state-and-access-to-data"><a class="header" href="#internal-sta
Internally Fyrox relies on <code>fetch</code> API, which is async by design and non-blocking. All these problems could be
avoided by embedding resources directly in the binary of your game using <code>include_bytes!</code> macro:</p>
<pre><pre class="playground"><code class="language-rust"><span class="boring">#![allow(unused)]
</span>
<span class="boring">fn main() {
</span><span class="boring">}</span></code></pre></pre>
</span><span class="boring">fn main() {
</span>fn embedded_resource() -&gt; Option&lt;Resource&lt;Texture&gt;&gt; {
let data = include_bytes!("texture.png");
TextureResource::load_from_memory(
Default::default(),
data,
TextureImportOptions::default()
.with_compression(CompressionOptions::NoCompression)
.with_minification_filter(TextureMinificationFilter::Linear),
)
.ok()
}
<span class="boring">}</span></code></pre></pre>
<div style="break-before: page; page-break-before: always;"></div><h1 id="model-resources"><a class="header" href="#model-resources">Model resources</a></h1>
<h2 id="supported-formats"><a class="header" href="#supported-formats">Supported formats</a></h2>
<p>Fyrox supports these file formats for 3D models:</p>
Expand Down
16 changes: 13 additions & 3 deletions resources/resources.html
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,19 @@ <h2 id="internal-state-and-access-to-data"><a class="header" href="#internal-sta
Internally Fyrox relies on <code>fetch</code> API, which is async by design and non-blocking. All these problems could be
avoided by embedding resources directly in the binary of your game using <code>include_bytes!</code> macro:</p>
<pre><pre class="playground"><code class="language-rust"><span class="boring">#![allow(unused)]
</span>
<span class="boring">fn main() {
</span><span class="boring">}</span></code></pre></pre>
</span><span class="boring">fn main() {
</span>fn embedded_resource() -&gt; Option&lt;Resource&lt;Texture&gt;&gt; {
let data = include_bytes!("texture.png");
TextureResource::load_from_memory(
Default::default(),
data,
TextureImportOptions::default()
.with_compression(CompressionOptions::NoCompression)
.with_minification_filter(TextureMinificationFilter::Linear),
)
.ok()
}
<span class="boring">}</span></code></pre></pre>

</main>

Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.json

Large diffs are not rendered by default.

0 comments on commit 688a128

Please sign in to comment.