Module frenderer::frenderer

source ·
Expand description

Renderer is the main user-facing type of this crate. If you want a renderer as quickly as possible, you can use crate::Driver if you have kept the winit feature flag on. If you don’t need frenderer to initialize wgpu or windowing for you, you can instead use Renderer::with_gpu to construct a renderer with a given instance, adapter, device, and queue (wrapped in a crate::gpu::WGPU struct), dimensions, and surface. Renderer’s built-in rendering scheme uses off-screen rendering at a given resolution, then a color postprocessing step to produce output on the wgpu::Surface.

Besides managing the swapchain, Renderer also offers facilities for accessing the internal data of a sprite renderer, a textured unlit mesh renderer, and a flat-colored unlit mesh renderer, as well as a color postprocessing step. Accesses to subsets of their data through Renderer are recorded for upload before rendering starts; so, any sprite transform data or mesh data accessed through Renderer will be marked for upload automatically. This won’t always be the most efficient strategy, but you can always create your own crate::sprites::SpriteRenderer for example and use your own scheme.

It is also important to note that you don’t actually need to create a Renderer to use the rendering strategies in this crate. It’s just a convenience.

Re-exports§

Structs§

Traits§