pub struct Renderer { /* private fields */ }Implementations§
Source§impl Renderer
impl Renderer
pub fn new( device: Device, queue: Queue, format: TextureFormat, width: u32, height: u32, ) -> Self
pub fn resize(&mut self, width: u32, height: u32)
pub fn camera_mut(&mut self) -> &mut Camera
pub fn camera_ref(&self) -> &Camera
pub fn set_fade(&mut self, fade: f32)
Sourcepub fn configure_surface(
&self,
surface: &Surface<'_>,
config: &SurfaceConfiguration,
)
pub fn configure_surface( &self, surface: &Surface<'_>, config: &SurfaceConfiguration, )
Reconfigure a surface owned by the caller (e.g. GraphView) using this
renderer’s device. GraphView owns surface/config but not the wgpu
Device (that lives inside Renderer), so surface reconfiguration on
resize is routed through here to keep device ownership in one place.
Sourcepub fn max_surface_dimension(&self) -> u32
pub fn max_surface_dimension(&self) -> u32
The largest surface dimension this device will accept. Configuring a
surface beyond it is a validation error, which on wasm aborts the whole
instance — see fit_within_max_dimension.
pub fn set_nodes(&mut self, nodes: &[NodeInstanceData])
Sourcepub fn set_labels(&mut self, labels: &[LabelDraw<'_>])
pub fn set_labels(&mut self, labels: &[LabelDraw<'_>])
Record this frame’s label survivors; shapes only labels not already in the shaped-buffer cache.
Sourcepub fn set_pixel_ratio(&mut self, ratio: f32)
pub fn set_pixel_ratio(&mut self, ratio: f32)
Set the host’s device pixel ratio (physical pixels per CSS pixel).
The caller is responsible for sizing the canvas backing store and
calling resize with the resulting physical size;
this only tells the engine how to interpret the sizes it states in
pixels itself. See Camera::pixel_ratio.
pub fn pixel_ratio(&self) -> f32
pub fn set_edges(&mut self, edges: &[EdgeLineData])
pub fn set_halos(&mut self, halos: &[HaloInstanceData])
Sourcepub fn tick(&mut self, dt_ms: f32, dur_ms: f32)
pub fn tick(&mut self, dt_ms: f32, dur_ms: f32)
Advance the camera glide by dt_ms (paced by dur_ms).
Sourcepub fn glide_bounds(&mut self, min: [f32; 2], max: [f32; 2])
pub fn glide_bounds(&mut self, min: [f32; 2], max: [f32; 2])
Glide the camera to frame world-AABB [min,max].
Sourcepub fn fit_view(&mut self)
pub fn fit_view(&mut self)
Fit the camera to the current node set (including radii). No-op if empty.
Fits the bounds exactly, with no lower limit on the framed region —
so a one-node set zooms until that node fills the viewport. Callers
framing whatever content happens to be loaded almost always want
fit_view_at_least instead.
Sourcepub fn fit_view_at_least(&mut self, min_extent: f32)
pub fn fit_view_at_least(&mut self, min_extent: f32)
Fit the camera to the current node set, never framing a region tighter
than min_extent world units on either axis. No-op if empty.
Auto Trait Implementations§
impl !Freeze for Renderer
impl !RefUnwindSafe for Renderer
impl !UnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnsafeUnpin for Renderer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more