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.
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.
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