Files
2020-07-14 14:12:44 +00:00

40 lines
8.8 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `render` mod in crate `sdl2`."><meta name="keywords" content="rust, rustlang, rust-lang, render"><title>sdl2::render - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><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='../../sdl2/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module render</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</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'>sdl2</a></p><script>window.sidebarCurrent = {name: 'render', 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!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><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><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/sdl2/render.rs.html#1-2381' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>sdl2</a>::<wbr><a class="mod" href=''>render</a></span></h1><div class='docblock'><p>2D accelerated rendering</p>
<p>Official C documentation: https://wiki.libsdl.org/CategoryRender</p>
<h1 id="introduction" class="section-header"><a href="#introduction">Introduction</a></h1>
<p>This module contains functions for 2D accelerated rendering.</p>
<p>This API supports the following features:</p>
<ul>
<li>single pixel points</li>
<li>single pixel lines</li>
<li>filled rectangles</li>
<li>texture images</li>
<li>All of these may be drawn in opaque, blended, or additive modes.</li>
</ul>
<p>The texture images can have an additional color tint or alpha modulation
applied to them, and may also be stretched with linear interpolation,
rotated or flipped/mirrored.</p>
<p>For advanced functionality like particle effects or actual 3D you should use
SDL's OpenGL/Direct3D support or one of the many available 3D engines.</p>
<p>This API is not designed to be used from multiple threads, see
<a href="http://bugzilla.libsdl.org/show_bug.cgi?id=1995">this bug</a> for details.</p>
<hr />
<p>None of the draw methods in <code>Canvas</code> are expected to fail.
If they do, a panic is raised and the program is aborted.</p>
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table><tr class='module-item'><td><a class="struct" href="struct.Canvas.html" title='sdl2::render::Canvas struct'>Canvas</a></td><td class='docblock-short'><p>Manages and owns a target (<code>Surface</code> or <code>Window</code>) and allows drawing in it.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.CanvasBuilder.html" title='sdl2::render::CanvasBuilder struct'>CanvasBuilder</a></td><td class='docblock-short'><p>The type that allows you to build Window-based renderers.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.DriverIterator.html" title='sdl2::render::DriverIterator struct'>DriverIterator</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.RendererContext.html" title='sdl2::render::RendererContext struct'>RendererContext</a></td><td class='docblock-short'><p>Manages what keeps a <code>SDL_Renderer</code> alive</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.RendererInfo.html" title='sdl2::render::RendererInfo struct'>RendererInfo</a></td><td class='docblock-short'><p>A structure that contains information on the capabilities of a render driver
or the current render context.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.SdlError.html" title='sdl2::render::SdlError struct'>SdlError</a></td><td class='docblock-short'><p>Contains the description of an error returned by SDL</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Texture.html" title='sdl2::render::Texture struct'>Texture</a></td><td class='docblock-short'><p>A texture for a rendering context.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.TextureCreator.html" title='sdl2::render::TextureCreator struct'>TextureCreator</a></td><td class='docblock-short'><p>Creates Textures that cannot outlive the creator</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.TextureQuery.html" title='sdl2::render::TextureQuery struct'>TextureQuery</a></td><td class='docblock-short'></td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
<table><tr class='module-item'><td><a class="enum" href="enum.BlendMode.html" title='sdl2::render::BlendMode enum'>BlendMode</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.TargetRenderError.html" title='sdl2::render::TargetRenderError enum'>TargetRenderError</a></td><td class='docblock-short'><p>Possible errors returned by targeting a <code>Canvas</code> to render to a <code>Texture</code></p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.TextureAccess.html" title='sdl2::render::TextureAccess enum'>TextureAccess</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.TextureValueError.html" title='sdl2::render::TextureValueError enum'>TextureValueError</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.UpdateTextureError.html" title='sdl2::render::UpdateTextureError enum'>UpdateTextureError</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.UpdateTextureYUVError.html" title='sdl2::render::UpdateTextureYUVError enum'>UpdateTextureYUVError</a></td><td class='docblock-short'></td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
<table><tr class='module-item'><td><a class="trait" href="trait.RenderTarget.html" title='sdl2::render::RenderTarget trait'>RenderTarget</a></td><td class='docblock-short'><p>Represents structs which can be the target of a <code>SDL_Renderer</code> (or Canvas).</p>
</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.drivers.html" title='sdl2::render::drivers fn'>drivers</a></td><td class='docblock-short'><p>Gets an iterator of all render drivers compiled into the SDL2 library.</p>
</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.SurfaceCanvas.html" title='sdl2::render::SurfaceCanvas type'>SurfaceCanvas</a></td><td class='docblock-short'><p>Alias for a <code>Canvas</code> that was created out of a <code>Surface</code></p>
</td></tr><tr class='module-item'><td><a class="type" href="type.WindowCanvas.html" title='sdl2::render::WindowCanvas type'>WindowCanvas</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 = "sdl2";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>