pub struct GpuLayerUniform { /* private fields */ }Expand description
Per-layer 16-byte uniform buffer uploading physical viewport dimensions and GPU scroll offset.
Implementations§
Source§impl GpuLayerUniform
Construction helper for GpuLayerUniform.
impl GpuLayerUniform
Construction helper for GpuLayerUniform.
Sourcepub fn new(viewport_w: f32, viewport_h: f32, scroll_offset: [f32; 2]) -> Self
pub fn new(viewport_w: f32, viewport_h: f32, scroll_offset: [f32; 2]) -> Self
Creates a 16-byte layer uniform carrying physical viewport dimensions and scroll translation.
§Arguments
f32- Physical viewport width in pixels.f32- Physical viewport height in pixels.[f32; 2]- Retained layer scroll offset[scroll_x, scroll_y]in physical pixels.
§Returns
Self- Packed 16-byte GPU layer uniform.
Source§impl GpuLayerUniform
impl GpuLayerUniform
pub fn get_viewport_size(&self) -> [f32; 2]
pub fn get_mut_viewport_size(&mut self) -> &mut [f32; 2]
pub fn set_viewport_size(&mut self, val: [f32; 2]) -> &mut Self
pub fn get_scroll_offset(&self) -> [f32; 2]
pub fn get_mut_scroll_offset(&mut self) -> &mut [f32; 2]
pub fn set_scroll_offset(&mut self, val: [f32; 2]) -> &mut Self
Trait Implementations§
Source§impl Clone for GpuLayerUniform
impl Clone for GpuLayerUniform
impl Copy for GpuLayerUniform
Source§impl Debug for GpuLayerUniform
impl Debug for GpuLayerUniform
Source§impl Default for GpuLayerUniform
impl Default for GpuLayerUniform
Source§impl PartialEq for GpuLayerUniform
impl PartialEq for GpuLayerUniform
impl StructuralPartialEq for GpuLayerUniform
Auto Trait Implementations§
impl Forget for GpuLayerUniform
impl Freeze for GpuLayerUniform
impl Move for GpuLayerUniform
impl RefUnwindSafe for GpuLayerUniform
impl Send for GpuLayerUniform
impl Sync for GpuLayerUniform
impl Unpin for GpuLayerUniform
impl UnsafeUnpin for GpuLayerUniform
impl UnwindSafe for GpuLayerUniform
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
Mutably borrows from an owned value. Read more